300-435 ENAUTO 01 (Autosaved)

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 148

300-435

ENAUTO:
Automating and
Programming Cisco
Enterprise Solutions
Topic
Let’s Start …
Find the Topic
Link :
https://learningnetwork.cisco.com/s/ena
uto-exam-topics
1.0
 1.1 Utilize common version control operations with git (add, clone, push, commit, diff,
branching, merging conflict)
 1.2 Describe characteristics of API styles (REST and RPC)
 1.3 Describe the challenges encountered and patterns used when consuming APIs
synchronously and asynchronously
 1.4 Interpret Python scripts containing data types, functions, classes, conditions, and looping
 1.5 Describe the benefits of Python virtual environments
 1.6 Explain the benefits of using network configuration tools such as Ansible and Puppet for
automating IOS XE platforms
Introduction to Git

Version Control Systems


Why Are We Here?
Version Control

The Concurrent Versions System was first designed in the 1980s. Originally, it handled conflicting situations.
For example, when two engineers who worked on the same file, CVS allowed only the latest version of the
code to be worked on and updated. As such, it was a first come, first serve system.
Apache Subversion (SVN) was created as an alternative to CVS. SVN uses atomic operations, meaning that
either all changes that are made to the source are applied or none are applied. No partial changes are allowed,
avoiding many potential issues. A drawback of SVN is its slower speed.

Git was originally built to support the Linux Kernel developing.


Mercurial was originally made to compete with Git for Linux kernel development. Unlike most Version Control
Systems, it’s written in Python and not in C.
“Have you ever:
 Made a change to code, realised it was a mistake and wanted to revert back?
 Lost code or had a backup that was too old?
 Had to maintain multiple versions of a product?
 Wanted to see the difference between two (or more) versions of your code?
 Wanted to prove that a particular change broke or fixed a piece of code?
 Wanted to review the history of some code?
 Wanted to submit a change to someone else's code?
 Wanted to share your code, or let other people work on your code?
 Wanted to see how much work is being done, and where, when and by whom?
 Wanted to experiment with a new feature without interfering with working code?
In these cases, and no doubt others, a version control system should make your life
easier.”

http://stackoverflow.com/a/1408464
Opens up to new workflows: git flow
Distributed

 Each system has an exact replica of the repo as


other collaborators. Version Control

https://git-scm.com/images/about/workflow-b@2x.png
Under the Hood
• Changes are stored in trees
• Trees contain changed files
• Commits contain trees

13

http://git-scm.com/figures/18333fig0903-tn.png
Git Config
• So you can be held accountable, configure git

$ git config --global user.name "Your Name Comes Here"


$ git config --global user.email you@yourdomain.example.com
Git Init
• Initialises a project directory with a hidden directory /.git/

$ tar xzf project.tar.gz


$ cd project
$ git init
Git
Add
• Add any files in your repository to git “stage”

$ git add .
Git Commit
• Store your changes into a commit

$ git commit –m ’Initial commit’


Branching: Your Safe Place
• Makes a pointer to your
code
• Moves HEAD around

$ git branch <name>


$ git branch testing
$ git commit –m “new”
$ git checkout master
18
Merging
• git merge <topic>
• You must be on the branch you want to merge INTO when you execute this
command (e.g. master)

$ git merge <branch>


Share Your Changes
• git push <destination> <branch>
• git push origin master

$ git remote add <name> <url>


$ git push <name> <branch>
$ git push origin master
Git Over SSH Vs HTTP
• No password
• Set up SSH key on remote server

$ git clone git@github.com:aroach/upgraded-guacamole.git

$ git clone https://github.com/aroach/upgraded-guacamole.git


Git Architecture & Github
What is GitHub?

Distributed Version Control System based on Git that is a web-based hosting service Free

Version for public files / code repositories

Git + Code Review GitHub Enterprise

GitHub is a distributed version control system that is based on Git that is a web-based hosting service. It is
the leading git platform for independent and open source projects. While GitHub offers unlimited free
repositories as long as the repository is public, they offer subscriptions for those organizations who want
private repositories.
Git Over SSH Vs HTTP
• No password
• Set up SSH key on remote server

$ git clone git@github.com:aroach/upgraded-guacamole.git

$ git clone https://github.com/ai-devnet/Getting-started-with-


