fixed update function
This commit is contained in:
9
main.py
9
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 = {
|
||||
|
||||
Reference in New Issue
Block a user