Network Automation and APIs Flashcards
6 cards from real Cisco CCNA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Network Automation and APIs flashcards as text
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?
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]
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?
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]
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?
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.
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?
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.
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?
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.
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?
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 (`value`) or YAML's indentation-based structure.