nerdexam
Cisco

350-901 · Question #85

Refer to the exhibit. An engineer needs to change the IP address via RESTCONF on interface GigabitEthernet2. An error message is received when the script is run. Which amendment to the code will…

The correct answer is A. Change POST to PATCH. To modify an existing configuration attribute like an IP address on an interface using RESTCONF, the HTTP PATCH method should be used to apply a partial update to the resource.

Understanding and Using APIs

Question

Refer to the exhibit. An engineer needs to change the IP address via RESTCONF on interface GigabitEthernet2. An error message is received when the script is run. Which amendment to the code will result in a successful RESTCONF action?

Options

  • AChange POST to PATCH.
  • BIssue a DELETE before PATCH.
  • CIssue a DELETE before POST.
  • DChange POST to GET

How the community answered

(38 responses)
  • A
    89% (34)
  • B
    3% (1)
  • C
    5% (2)
  • D
    3% (1)

Why each option

To modify an existing configuration attribute like an IP address on an interface using RESTCONF, the HTTP PATCH method should be used to apply a partial update to the resource.

AChange POST to PATCH.Correct

The PATCH HTTP method is specifically designed for applying partial modifications to an existing resource, such as changing an IP address on an interface. Using PATCH allows for updating specific data nodes within a YANG model without requiring a full replacement of the resource.

BIssue a DELETE before PATCH.

Issuing a DELETE before PATCH would remove the configuration entirely before attempting to modify it, which is not the intended action to simply change an IP address.

CIssue a DELETE before POST.

Issuing a DELETE before POST would remove and then attempt to create a new resource, but POST is for creation, not modification of an existing IP address.

DChange POST to GET

GET is used to retrieve resource data and does not perform any modification to the configuration.

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 Methods#API Interaction#Network Configuration

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice