Cisco CCNA Network Automation and APIs 3 — Questions and Answers
Question 1: What is the function of a YANG model in network automation?
- It is a scripting language for routers
- It defines the data structure and constraints for network configuration (Correct answer)
- It encrypts NETCONF sessions
- It provides GUI-based network management
Correct answer: It defines the data structure and constraints for network configuration
YANG (Yet Another Next Generation) is a data modeling language that defines the structure, syntax, and semantics of network configuration data.
Question 2: Which tool uses an agentless architecture and communicates with network devices over SSH by default?
- Puppet
- Chef
- Ansible (Correct answer)
- SaltStack
Correct answer: Ansible
Ansible is agentless and uses SSH (or APIs) to communicate with managed devices, requiring no agent software on endpoints.
Question 3: In a REST API, what does the endpoint '/api/v1/devices/{id}' with a DELETE method accomplish?
- Retrieves a list of all devices
- Creates a new device entry
- Removes the device with the specified ID (Correct answer)
- Updates all device attributes
Correct answer: Removes the device with the specified ID
A DELETE request to a resource URI with a specific ID removes that particular resource from the system.
Question 4: What is a webhook in the context of network automation?
- A type of SSH key used for device authentication
- An HTTP callback triggered by an event to notify another system (Correct answer)
- A CLI command for Cisco IOS automation
- A Python module for network scanning
Correct answer: An HTTP callback triggered by an event to notify another system
A webhook is an HTTP POST callback sent to a URL when a specific event occurs, enabling event-driven automation.
Question 5: Which Cisco platform provides a REST API for managing network infrastructure through a centralized controller?
- Cisco IOS-XE
- Cisco DNA Center (Correct answer)
- Cisco AnyConnect
- Cisco ISE
Correct answer: Cisco DNA Center
Cisco DNA Center (now Cisco Catalyst Center) exposes northbound REST APIs for network intent-based automation and management.
Question 6: When comparing JSON and XML for API data exchange, which statement is accurate?
- XML is lighter weight and easier to parse than JSON
- JSON uses tags like <key> and </key> to structure data
- JSON is generally more human-readable and less verbose than XML (Correct answer)
- XML is the only format supported by REST APIs
Correct answer: JSON is generally more human-readable and less verbose than XML
JSON uses key-value pairs with less syntactic overhead than XML's opening/closing tags, making it more concise and readable.
Question 7: What does 'idempotent' mean when applied to REST API methods?
- The API requires authentication on every call
- Calling the method multiple times produces the same result as calling it once (Correct answer)
- The API response is always cached
- The method only works on a single resource at a time
Correct answer: Calling the method multiple times produces the same result as calling it once
An idempotent operation produces the same outcome regardless of how many times it is called with the same input.
What is the function of a YANG model in network automation?