CCNA 200-301 · Automation and Programmability · easy
A Python script calls the Cisco Catalyst Center (DNA Center) REST API over HTTPS to retrieve the current inventory list of all managed network switches without modifying any device state, and receives a successful payload. Which HTTP method and HTTP status code pair corresponds to this read-only API request?
Published · Last updated · checked before publication — how we verify questions
Options
Answer: A. HTTP GET returning status code 200 OK
A read-only inventory query to Catalyst Center maps to the HTTP GET method. GET is defined as safe and idempotent: it asks the server for a representation of a resource and does not change state, which matches retrieving the list of managed devices. A successful retrieval is reported with status code 200 OK, and the inventory data is carried in the response body, usually as JSON. The question gives two clues, so both halves of each option must be checked: the method must be read-only, and the status code must indicate success with a payload. The common trap is to pick an option on the method alone, or to ignore the stated result. Options with 4xx or 5xx codes cannot match a scenario that received a successful payload, no matter which verb they use. Also remember the CRUD mapping the exam expects: POST creates, GET reads, PUT updates or replaces, and DELETE removes. Status code classes are 2xx success, 3xx redirection, 4xx client error, and 5xx server error.
Why the other options are wrong
- B. HTTP POST returning status code 401 Unauthorized — POST is used to create a resource or trigger an action, so it is not a read-only retrieval. The 401 Unauthorized code means authentication failed, which contradicts the successful payload described in the scenario.
- C. HTTP DELETE returning status code 404 Not Found — DELETE removes a resource, which would modify device or inventory state and violates the read-only requirement. The 404 Not Found code means the target URI does not exist, which is an error, not a successful retrieval.
- D. HTTP PUT returning status code 500 Internal Server Error — PUT replaces or updates an existing resource, so it changes state and is not a read operation. The 500 Internal Server Error code indicates a server-side fault, which contradicts the successful response in the scenario.
More Automation and Programmability questions
- A network automation engineer is comparing Ansible and Puppet/Chef for automating VLAN and OSPF configurations across…
- When automating Cisco IOS XE devices using model-driven programmability, an engineer must choose between NETCONF and…
- On a Cisco Catalyst switch, a legacy router calculates every route locally using distributed OSPF hellos and builds…
- Examine the following JSON payload returned by a Cisco IOS XE RESTCONF query: json { "ietf-interfaces:interface": {…
- In a software-defined network (SDN) managed by Cisco Catalyst Center (formerly Cisco DNA Center), an external IT…
All Automation and Programmability questions and the topic overview →
Cisco and CCNA are trademarks of Cisco Systems, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Cisco Systems, Inc.