Cisco-SD-WAN-REST-APIs.git
1.2 Describe
characteristics of API
styles (REST and
RPC)
What are APIs?
• APIs are…
• a way for two pieces of software to talk to each
other
• the interface for software systems
• sets of requirements that govern how one
application can talk to another.
For a long time.. Humans
were the only users
But what about when the user is another
software system….
Software returns
results via API

My Software System

Software asks for data


or takes action by
interacting with API

Your Software System


APIs help developers create apps that
benefit the end user.

Google Maps Users sees


returns map data list of
via API restaurants
close to
them

Yelp asks for Map


Data
APIs are…“an engine of innovation”
-Programmable Web
APIs aren’t scary… you already use
them
Representational State Transfer (REST)
• API framework intended to build
simpler web services than SOAP
• Another use for the HTTP
protocol
• Popular due to performance,
scale, simplicity, and reliability
• Technically an API framework
DEVNET-3607

* More detailed coverage in later


lessons
XML-RPC and JSON-RPC
• Simple frameworks for HTTP POST
REQUEST BODY:
communicating over HTTP [
{
"jsonrpc": "2.0",
• RPC = Remote Procedure "method": "cli",
"params":
Call {
"cmd": "show version",
• When one system requests },
"version": 1

another system to execute code "id": 1


}
]
• Offer XML and JSON data
formats respectively
What is REST?
Just Another Use for the HTTP Protocol
• Representational state transfer
(REST)
• API framework built on HTTP
• APIs often referred to as web
services
• Popular due to performance,
scale, simplicity, and
reliability
A Look Under the Hood at REST
The URI: What are you
Requesting?
http://maps.googleapis.com/maps/api/geocode/json?address=sanjos
e Server or Host Resource Parameters

• http:// or https:// • Resource


• Define whether secure or open http • The location of the data or object of
interest on the server
• Server or Host
• Resolves to the IP and port to
• Parameters
connect to • Details to scope, filter, or clarify a
request. Often optional.
1.3 Describe the challenges encountered and patterns used
when consuming APIs synchronously and asynchronous
Synchronous:
 If an API call is synchronous, it means that code
execution will block (or wait) for the API call to
return before continuing. This means that until a
response is returned by the API, your application will
not execute any further, which could be perceived by
the user as latency or performance lag in your app.
 Making an API call synchronously can be beneficial,
however, if there if code in your app that will only
execute properly once the API response is received.
Asynchronous:
Asynchronous calls do not block (or wait) for the API call to
return from the server. Execution continues on in your program,
and when the call returns from the server, a "callback" function
is executed.

In Java, C and C#, "callbacks" are usually synchronous (with respect to a "main event loop").

In Javascript, on the other hand, callbacks are usually asynchronous - you pass a function that will be
invoked ... but other events will continue to be processed until the callback is invoked.

If you don't care what Javascript events occur in which order - great. Otherwise, one very powerful
mechanism for managing asynchronous behavior in Javascript is to use "promises":
Synchronous vs.
Asynchronous
Writes
Synchronous API calls are blocking calls that do not return until either the change has been
completed or there has been an error. For asynchronous calls, the response to the API call is
returned immediately with a polling URL while the request continues to be processed.

In heavier load conditions, it can be more efficient to submit multiple async calls and
periodically check the status than to wait for each call to complete before submitting the
next one.
https://web.dev/promises/
1.4 Interpret
Python scripts
containing data
types, functions,
classes,
conditions, and
looping
 Follow-up with 2 Videos on Python
1.5 Describe the benefits of Python virtual
environments
http://learnpy.cisco.com/learn/devenv/virtualenv
Virtual Environments

In the Python world, virtual environments are a way to keep distinct environments that contain the
requirements particular to each application, tool or script that you can be working on. These are very useful
when working with environments that require specific libraries to function. Take for example that you are
working on a project that is written for Cisco ACI APIC version 1.1j and you are also working in sustaining
your project in the release 1.0(2)m. Instead of having to change the version of the REST API, you could
simply contain two separate virtual environments that each have different versions of the Cobra SDK with
your application.
Virtual environments contain all the requirements for the function of the application, including the version
of Python itself that is required. In this document we will cover how to create virtual environments in
separate operating systems to help you in setting up an environment that contains all the requirements for
Python to develop applications to interface with Cisco ACI and NX-OS.
1.6 Explain the benefits of using
network configuration tools such
as Ansible and Puppet for
automating IOS XE platforms
Configuration Management
Automate the provisioning and deployment of applications and infrastructure No
knowledge of programming required Leverages software development practices for
deployments: Version Control Design Patterns Testing Common tools: Puppet, Ansible,
Chef, and SaltStack

