350-401 · Question #1048
Refer to the exhibit. What does the Python code accomplish?
The correct answer is A. It configures interface e1/32 to be in an admin down state. The Python code uses a PUT request with a RESTCONF API to configure interface e1/32 to an administratively down state.
Question
Refer to the exhibit. What does the Python code accomplish?
Exhibits
Options
- AIt configures interface e1/32 to be in an admin down state
- BIt generates a status code of 403 because the type is incorrect.
- CIt configures interface e1/32 to be in an err-disable state.
- DIt returns data in JSON-RPC format.
How the community answered
(36 responses)- A72% (26)
- B8% (3)
- C3% (1)
- D17% (6)
Why each option
The Python code uses a PUT request with a RESTCONF API to configure interface `e1/32` to an administratively down state.
The script performs an HTTP `PUT` request to a RESTCONF endpoint targeting `ietf-interfaces:interfaces/interface=e1%2f32`. The `payload` explicitly sets `"enabled": False` for this interface. In network device configurations, setting an interface's enabled state to false is equivalent to administratively shutting it down.
There is no inherent reason for a 403 (Forbidden) status code; the `Content-Type` is correctly set, implying the issue would be authentication or authorization, not type.
Setting `enabled: False` configures an interface to be administratively down, not in an `err-disable` state, which is triggered by error conditions.
The request payload and expected response are in JSON format (`application/yang-data+json`), not JSON-RPC, which has a distinct structure including 'jsonrpc' version and 'method' fields.
Concept tested: RESTCONF API interface configuration
Source: https://www.cisco.com/c/en/us/td/docs/ios-xr/ncs5500/programmability/74x/b-programmability-cg-ncs5500-74x/restconf_api.html
Topics
Community Discussion
No community discussion yet for this question.

