Chap 28 - Foundational Network Programmability Concepts Flashcards
What are APIs?
Application Programming Interface - APIs are mechanisms used to communicate with applications and other software.
What is a Northbound API?
Northbound APIs are often used to communicate from a network controller to its management software.
What is a Southbound API?
Changes are pushed down to the individual devices by using a Southbound API.
What is a RESTful API?
RESTful APIs use HTTP methods to gather and manipulate data. Because there is a defined structure for how HTTP works, it offers a consistent way to interact with APIs from multiple vendors.
What are 5 HTTP functions used by REST?
* Get - requests data * Post - submits data * Put - replaces data * Patch - appends data * Delete - removes data
What is CRUD?
An acronym for Create - inserts data, Read - retrieves data, Update - modifies or replaces data, Delete - removes data. These all refer to actions taken in a database or application.
What is Postman?
Postman is an application that makes it possible to interact with APIs using a console-based approach. Postman allows for the use of various data types and formats to interact with REST-based APIs.
What are 2 of the most common data formats used with APIs?
* Extensible Markup Language (XML) * JavaScript Object Notation (JSON)
What are 6 HTTP Status Codes?
* 200 - ok * 201 - created * 400 - bad request * 401 - unauthorized * 403 - forbidden * 404 - not found
What format does DNA Center expect all incoming data from the REST API to be in?
JSON format
What HTTP function is used to send credentials to Cisco DNA Center?
HTTP POST function
What is Cisco DNA Center Token API used for?
To authenticate users
How long is the token you receive from DNA good until?
Only for the current session.
What type of http operation is performed to authenticate?
POST
What is a YANG Data Model?
YANG Data models describe whatever can be configured, monitored, all the administrative actions that can be executed, and all the notifications that the device is capable of generating.
What is NETCONF?
It is an IETF standard protocol that uses the YANG data models to communicate with the various devices on the network.
What protocols does NETCONF run over?
NETCONF runs over SSH, TLS, and (although not common), Simple Object Access Protocol (SOAP).
What are 2 differences between NETCONF and SNMP?
* SNMP can’t distinguish between configuration data and operational data, but NETCONF can * NETCONF uses paths to describe resources, whereas SNMP uses object identifiers (OIDs).
What are 2 things NETCONF can do?
* Collects status * Changes config * Takes administrative actions * Sends event notifications * Does backups and restores * Tests configurations before finalizing them
What are 7 characteristics about Transactions?
* All or nothing * No order or sequencing * Processed in same order every time * Run in parallel state * Have no impact on each other * Do not overwrite or interfere with each other * Do not impact each other if same transaction is run against multiple devices
What does NETCONF do when a TCP connection has been made?
* NETCONF exchanges information called capabilities * Capabilities tell the client what the device it’s connected to can do.
What are 5 common operations NETCONF can do?
* get * get-config * edit-config * copy-config * delete-config
What does NETCONF use to send information between hosts?
NETCONF uses Remote Procedure Call (RPC) messages in XML format to send the information between hosts.
Where does NETCONF store information?
Information and configurations are stored in datastores. Datastores can be manipulated by using the 5 common NETCONF operations
What is RESTCONF?
RESTCONF is used to programmatically interface with data defined in YANG models while also using the datastore concepts defined in NETCONF.
What is the goal of RESTCONF?
RESTCONF’s goal is to provide a RESTful API experience while still leveraging the device abstraction capabilities provided by NETCONF.
What data modeling does RESTCONF use?
RESTCONF uses the same YANG models as NETCONF
What operations does RESTCONF use?
* GET * POST * PUT * DELETE * OPTIONS
What structured data formats does RESTCONF use?
RESTCONF requests and responses can use either JSON or XML structured data formats.
What are 5 tabs across the top of DEVNET webpage?
* Discover * Technologies * Community * Support * Events
In Python scripts what marks the beginning and end of a multi-line string?
3 quotation marks begin and end a multiple-line string.
In Python what does a # mean?
The # indicates a comment in a Python script.
In XML what are the start and end tags?
* Start tag * End tag
What is one of the key features of XML
It is readable by both humans and applications.
What makes XML more readable?
Indentation, although not required, makes it much more readable.
How does JSON store its information?
key/value pairs
In JSON how can you tell the beginning and the end of an object?
Curly braces. Each object begins with a { and ends with a }
In JSON how do the key/value pairs appear?
Each key and each value are in double quotes. Key is listed first Value last. The Key and Value are separated by a colon : * Key/Value pairs within an object are separated from each other by a comma ,
In Python how do you do a multi-line string?
Begin with 3 double-quotes “”” and end with 3 double-quotes “””
In Python what are 2 ways to create a function?
* def MY_FUNCTION () * print (dnac_devices)
When using Postman to do an API call what 4 pieces of information do you need?
* The URL of the API * The type of HTTP operation * Headers Content-type key * The body must contain the username and password keys
What are the 3 fundamental data structures in YANG?
* Container - encloses a list of child elements * Leaf - contains a value but no child elements * List
How can you recognize a NETCONF element?
It will be an XML file and have ‘ at the end.
In Python how do you create a logical ‘if’ function?
* if ENVIRONMENT_IN_USE == “sandbox” * The action taken if the ‘if’ statement is true will appear directly below it.
What authentication method is used by DNA Center?
Basic authentication
What are 3 purposes of the Repository in GitHub?
* Store a developers code * Option to share a developers code with other users * Provides documentation on code examples
When using the Cisco vManage Authentication API, what is the Headers Content-Type that is used?
x-www-form-urlencoded
When using the Cisco vManage Authentication API, what is the authentication that is used?
The body must contain keys with the j_username devnetuser and thej_password Cisco123!.
What is the DevNet community page used for?
* To ask questions * To access DevNet Ambassadors and Evangelists
What is this an example of:
< users >
< user >
< name > root name >
user >
< user >
< name > Jason name >
user >
< user >
< name > Jamie name >
user >
< user >
< name > Luke name >
user >
users
XML
What is this an example of:
{
“user”: “root”,
“father”: “Jason”,
“mother”: “Jamie”,
“friend”: “Luke”
}
JSON
What is this an example of:
list interface {
key “name”;
leaf name {
type string;
}
leaf speed {
type enumeration {
enum 10m;
enum 100m;
enum auto;
}
}
leaf observed-speed {
type uint32;
config false;
}
}
YANG output
What is OnePK
A Cisco-proprietary API
What is OpenFlow?
An imperative SDN model that is a standardized API that allows a controller to direct the forwarding functions of a switch through a secure channel.
What is OpFlex?
A declarative SDN model that is an open and extensible policy protocol for transferring policy in XML or JSON between a network policy controller such as the Cisco APIC and any device.