From a networking perspective, it’s common to deploy changes manually. This change could be adding
a VLAN across a data center or campus or making daily changes to firewall policies for new
applications being deployed. When there is a defined manual workflow to perform a set of tasks, proper
tools should be used to automate it. It does not make sense to spend an hour performing a change. This
change could take just a few minutes by using a properly engineered tool. This process is where open
source tools such as Puppet, Chef, Ansible, and SaltStack can dramatically reduce the number of
manual interactions with the network.
 These tools are often referred to as DevOps tools.
They are more specifically configuration
management and automation tools that happen to
be used by those organizations that have
implemented some form of DevOps practices.

 These tools enable you to automate applications,


infrastructure, and networks to a high degree
without the need to do any manual programming.
As an example, using a language like Python.
While they do reduce the time that it Open
Transcript takes to perform certain tasks, they also
offer greater predictability.
2.1 Identify the JSON instance based on a YANG model
2.2 Identify the XML instance based on a YANG model
2.3 Interpret a YANG module tree generated per RFC8340
2.4 Compare functionality, benefits, and uses of OpenConfig, IETF, and native YANG models
2.5 Compare functionality, benefits, and uses of NETCONF and RESTCONF
3.1 Implement device management and monitoring using NetMiko
3.2 Construct a Python script using ncclient that uses NETCONF to
manage and monitor an IOS XE device
3.3 Configure device using RESTCONF API utilizing Python requests
library
3.4 Utilize Ansible to configure an IOS XE device
3.5 Configure a subscription for model driven telemetry on an IOS XE
device (CLI, NETCONF, and RESTCONF)
3.6 Compare publication and subscription telemetry models
•3.6.a Periodic / cadence
•3.6.b On-change
3.7 Describe the benefits and usage of telemetry data in troubleshooting
the network
3.8 Describe Day 0 provisioning methods
•3.8.a iPXE
•3.8.b PnP
•3.8.c ZTP
3.1 Implement device management and
monitoring using NetMiko
What is Netmiko?

Paramiko is the standard Python SSH library.

Netmiko is a multi-vendor networking


library based on Paramiko.
Netmiko Vendors
Accedian
Regularly tested Limited testing Limited testing
Aruba
Arista vEOS Alcatel AOS6/AOS8 Huawei
Ciena SAOS
Cisco ASA Avaya ERS Mellanox
Cisco Telepresence
Cisco IOS Avaya VSP NetApp cDOT
CheckPoint GAiA
Cisco IOS-XE Brocade VDX Palo Alto PAN-OS
Coriant
Cisco IOS-XR Brocade MLX/NetIron Pluribus
Eltex
Cisco NX-OS Calix B6 Ruckus ICX/FastIron
Enterasys
Cisco SG300 Cisco WLC Ubiquity
Extreme EXOS
HP Comware7 Dell-Force10 EdgeSwitch Vyatta
Extreme
HP ProCurve Dell VyOS
PowerConne Wing F5 LTM
Juniper Junos
ct Fortinet
Linux
MRV OptiSwitch
Nokia SR-OS
QuantaMesh
General Notes for Tonight

Before Netmiko.
General Notes for Tonight

After Netmiko.
Installing Netmiko

pip install netmiko

Use a virtual environment

MacOS - Use homebrew and a virtual environment.

Newer versions of Paramiko should be fairly easy to install on Windows


(install python, pip install netmiko).
A simple example
Reference Links

Concurrency:
https://github.com/ktbyers/pynet-ons-oct17/blob/master/threads_procs/

Jinja2 Templating
http://jinja.pocoo.org/docs/2.10/templates/

● Example code is posted here:


https://github.com/ktbyers/pynet/tree/master/pres entations/
dfwcug/examples
Learning Python

My free Python course, next session starts May 8.


https://pynet.twb-tech.com/email-signup.html

Automate the Boring Stuff with Python


https://www.amazon.com/gp/product/1593275994/

Treading on Python Volume 1: Foundations of Python by Matt Harrison


https://www.amazon.com/Treading-Python-1-Foundations/dp/1475266413
Network Automation Resources
NAPALM
https://napalm.readthedocs.io/en/latest/

Frameworks: Ansible and Salt

Brigade: New Python Framework


https://github.com/brigade-auto
mation/brigade

Network Programmability and


Automation Book
https://www.amazon.com/Netw
ork-Programmability-Automatio
n-Next-Generation-Engineer
Follow-up by
9 Videos

This Photo by Unknown Author is licensed under CC BY-SA


3.2 Construct a Python script using ncclient that uses
NETCONF to manage and monitor an IOS XE device
3.3 Configure
device using
RESTCONF API
utilizing Python
requests library
3.4 Utilize Ansible
to configure an
IOS XE device
Introduction to Ansible
Ansible
Characteristics
Open Source Con! guration
Agentless Management

Simple Orchestration

Wide 92
Deployment
Adoption
https://www.ansible.com/blog/coming-soon-networking-features-in-ansible-2.5
Getting started with
Ansible
Ansible Controller
Target
s

SSH
(user/pass, public key)

1. Push configuration
2. Get configuration/state
3. Execute commands

ansible.cfg Inventory Playbooks Modules


Using Ansible
Common Ansible
Terms

?
Let‘s first cover the
basic terms and concepts.
Ansible Configuration – ansible.cfg
• The place for adjusting default settings based on your requirements
• Multiple alternative places for parameters and setting exists
• Typically, default settings are sufficient for most users

• Precedence order of Ansible configuration files (in this order):


1. ANSIBLE_CONFIG (an environment variable)
2. ansible.cfg (in the current directory)
96

3. .ansible.cfg (in the home directory)


4. /etc/ansible/ansible.cfg(global ansible configuration)
Further reading:
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html

Inventory
$ cat ansible/hosts
• INI format file usually called ‘hosts’ [core]
CORE_XR
ansible_host=198.18
• Defines the hosts which Ansible manages [branch1]
.1.5
BRANCH_1_CSR ansible_host=198.18.1.12
BRANCH_1_SWITCH
• Hosts can be grouped together with [] ansible_host=198.18.1.11
[branch2]
BRANCH_2_CSR ansible_host=198.18.1.22
• Additional optional parameters can be defined BRANCH_2_SWITCH
ansible_host=198.18.1.21
[csr]
• Where does Ansible look for the inventory file: BRANCH_1_CSR ansible_host=198.18.1.12

• Option 1 (Default): /etc/ansible/hosts BRANCH_2_CSR ansible_host=198.18.1.22


[switch]
BRANCH_1_SWITCH ansible_host=198.18.1.11
• Option 2: “inventory” parameter in local ansible.cfg BRANCH_2_SWITCH
ansible_host=198.18.1.21
97

• Option 3: -i <path> option on the command line


Further reading:
https://docs.ansible.com/ansible/latest/user_guide/modules.html

Modules https://docs.ansible.com/ansible/latest/modules/modules_by_category.html

• Prepared “Scripts“ performing an action on a host


• All modules ship with Ansible
• 465 „network“ related modules with Ansible 2.4
• 584 „network“ related modules with Ansible 2.5
• 671 „network“ related modules with Ansible 2.7
• Enormous variety of Ansible modules
• You can write your own modules
98
Further reading:
https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html
https://docs.ansible.com/ansible/latest/modules/ping_module.html

Ad-hoc Commands
• Allows you to execute tasks really quick without saving steps
• Useful to understand the basics of how Ansible works

• ansible -m <module> [-a <arguments>] <hosts_section>


