Cisco CCNA Network Automation and APIs 2 — Questions and Answers
Question 1: Which HTTP method is used to partially update an existing resource in a REST API?
- PUT
- POST
- PATCH (Correct answer)
- DELETE
Correct answer: PATCH
PATCH is used for partial updates to an existing resource, while PUT replaces the entire resource.
Question 2: In a REST API response, which HTTP status code indicates that a new resource was successfully created?
- 200 OK
- 201 Created (Correct answer)
- 204 No Content
- 202 Accepted
Correct answer: 201 Created
HTTP 201 Created is the standard response when a POST request successfully creates a new resource.
Question 3: What does the 'I' stand for in the CRUD acronym used with REST APIs?
- CRUD does not contain an 'I' (Correct answer)
- Index
- Insert
- Integrate
Correct answer: CRUD does not contain an 'I'
CRUD stands for Create, Read, Update, Delete — there is no 'I' in the acronym.
Question 4: Which Ansible component describes the desired state of managed devices?
- Inventory
- Playbook (Correct answer)
- Module
- Role
Correct answer: Playbook
An Ansible playbook is a YAML file that defines the desired configuration state for managed hosts.
Question 5: What is the primary advantage of using NETCONF over SNMP for network management?
- NETCONF uses UDP for faster delivery
- NETCONF supports transactional configuration with rollback (Correct answer)
- NETCONF is only used for monitoring, not configuration
- NETCONF requires no authentication
Correct answer: NETCONF supports transactional configuration with rollback
NETCONF provides transactional configuration operations including commit and rollback capabilities, which SNMP lacks.
Question 6: In Python, which library is commonly used to make HTTP REST API calls to network devices?
- paramiko
- netmiko
- requests (Correct answer)
- scapy
Correct answer: requests
The 'requests' library is the standard Python library for making HTTP/REST API calls.
Question 7: Which data serialization format does NETCONF use natively?
- JSON
- XML (Correct answer)
- YAML
- CSV
Correct answer: XML
NETCONF uses XML as its native data encoding format for both configuration data and protocol messages.
Which HTTP method is used to partially update an existing resource in a REST API?