Cisco CCNA Network Automation and APIs Questions and Answers — Questions and Answers
Question 1: A network administrator needs to automate configuration changes across a multi-vendor network. A key requirement is that no special software or 'agent' can be installed on the network devices. Which configuration management tool is most suitable for this scenario?
- Puppet
- Chef
- Ansible (Correct answer)
- Cisco DNA Center
Correct answer: Ansible
Ansible is an agentless configuration management tool, meaning it communicates with managed devices over standard protocols like SSH without requiring any client software to be installed on them. [9, 12] This makes it ideal for environments where installing agents is not feasible or desirable. Puppet and Chef, in contrast, are primarily agent-based, requiring a client on each managed node. [8, 14] While Cisco DNA Center is a powerful automation platform, it is a full network controller, not just a configuration management tool in the same category as Ansible, Puppet, or Chef. [24]
Question 2: In a Cisco DNA Center architecture, which type of API is used by external applications and orchestration systems to communicate high-level, business-oriented requests or 'intent' to the controller?
- Southbound API
- Westbound API
- Northbound API (Correct answer)
- Eastbound API
Correct answer: Northbound API
Northbound APIs (NBIs) are used for communication between the SDN controller (like Cisco DNA Center) and the applications or orchestration layers above it. [23, 29] These APIs abstract the complexity of the network and allow administrators to define policies and intent. [13] Southbound APIs (SBIs), on the other hand, are used by the controller to communicate with the network devices themselves (e.g., switches and routers) using protocols like NETCONF, RESTCONF, or SNMP. [5, 23]
Question 3: A network engineer is writing a Python script to interact with a device's RESTCONF API. The script needs to retrieve the current state of all interfaces. Which HTTP method should be used in the API request for this read-only operation?
- POST
- GET (Correct answer)
- PUT
- DELETE
Correct answer: GET
The HTTP GET method is used to retrieve data from a specified resource. [1, 7] In the context of REST APIs, this corresponds to the 'Read' operation in CRUD (Create, Read, Update, Delete). [3, 15] POST is used to create a new resource, PUT is used to update or replace an existing resource, and DELETE is used to remove a resource. [7, 15] Since the engineer only wants to retrieve information without making changes, GET is the appropriate method.
Question 4: Which of the following are the two most common data serialization formats used in modern network automation and REST APIs for their human-readable structure?
- SNMP and NetFlow
- HTML and CSS
- Binary and BSON
- JSON and YAML (Correct answer)
Correct answer: JSON and YAML
JSON (JavaScript Object Notation) and YAML (YAML Ain't Markup Language) are widely used data serialization formats in network automation. [10, 26] They provide a standardized, human-readable way to structure data, which is essential for communication between different systems, such as in REST API calls. [16, 28] XML is also a common format but JSON and YAML are often preferred for their simplicity and readability in many modern applications. [20] SNMP, NetFlow, HTML, and Binary are protocols or formats used for other purposes in networking and web development.
Question 5: A network engineer is developing a Python script to make REST API calls to a Cisco Meraki dashboard to automate the creation of new wireless networks. Which standard Python library is most commonly used to handle the HTTP requests and responses for this task?
- Paramiko
- Requests (Correct answer)
- Netmiko
- Scapy
Correct answer: Requests
The 'requests' library is the de facto standard in Python for making HTTP requests to APIs. [2, 11] It simplifies the process of sending GET, POST, PUT, and other HTTP methods. [19] Paramiko and Netmiko are primarily used for automating interactions over SSH, not for web-based REST APIs. [11, 17] Scapy is a library used for packet crafting and analysis at a lower level of the network stack.
Question 6: An engineer is analyzing the following data structure returned by a network device's API call: `{"interfaces": [{"name": "GigabitEthernet0/1", "status": "up"}, {"name": "GigabitEthernet0/2", "status": "down"}]}`. Which data format is being used?
- XML
- YAML
- HTML
- JSON (Correct answer)
Correct answer: JSON
The provided data structure is in JSON (JavaScript Object Notation) format. JSON represents data as key-value pairs (e.g., "name": "GigabitEthernet0/1"), uses curly braces `{}` to define objects, and square brackets `[]` to define arrays (lists). [16] This syntax is distinct from XML's tag-based structure (`<tag>value</tag>`) or YAML's indentation-based structure.
A network administrator needs to automate configuration changes across a multi-vendor network.
A key requirement is that no special software or 'agent' can be installed on the network devices.
Which configuration management tool is most suitable for this scenario?