nerdexam
Cisco

350-901 · Question #75

Refer to the exhibit. Which RESTCONF verb changes the GigabitEthernet2 interface from 192.168.100.1/24 to 10.10.10.1/24? import json, requests USER = 'admin' PASS = 'cisco' url =…

The correct answer is B. PATCH. To modify an existing configuration attribute in RESTCONF, the PATCH HTTP method is used, as it applies partial updates to a resource.

Understanding and Using APIs

Question

Refer to the exhibit. Which RESTCONF verb changes the GigabitEthernet2 interface from 192.168.100.1/24 to 10.10.10.1/24? import json, requests USER = 'admin' PASS = 'cisco' url = "https://ios-xe-mgmt.cisco.com:9443/restconf/data/Cisco-IOS-XE-native:native"
"/interface/GigabitEthernet=2/ip/address/primary" payload = {"primary": {"address": "10.10.10.1", "mask": "255.255.255.0"}} data = json.dumps(payload) headers = { 'Accept': "application/yang-data+json", 'Content-Type': "application/yang-data+json", } response = requests.request(" ", url, auth=(USER, PASS), data=data, headers=headers, verify=False) print(response.text)

Options

  • APOST
  • BPATCH
  • CGET
  • DHEAD

How the community answered

(67 responses)
  • A
    3% (2)
  • B
    75% (50)
  • C
    6% (4)
  • D
    16% (11)

Why each option

To modify an existing configuration attribute in RESTCONF, the PATCH HTTP method is used, as it applies partial updates to a resource.

APOST

POST is used to create new resources or submit data to be processed, not to modify existing attributes of a resource.

BPATCHCorrect

The PATCH HTTP method is specifically designed for applying partial modifications to a resource, which is exactly what's needed when changing an existing IP address on an interface without replacing the entire interface configuration. RESTCONF leverages PATCH to update specific data nodes within a YANG data model.

CGET

GET is used to retrieve data from a resource, not to modify it.

DHEAD

HEAD is used to retrieve only the headers of a resource, similar to GET but without the response body.

Concept tested: RESTCONF HTTP methods for configuration updates

Source: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/171/b_171_programmability_cg/restconf_support.html#C_RESTCONF_VERBS

Topics

#RESTCONF#HTTP Verbs#API Interaction#Network Configuration

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice