Professional Documents
Culture Documents
CHAPTER 7
AUTOMATION
1
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
CHAPTER7: AUTOMATION
- Chapter’s Agenda:
7.1 Interpret basic Python components and scripts
7.2 Construct valid JSON encoded file
7.3 Describe the high-level principles and benefits of a data modeling language, such as YANG
7.4 Describe APIs for Cisco DNA Center and vManage
7.5 Interpret REST API response codes and results in payload using Cisco DNA Center and RESTCONF
7.6 Construct EEM applet to automate configuration, troubleshooting, or data collection
7.7 Compare agent vs. agentless orchestration tools, such as Chef, Puppet, Ansible, and SaltStack
2
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
7.1 Python
- programming language
- source-free
- object-oriented
- simple understandable text
- standard-library
- Python Components
- PRINT
- to show any result of any program or process
- python will print whatever inside a (" ") or (‘ ‘)
- ignoring the () and " ''
- COMMENT
- a note for the programmer only to read or memorize
- python will print nothing of the comment
- # sign refers to a comment on the right
3
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- VARIABLES
- a storage of data to refer to
- must start with an alphabetic letter
- case sensitive
- INPUT
- requires a user to execute an input
- CONDITIONALS
- if statement
- controls an execution based on a condition
- multiple conditions can occur
- resulting in multiple executions
- this will require using “else-if”
- AKA “elif”
- LOOPS
- execute a series of codes multiple times, automatically
4
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- LOGICAL OPERATORS
- and, or, not
- and (all the statements must be true)
- or (at least one statement must be true)
- not (one statement that must not be true)
5
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- JSON Values
- always surrounded by a curly bracket { }
- name:value pairs
- a string must be enclosed with double quotes “ ”
- like = {“name”:”III”, “job”:”channel”, “location”:”YouTube”}
6
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- {“Route”:Null}
7
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
8
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- YANG components
- containers
- like creating an empty folder
- that still requires to be filled with data
- leafs
- the data that fills a container
- can either be configurable specs or just informational
* the YANG modules are built-in in the devices
9
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- API types
- Internal API
- between applications
- like transferring data from HTML to PDF
- Web-Service API
- exchanging data between remote devices
- Uses IP address
- like REST-Based API
11
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
12
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- for every nourthbound, REST-API being sent from an API application to a client
- a response code will be replied back to the application
- indicating the status of API health and
if it reached the other side properly or not
- most common response codes can be:
14
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
15
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- policy
- policy (reaction): either applet or script
- applets:
- create a small policy application
- applet with event detectors will monitor for an event to occur
- then the applet will paste a config
- it also can pop-up a message
- or send you a notification (by E-Mail)
16
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
- Master/Agent Relation
- each component should be installed on its side
- agent mostly is built-in
- some programs are agentless
- just directly pushes the config to the nodes
- push, to send immediately or at a schedule
- pull, a client asks if there is a change periodically
17
Cisco CCNP & CCIE Enterprise Core - ENCOR 350-401
18