nerdexam
CiscoCisco

300-435 · Question #114

300-435 Question #114: Real Exam Question with Answer & Explanation

The correct answer is C: sda_fabric_info = {"fabricName": "DNAC_Guide_Fabric"}. To create an SDA Fabric using the Cisco Catalyst Center API, the payload for the POST request must be a JSON object containing a fabricName key with the desired fabric name.

Controller-Based Network Automation

Question

Refer to the exhibit. An engineer must create a network Fabric using the Cisco Catalyst Center (formerly DNA Center) API. Which line of code completes the code snippet? ```python import requests from requests.auth import HTTPBasicAuth import urllib3 BASE_URL = 'https://<CIP Address>' AUTH_URL = '/dna/system/api/v1/auth/token' USERNAME = '<USERNAME>' PASSWORD = '<PASSWORD>' response = requests.post(BASE_URL + AUTH_URL, auth=HTTPBasicAuth(USERNAME, PASSWORD), verify=False) token = response.json()['Token'] headers = {'Content-Type': 'application/json', 'X-Auth-Token': token} SDA_FABRIC_URL = '/dna/intent/api/v1/business/sda/fabric' # MISSING LINE HERE response = requests.post(BASE_URL + SDA_FABRIC_URL, headers=headers, json=sda_fabric_info, verify=False) ```

Options

  • Asda_fabric_info = {"fabricName":"DNAC_Guide_Fabric"}
  • Bsda_fabric_info = {"DNAC_Guide_Fabric"}
  • Csda_fabric_info = {"fabricName": "DNAC_Guide_Fabric"}
  • Dsda_fabric_info = {"fabricName": "DNAC_Guide_Fabric"}

Explanation

To create an SDA Fabric using the Cisco Catalyst Center API, the payload for the POST request must be a JSON object containing a fabricName key with the desired fabric name.

Common mistakes.

  • A. This choice uses double curly braces for the outer dictionary, which would lead to a syntax error in Python; dictionaries are defined with single curly braces.
  • B. This choice provides a list containing a single string, not a dictionary with a key-value pair as required for the API payload.
  • D. This choice is syntactically identical to option C and would also be correct, but typically only one choice is the intended answer in a multiple-choice question format.

Concept tested. Cisco Catalyst Center API - SDA Fabric creation payload

Reference. https://developer.cisco.com/docs/dna-center/#!create-fabric

Topics

#Cisco Catalyst Center API#REST API#Python requests#JSON payload

Community Discussion

No community discussion yet for this question.

Full 300-435 PracticeBrowse All 300-435 Questions