• Default module is „command“ („-m command“ can be omitted)
• „-m ping“ is the `Hello World´ of Ansible
$ ansible -a "date" control
localhost | SUCCESS | rc=0 >>
LTRRST- 1954 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 99

$ ansible -m ping core


172.16.20.30 | SUCCESS => {
"changed": false,
"failed": false,
"ping": "pong"
}
Further reading:
https://docs.ansible.com/ansible/latest/user_guide/playbooks.html

Playbooks
$ cat sample.yaml
---
• Ansible‘s method of procedures (MoP) - hosts: control
gather_facts: no
connection: local
• Playbooks store task sequences for later reuse tasks:
- name: PING
• Can have one or more plays and tasks ANSIBLE CONTROL
ping:

• Playbooks are written in YAML - name: DATE


COMMAND ON
CONTROL
command: date

$ ansible-playbook sample.yaml

PLAY [control]
**********************************************************************************************************************
LTRRST- 1954 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
0

TASK [PING ANSIBLE CONTROL]


**********************************************************************************************************************
ok: [localhost]

Further reading:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_templating.html

Jinja2 Templates
• Jinja2 templates further enhance modelling $ cat ios_interface.yaml
- hosts: branch1[0]
capabilities, e.g. including native configlets gather_facts: no
connection:
• Jinja2 templates have access to Ansible variables local

and implement many filters and tests for validation vars:


interfaces:
- name: GigabitEthernet4
• Templating is executed on Ansible controller intf_address: 10.1.10.2
intf_netmask:
255.255.255.252
- name: GigabitEthernet5
$ cat ios_interface.j2 intf_address: 10.1.10.6
{% for interface in interfaces %} intf_netmask:
{% if interface.name.startswith('Gigabit') %} 255.255.255.252
interface {{ interface.name }}
ip address {{ interface.intf_address }} {{ interface.intf_netmask
LTRRST- 1954 }}
© 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public tasks:
10
1
no shutdown - name: BUILD DATA INTERFACE
exit CONFIG
! template:
{% endif %} src: templates/ios_interface.j2
{% endfor %} dest:
configs/ios_interface.cfg

- name: CONFIGURE DATA INTERFACES


ios_config:
Typical Folder
Structure

Project specific inventory


Project specific configuration

YAML playbooks

Folder for configurations


created by templates
Folder for jinja2 templates
3.5 Configure a subscription for model driven telemetry on an IOS XE device (CLI, NETCONF, and RESTCONF)
3.6 Compare publication and subscription telemetry models
3.6.a Periodic / cadence
3.6.b On-change
3.7 Describe the benefits and usage of telemetry data in troubleshooting the network
Model-Driven Telemetry for
IOS XE
Legacy Data Transfer Mechanisms
Insufficient for
Programmatic Environments
Where Data Is Created Where Data Is Useful

SNMP

syslog

CLI
• Interface up/down
• Instantaneous config Storage and
• Instantaneous topology Analytics
• Flow fingerprints
• Routes
SNMP polling hard on
everybody
Devices Network Managers
Request-ID 1:
Sent, No Response

Request-ID 2:
Sent, No Response
Push Not
Pull

Vs

× SNMP ✔ Telemetry Push

Pull
Why this
matters now
New Capabilities New Requirements
• Speed and scale
• Quick fault isolation
• Open source applications
• Near real time data availability
• Automated remediation
• Forensic analysis
Model-Driven Telemetry

Export enriched, consistent and concise data with context from


network devices for a better user and operator experience

Periodic or Structured Data Scalable Reduced CPU


On-Change Load
Model-Driven Telemetry

SNMP Syslog Netflow/SFlow YANG

Device Data Models

DATA CENTER ENTERPRISE SP


Model-Driven
Telemetry
Collector tcollector

Subscription
Periodic or On-change NETCONF

YANG Data Model

Open Native Open Native


Programmable
Interfaces Configuration Operational

Device Features
SNMP
Physical and Virtual Network Infrastructure Interface
BGP QoS ACL …
Data Models and NETCONF
Cisco-IOS-XE-mdt-oper.yang
Data Models

“A Data-Model Explicitly and


precisely defines Data Structure,
Syntax and Semantics”
YANG definition
“YANG - A Data Modeling Language for NETCONF”

Protocol

Data-Model

The Data is NOT


Data defined by NETCONF!

• YANG describes how to structure the Data to send/receive

• Standard defined in RFC 6020

https://tools.ietf.org/html/rfc6020
YANG Models
Example
YANG Models
Data
XML Payload

Xpath mdt-
s ubs c ript ion
period 1000

YANG Models  Data Models defined using the YANG language


YANG Data Models
• Structured Data
• YANG: Flexible, Extensible
• YDK: YANG model -> APIs
• Automation

https://github.com/YangModels/yang

https://github.com/openconfig
Where are YANG
models?
Also can be downloaded from GitHub.

 Models installed on device automatically with IOS-XE.


 On some devices/versions, can be updated independently

https://github.com/YangModels/yang/tree/master/
vendor/cisco
container mdt-oper-data

list mdt-subscriptions
list mdt-connections subscription-id? (ro) uint32
transport? (ro) string type? (ro) mdt-oper:mdt-sub-type container mdt-streams
peer-id? (ro) string state? (ro) mdt-oper:mdt-sub-state stream[]? (ro) string
state? (ro) mdt-oper:mdt-con- comments? (ro) string
state updates-in? (ro) uint64
address? (ro) inet:ip-address updates-dampened? (ro) uint64
port? (ro) uint16 updates-dropped? (ro) uint64

list mdt-receivers
list mdt-sub-con-stats protocol? (ro) string container base
sub-id? (ro) uint32 state? (ro) mdt-oper:mdt-receiver-state stream? (ro) string
updates-sent? (ro) uint64 comments? (ro) string encoding? (ro) string
updates-dropped? (ro) address (ro) inet:ip-address
uint64 port (ro) uint16

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
119 choice update-trigger-choice
choice filter-type-choice

case sub-filter-type-xpath case sub-filter-type-none case sub-upd-trig-on-change case sub-upd-trig-periodic case sub-upd-trig-none
xpath? (ro) string no-filter? (ro) uint32 no-synch-on-start? (ro) boolean period (ro) uint32 no-trigger? (ro) uint32
NETCONF definition
“NETCONF is a protocol defined by the IETF to install, manipulate, and delete the
configuration of network devices”

IOS XE Protocol Stack


V 1.0 V 1.1 16.3.1 Extensions
Content
• RFC 4741 1.0 • RFC 6241 – 1.1 • RFC 5277
Base NETCONF Base NETCONF Notifications
Protocol Protocol • RFC 5717 Partial Operations
Locking
• RFC 4742 • RFC 6242 –
• RFC 6243 With
NETCONF over NETCONF over
defaults Messages
SSH SSH
• RFC 6020 YANG

Transport

2006 2011

https://tools.ietf.org/html/rfc6241
NETCONF vs. YANG

Communication
Protocol Data Description

NETCONF YANG

SNMP MIB/ASN.1
NETCONF
protocol stack
CONTENT XML (based on YANG)

OPERATIONS GET, EDIT-CONFIG, ETC

MESSAGES RPC

SECURE TRANSPORT SSH


Network subscription
Network
Subscription
A subscription is a contract between a subscription service and a subscriber
that specifies the type of data to be pushed.

Instruction on:
• What data to collect
• Where to send it and how
• How often

Collector
Network
Subscription
• Any YANG subtree on device Subscription Publication
• Structured data

• XML or JSON encoding

• Periodic or On-change

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
125
Types of Subscriptions

Periodic On-change
Continuous data Event occurs

Subscriber Subscriber

asynchronous notification uses ‘Patch’ syntax (add, change,


regular cadence sends a complete object set every delete)
time
Publisher Publisher

Datastore Datastore
Periodic
subscription

t t t DEVNET-1693
t t
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
127 t t

Counters / Measures
Periodic
subscription RPC

• Xpath-filter:
• XML Xpath filter defining the data object to which you want to subscribe.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
• Period:
DEVNET-1693
128

• The time period, in centiseconds (100th of a second), between push updates


containing the subscribed information
RPC
reply

Switch reply with


DEVNET-1693
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
129

notification and
subscription-ID
Verify
subscription

Get request for


Cisco-IOS-XE-mdt-oper.yang
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
130
Demo

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
On-change
subscription

t t t DEVNET-1693
t t
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
132 t t

State / Configuration / Identifiers


On-change
subscription RPC

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
133

CDP-neighbor with XPath


and Dampening period
RPC
reply

RPC reply with


DEVNET-1693
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
134

notification
and
subscription-ID
Verify
subscription

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
135
Demo
MDT

Text message

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Delete
subscription
• Subscriptions can be deleted in two ways:
• Send a delete-subscription RPC with the subscription ID (Preferred)
• Close/disconnect the Netconf session
• (All subscriptions created over this session will be deleted)

Delete Subscription RPC

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
137
Streaming Telemetry benefits

over SNMP
devices stream data based on a specified frequency or upon state change
• data is sent as soon as it is available, reducing the need to buffer
• no single large request for all data (unlike SNMP polling)
• data sent incrementally, e.g., only for those data items that have changed
• ability to distribute the telemetry sources (e.g., directly to linecards)
• users issue subscription requests via RPC for data of interest
• data exported in a well-structured, common format, e.g., based on YANG models
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693


138

device and collector communicate over a secure, authenticated, reliable channel


Asset Management System Monitoring Feature Monitoring
openconfig-platform.yang Cisco-IOS-XE-checkpoint-archive-oper.yang Cisco-IOS-XE-acl-oper.yang
Cisco-IOS-XE-platform-oper.yang Cisco-IOS-XE-environment-oper.yang Cisco-IOS-XE-bfd-oper.yang

IOS XE Operational Data Models


Cisco-IOS-XE-memory-oper.yang
Cisco-IOS-XE-platform-software-oper.yang
Cisco-IOS-XE-process-cpu-oper.yang
Cisco-IOS-XE-bgp-oper.yang
Cisco-IOS-XE-cdp-oper.yang
Cisco-IOS-XE-cfm-oper.yang
Cisco-IOS-XE-process-memory-oper.yang Cisco-IOS-XE-diffserv-target-oper.yang
ietf-interfaces.yang Cisco-IOS-XE-efp-oper.yang
Openconfig-interfaces.yang Cisco-IOS-XE-flow-monitor-oper.yang
Openconfig-network-instance.yang Cisco-IOS-XE-ip-sla-oper.yang
Cisco-IOS-XE-lldp-oper.yang
Cisco-IOS-XE-lisp-oper.yang
Cisco-IOS-XE-mpls-fwd-oper.yang
Cisco-IOS-XE-mpls-ldp.yang
Cisco-IOS-XE-mdt-oper.yang
Cisco-IOS-XE-trustsec-oper.yang
Cisco-IOS-XE-virtual-service-oper.yang
cisco-qos-action-oper.yang
common-mpls-static.yang
ietf-diffserv-target.yang ietf-
ospf.yang
ietf-routing.yang
Openconfig-routing-policy.yang
Openfconfig-vlan.yang

https://github.com/YangModels/yang/tree/master/vendor/cisco/xe/ DEVNET-1693 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Conclusion

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Reca
p

✔ Telemetry Push

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
141

NETCONF / YANG Network Subscriptions


IOS XE Programmability Sessions
@ CL Barcelona
Breakout Sessions:
BRKCRS-1450: Introduction to Catalyst Programmability
Fabrizio Maccioni, Tuesday, Jan 30, 04:45 p.m. - 06:15 p.m.

BRKCRS-2451: Scripting Catalyst switches - tools and techniques beyond the basics
Jeff McLaughlin, Thursday, Feb 01, 11:30 a.m. - 01:30 p.m.

BRKSDN-2666: OS XE Architecture for Programmability


Jeff McLaughlin, Wednesday, Jan 31, 04:30 p.m. - 06:00 p.m.

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
142

WISP Labs:
LABCRS-2222: Open IOS XE Programmability, Krishna Kotha, all week
IOS XE Programmability DevNet
Sessions @ CL Barcelona
DEVNET-1693: Model-Driven Telemetry for IOS XE
Krishna Kotha, Thursday, Feb 01, 04:00 p.m. - 04:45 p.m.

DEVNET-1801: Insights into your WLC with Wireless Streaming Telemetry


Jeremy Cohoe, Thursday, Feb 01, 05:00 p.m. - 05:45 p.m.

DEVNET-2203: Build a Network Configuration CICD Pipeline


Hank Preston, Tuesday, Jan 30, 11:00 a.m. - 11:45 a.m.
Thursday, Feb 01, 09:00 a.m. - 9:45 a.m.

DEVNET-2556: Dive into Leveraging Python on IOS-XE


DEVNET-1693
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
143

Ryan Shoemaker, Tuesday, Jan 30, 09:00 a.m. - 9:45


a.m.
Thursday, Feb 01, 11:00 a.m. - 11:45
a.m.
Open IOS XE on Cisco
DevNet
• Learning Labs
• Sandboxes
• Code Samples
• Videos
• Communities
• Support
• And more ….

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
DEVNET-1693
144

developer.cisco.com/site/ios-xe/

You might also like