Question 25 of 32 from exam 300-735-SAUTO: Automating and Programming Cisco Security Solutions

Question 25 of 32 from exam 300-735-SAUTO: Automating and Programming Cisco Security Solutions

Question

import json
import requests

TENAT_ID 132"

TAG_ID = "24"

BASE_URL = "https://198.18.128.136"

CREDENTIALS = {'password': PASS, ‘username’: USER)

DMZ_IP 198.18.128.147

HEADERS = {'Content-type': 'application/json', 'Accept': 'application/json'}

session = requests.Session()
session.post (BASE_URL+"/token/v2/authenticate", data= CREDENTIALS, verify-False)

TAG_URL=BASE_URL+"/smc-configuration/rest/v1/tenants/{0}/tags/{1)}".format (TENAT_ID, TAG_ID)

tag_session = session.get (url=TAG_URL, verify-False) .content .decode ()

Refer to the exhibit.

A network operator wants to add a certain IP to a DMZ tag.

Which code segment completes the script and achieves the goal? A.

tag_data = json.dumps(tag_session) ['data']
tag_data['ranges'] .append(DMZ_IP)
session.put (TAG_URL, json=tag_data, headers=HEADERS, verify=False)

B.

tag_data = json.loads(tag_session) ['data']
tag_data['ranges'].append(DMZ_IP)
session.put(TAG_URL, data=tag_data, headers=HEADERS, verify=False)

C.

tag_data = json.dumps(tag_session) ['data']
tag_data['ranges'] .append(DMZ_IP)
session.put (TAG_URL, data=json.loads(tag_data), headers=HEADERS, verify=False)

D.

tag_data = json.loads(tag_session) ['data']
tag_data['ranges'] .append(DMZ_IP)
session.put (TAG_URL, json=tag_data, headers=HEADERS, verify=False)

Explanations

A.