From 99913a9bf4c3fa269c29558f18d845557a6577ce Mon Sep 17 00:00:00 2001 From: radinpirouz Date: Sun, 15 Feb 2026 00:37:53 +0330 Subject: [PATCH] fixed update function --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index e449cee..5adbf09 100755 --- a/main.py +++ b/main.py @@ -80,10 +80,11 @@ def remove_domain_record(target_domain,target_record): def update_domain_record(target_domain,metadata): target_record = metadata['name'] records_id = get_domain_record_id(target_domain,target_record) - print(records_id) - # req = requests.put(f'https://napi.arvancloud.ir/cdn/4.0/domains/{target_domain}/dns-records/{records_id}',headers=headers) - - + req = requests.put(f'https://napi.arvancloud.ir/cdn/4.0/domains/{target_domain}/dns-records/{records_id}',headers=headers,json=metadata) + if req.status_code == 200: + print(f"Sub Domain {target_record} On Domain {target_domain} Updated ") + else: + print(f'Can Not Update Sub Domain {target_record} On Domain {target_domain} , errror: {req.text}') def cli_create(args): metadata = {