nerdexam
CiscoCisco

300-435 · Question #152

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

The correct answer is A: response = requests.request( "PUT", url, headers=headers, data=json.dumps(policy), verify=False ) if response.ok:. Updating an existing SD-WAN Fabric Policy requires a PUT request with SSL verification disabled (verify=False) for a non-production environment script.

Controller-Based Network Automation

Question

Refer to the exhibit. A Cisco Catalyst SD-WAN Fabric Policy must be created in a non-production environment. To implement this, a Python script that pulls the existing policy and updates the preferred route to be over MPLS must be run during the Scripting window. Which code snippet must be added to the box in the code to complete the Python script? The initial part of the Python script is not shown.

Options

  • Aresponse = requests.request( "PUT", url, headers=headers, data=json.dumps(policy), verify=False ) if response.ok:
  • Bresponse = requests.request( "POST", url, headers=headers, data=json.dumps(policy), verify=False ) if response.ok:
  • Cresponse = requests.request( "POST", url, headers=headers, data=json.dumps(policy), verify=True ) if response.ok:
  • Dresponse = requests.request( "PUT", url, headers=headers, data=json.dumps(policy), verify=True ) if response.ok:

Explanation

Updating an existing SD-WAN Fabric Policy requires a PUT request with SSL verification disabled (verify=False) for a non-production environment script.

Common mistakes.

  • B. POST is used to create a new resource, not to update an existing one - using POST here would attempt to create a duplicate policy rather than modifying the preferred route.
  • C. POST is incorrect for updating an existing policy, and verify=True would fail in non-production environments using self-signed certificates.
  • D. PUT is correct but verify=True would cause SSL verification failures against self-signed certificates in a non-production vManage environment.

Concept tested. SD-WAN vManage API PUT method for policy update

Reference. https://developer.cisco.com/docs/sdwan/

Topics

#REST API#Python requests library#SD-WAN Automation#HTTP Methods

Community Discussion

No community discussion yet for this question.

Full 300-435 PracticeBrowse All 300-435 Questions