nerdexam
Cisco

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.

Submitted by dimitri_ru· Mar 6, 2026Automation

Question

Refer to the exhibit. What does the Python code accomplish?

Exhibits

350-401 question #1048 exhibit 1
350-401 question #1048 exhibit 2

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)
  • A
    72% (26)
  • B
    8% (3)
  • C
    3% (1)
  • D
    17% (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.

AIt configures interface e1/32 to be in an admin down stateCorrect

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.

BIt generates a status code of 403 because the type is incorrect.

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.

CIt configures interface e1/32 to be in an err-disable state.

Setting `enabled: False` configures an interface to be administratively down, not in an `err-disable` state, which is triggered by error conditions.

DIt returns data in JSON-RPC format.

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

#Python#REST API#interface admin state#NX-OS API

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice