You are on page 1of 95

13 Smart Ways to

Program Your Cisco Network


Bruno Klauser
Consulting Engineer
EN EMEAR

PSOCRS-3114
Welcome Aboard

This Session IS
• an Overview of Network Programmability Capabilities
• based on real-life Enterprise Examples
• fast

This Session IS NOT


• a deep-dive into any product or technology
• limited to Enterprise

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 3
We are using Cisco Spark
Use Cisco Spark to communicate with the Speakers and
fellow participants

1. Download Cisco Spark app from iTunes or Google Play


• Go to the Cisco events Mobile app
• Find this session
• Click the Spark button under Speakers in the session description
• Enter the room, room name = “PSOCRS-3114: …”
• Join the conversation!

2. Login to Cisco Spark on your Lab Notebook too

Spark Room will be open for 2 weeks after Cisco Live

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 4
Agenda

• Embracing the Software Defined Era


• 13
• 12
:
• 2
• 1
• Summary and Next Steps
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications
Policy | Orchestration

Open APIs | Developers Environment


Insights &
Experiences
Automation Analytics
Principles Abstraction & Policy Control Network Data,
Automation
from Core to Edge Contextual Insights & Assurance
Open & Programmable | Standards-Based
Security &
Infrastructure Compliance
Physical | Virtual | Programmable | App Hosting

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
Cisco Digital Network Architecture
Cloud Services and Management

Policy | Orchestration

Open APIs | Developers Environment

Abstraction & Policy Control Network Data,


from Core to Edge Contextual Insights

Open & Programmable | Standards-Based

Physical & Virtual Infrastructure | App Hosting

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 7
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications Cloud-Level APIs


Policy | Orchestration Examples include: Case API, proTACtive,
apiconsole.cisco.com, ...
Open APIs | Developers Environment

Automation Analytics
Controller-Level APIs
Abstraction & Policy Control Network Data, Examples include: APIC-EM NB REST API,
from Core to Edge Contextual Insights DNA Analytics NB API, ...

Open & Programmable | Standards-Based

Infrastructure Infrastructure-Level APIs


Examples include: RESTCONF, Open Service
Physical | Virtual | Programmable | App Hosting Containers, embedded EEM/Python, ...

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 8
Embedded Automation

EEM, Python and guestshell


Embedded Event Manager (EEM)
Problem: How to automate within a network device

Solution: Exploring EEM Applet and Policy capabilities


event manager applet 99-bob
description written by bklauser inspired by http://www.99-bottles-of-beer.net Setting a Variable
event none
action 100 set b 99
action 110 while $b gt 1 While Loop – {
action 120 puts "$b bottles of beer on the wall, $b bottles of beer."
action 130 decrement b
action 140 puts "Take one down, pass it around, "
action 150 puts "$b bottles of beer on the wall.\n"
Decrementing a Variable
action 160 end
action 170 puts "$b bottle of beer on the wall, $b bottle of beer."
action 180 puts "Take one down, pass it around, " While Loop – }
action 190 puts "no more bottles of beer on the wall.\n"
action 200 puts "No more bottles of beer on the wall, "
action 210 puts "no more bottles of beer." Referencing a Variable
action 220 puts "Go to the store and buy some more, "
action 230 puts "99 bottles of beer on the wall.\n"
!
alias exec sing event manager run 99-bob
Using an Alias to run our Applet

See also: http://www.99-bottles-of-beer.net/language-cisco-ios-embedded-event-manager-applet-2909.html

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
Embedded Event Manager (EEM)
email SNMP set SNMP SNMP Reload or Application CLI IOS.sh TCL
Syslog
notification Counter get notification switch-over specific Applets Policies Policies

Actions

EEM Applets
multi-event-correlation Embedded Event
Manager

Event Detectors
Interface XML CDP
Syslog SNMP Timer none HW Watchdog CLI OIR ERM EOT RF GOLD NetFlow IPSLA Route 802.1x MAC
Counter RPC LLDP
ED EDs EDs ED EDs ED ED ED ED ED ED ED ED ED ED ED ED
ED ED ED

Remote:
• Fan
• Notification • Cron Process Interface
Syslog • Temp
Local: • Count Scheduler Descriptor
Event • Env
• Notification down Database Blocks
• ...
• Get/Set

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
1+1>2

EEM
+ Python
+ guestshell
(from 16.5 / 16.3.1)

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Example: Time Domain Reflectometry (TDR) – 1/2
Problem: How to accurately detect cabling issues?
 most cabling issues are non-fatal (initially)
 not all wire-pairs may be affected
 may not be located at cable termination
 specialized test equipment may not be available

Solution: Time Domain Reflectometry


 injects a test signal into the cable
 measures reflections caused by
non-uniform impedance
 Detection and (approximate) location
See: http://en.wikipedia.org/wiki/Time-domain_reflectometry
On Copper Ethernet 10/100/1000 ports, (subset of) Catalyst 3k, 4k, and 6k since 12.1(19)EA1

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
Example: Time Domain Reflectometry (TDR) – 2/2
But: You may not want to run on all interfaces and only escalate relevant results
1) Run TDR Test:
switch# test cable-diagnostics tdr interface gigabitethernet1/0/3
TDR test on Gi1/0/9 will affect link state and traffic
TDR test started on interface Gi1/0/3
A TDR test can take a few seconds to run on an interface
Use 'show cable-diagnostics tdr' to read the TDR results.

Note: This will be disruptive!


2) Check Results:
+ Python
switch# show cable-diagnostics tdr interface gigabitethernet1/0/2
TDR test last run on: December 18 21:05:37
Interface Speed Local pair Pair length Remote pair Pair status + guestshell
--------- ----- ---------- ------------------ ----------- --------------------
Gi1/0/2 auto Pair A 0 +/- 2 meters N/A Open
Pair B 0 +/- 2 meters N/A Open
Pair C 0 +/- 2 meters N/A Open (from 16.5 / 16.3.1)
Pair D 0 +/- 2 meters N/A Open

Solution: Run on-box from guestshell / Python and parse / filter results before escalating
 See https://github.com/CiscoDevNet/python_code_samples_network/tree/master/tdr-test
PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
Model-based APIs

YANG and RESTCONF


Open Device Programmability

Set Get Automate


RESTCONF NETCONF gRPC
Open Device Programmability
Data Model
Configuration Operational

Standard
Device
Specific
Standard
Device
Specific
Physical and Virtual Network Infrastructure

Device Features

Interface BGP QoS ACL …


Other vendors…

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
Open Device Programmability – YANG Models
(Open) Common (Cisco) Common (Cisco) Native
Model Model Model
• Industry definition • Cisco definition • Cisco definition
• Compliant with standard • Common across 2 or • Unique to a single Cisco
(IETF, ITU, etc) definition more Cisco operating operating system
systems
• Compliant with customer
definition (ie OpenConfig)

Example: Example: Example:


ietf-diffserv-policy.yang cisco-vxlan.yang Cisco-IOS-XR-ipv4-bgp-cfg.yang
(IETF Diffserv data model) (IOS-XE/NX-OS VxLAN data model) (IOS-XR BGP data model)

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
Working with YANG Models

pyang – extensible YANG validator and converter in python


• https://github.com/mbj4668/pyang
• Via PyPi: pyang - A YANG (RFC 6020) validator and converter
• Mandatory tool 

YANG Explorer – open-source YANG Browser


and RPC Builder Application
• https://github.com/CiscoDevNet/yang-explorer
• Web Based UI
• ‘Postman’-like concept, feature rich

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
Working with YANG Models - YangExplorer
(1) Select a Profile

Python Scripts

Check Capabilities

(2) Browse Models

(3) Define Operations

(4) Create RPC

(5) Run RPC

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Unfair Advantage

apiconsole.cisco.com
Example: Preventive Analytics – Connected TAC
Problem: Most root causes of production outages have been in the network for some time and
have been seen before in other networks. How to prevent them from affecting YOUR network?

Solution: Leverage automated Connected TAC Analytics:


1)
1. Customer reports incident (1.3M incidents p.a.) TAC
2)
2. Cisco TAC Expert analyses root cause

3) 4)
3. IF analysis can be automated AND there is a
preventive action  a scripted app is created
4. Hundreds of TAC engineers write scripted  
apps daily (currently >>16’000 apps)  
 
5. NEW proTACtive makes apps available via REST APIs  
on apiconsole.cisco.com (updates weekly) apiconsole.cisco.com
  !

 Prevent outages before they happen 5) 

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
Example: Preventive Analytics – Connected TAC
In use at Cisco, ISVs,
REST APIs, node.js Agent JSON Results Partners, Customers

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Technical Solutions Clinic – Hall 2.2 (The Hub)
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications
Policy | Orchestration

Open APIs | Developers Environment


Insights &
Experiences
Automation Analytics
Principles Abstraction & Policy Control Network Data,
Automation
from Core to Edge Contextual Insights & Assurance
Open & Programmable | Standards-Based
Security &
Infrastructure Compliance
Physical | Virtual | Programmable | App Hosting

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications
Policy | Orchestration

Open APIs | Developers Environment


Insights &
Experiences
Automation Analytics
Principles Abstraction & Policy Control Network Data,
Automation
from Core to Edge Contextual Insights & Assurance
Open & Programmable | Standards-Based
Security &
Infrastructure Compliance
Physical | Virtual | Programmable | App Hosting

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
Deploy, Report, Measure, Adjust, Repeat

Business Intent
Business Insight

Automation Analytics
Service Policy
Abstraction & Policy Control Network Data, Service Analytics
from Core to Edge Contextual Insights

Infra Config Analytics


Infra Telemetry

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 26
APIC-EM Platform Architecture – Today
APIC-EM Applications Applications built on top of APIC-EM
Network Path Network Applications packaged with APIC-EM
IWAN Easy QoS
Inventory Trace PnP
Core Applications bundled
Advanced Topology Visualizer IWAN Application separately licensed

Northbound REST API Open and Documented REST API

APIC-EM Controller Platform Services


Inventory Policy
RBAC Policy Analysis Core Services
Manager Programmer
Applications Specific Services
Topology Data Access IWAN
Network PnP
Services Service Services

Elastic Controller Infrastructure (Grapevine 1 ) Provides Scale and High Availability

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
APIC-EM Northbound REST API
Bundling, Versioning, Deprecation and Release Strategy

• API changes within a version will be backward compatible i.e adding a new optional
parameter to existing API URL does not constitute a version change

• Up versioning an API does not guarantee backward compatibility

• When a new version of an API is released, the older version will be


supported for 2 or more years before it is removed

• Telemetry will be used to get insights in API usage and retire unused APIs early in cycle

• Deprecated APIs will respond with appropriate message


(that emphasizes the deprecation, time until it is valid, etc)

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 28
Using a Controller API

APIC-EM northbound REST


APIC-EM Northbound REST API
Problem: How to get started with a Controller API?
Solution: Explore

Example:
1) In the APIC-EM User Interface,
click on [API]
2) Navigate to the desired API
in our example:
/network-device/count

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Real-World Example

Example: Subnets seen by APIC-EM


Problem: How to get a full list of all subnets seen by APIC-EM ?
Solution: Use the APIC-EM REST APIs: Subnets seen by APIC-EM:

40.0.0.0 /24
40.0.1.0 /30
: 40.0.1.4 /30
1) For each network device: for item in interface_list: 40.0.1.8 /30
if (item[0] != '') & (item[1] != ''): 40.0.1.12 /30
subnet = ipcalc.Network(item[0] + "/" + item[1])
2) Extract IP/Subnet Information of all subnets.append(...)
40.0.1.16 /30
40.0.1.20 /30
interfaces into a list : 40.0.1.24 /30
40.0.1.28 /30
40.0.1.32 /30
3) De-duplicate Subnets 40.0.1.36 /30
40.0.1.40 /30
40.0.1.44 /30
4) Sort the List 40.0.1.48 /30
40.0.2.0 /30
40.0.2.4 /30
40.0.2.8 /30
40.0.2.12 /30
See: 40.0.2.16 /30
https://communities.cisco.com/people/steffenwebb/blog/ virtual NETWORK-, APPLICATION-, MANAGEMENT- FUNCTIONS
40.0.5.0 /24
2016/04/07/get-all-subnets-from-apic-em-controller 40.0.7.0 /24
172.10.0.0 /24
SWITCHING | ROUTING | WIRELESS 172.20.0.0 /24
192.168.1.0 /24
192.168.2.0 /24
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Real-World Example

Example: Inventory Integration


Problem: How to leverage APIC-EM discovery and inventory to feed service monitoring?
Solution: Integrate APIC-EM REST APIs
with existing Paessler / PRTG System:
1. Identify Relevant Service Domains
2. Run APIC-EM Discovery

Traditional IT
3. Share APIC-EM Inventory via REST APIs
and modular PowerShell Tool/Adapter
4. Correlate with EoX and proTACtive
information via apiconsole.cisco.com
5. Visualize and Share with IT and
DevOps users via PRTG virtual NETWORK-, APPLICATION-, MANAGEMENT- FUNCTIONS

See www.damovo.com SWITCHING | ROUTING | WIRELESS

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 32
Automated Deployment

APIC-EM PnP App and API


Network Plug and Play (PnP)

Deployment
Device receives target
image and configuration
2
Discovery
Device can reach
PnP Server on APIC-EM
1
No Staging
Routers (ISR, ASR)
No Staging Required
PnP Runs from Cisco
Switches (Catalyst®) Wireless Access Points
Factory-Default Configuration

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
Network Plug and Play (PnP) – Components
PnP Server
Cloud Redirect Service
Central Server on APIC-EM
PnP Helper App [ Optional ]
Manages sites, devices, images,
[ Optional ] Roadmap Phase 2 licenses, workflow
Delivers bootstrap, status Provides Northbound REST APIs
and troubleshooting checks

GetConsole
Redpark RJ45 Redpark RJ45
Airconsole2.0
Apple 8pin Apple 30pin
Bluetooth Adapter PnP Protocol
Runs between
PnP Agent Agent and Server
Runs on Cisco® switches, routers, Open Schema
and wireless access points
Automates the deployment process

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
PnP – Simple & Secure & Consistent
APIC-EM PnP Dashboard APIC-EM PnP REST API Support

Device Repository
and Database

PnP REST API

APIC-EM Bulk Import/Export Python

APIC-EM API
Automation Framework
(i.e. Python scripts,
configuration generator, etc)

Customer’s Existing
Automation Frameworks

Switches Routers
Wireless AP
(Catalyst) (ISR/ASR)

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
Network Plug and Play (PnP) – Templates

PnP Templates
• Introduced in 1.3
• Based on Apache Velocity

• UI Support
• API Support

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
Real-World Example

Example: Campus Automation


Problem: How automate campus network operations to minimize OPEX and increase efficiency?

Solution: Leverage APIC-EM


and DevNet to deliver automated
solutions to customers

Traditional IT
• 1st PnP Prodution Reference
• Custom App on top of PnP
‘Config Writer’
• OPEX Reduction
• Standardization
• Enables Innovation

See www.computacenter.com

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Real-World Example

Example: PnP for Wireless using Android


Problem: How to automate deployment of Wireless AP and their WLC Association ?

Solution: Leverage APIC-EM


PnP and Android to automate
1. Scan Access Point Serial
2. Load List of PnP Projects 3
from APIC-EM
3. Assign AP to Project Site 2

4. Auto-Provision AP into
correct WLC Group

Credits: Hans Donnerborg and Rene Andersen

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 39
How does my Traffic flow?

APIC-EM Path Trace


APIC-EM Path Trace
Accurate 5-tuple path flow-analysis – available via GUI and REST APIs

Problem: How to capture Application Flow Information along a complex wireless, wired path?

Solution: Leverage APIC-EM – the SDN Controller for Enterprise

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
APIC-EM Path Trace
Accurate 5-tuple path flow-analysis – available via GUI and REST APIs

CAPWAP Tunnel ACL Check Stats: Device, Interface, QoS, Perfmon Link Source Information
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
APIC-EM Path Trace
Accurate 5-tuple path flow-analysis – available via GUI and REST APIs

{
"response": { "sourceIP": "65.1.1.83",
"request": {
"sourceIP": "212.1.10.20", "destIP": "212.1.10.20"
"destIP": "65.1.1.6" }
},
"lastUpdate": "Thu Apr 23 01:23:21 UTC 2015",
"properties": [ ],
"networkElementsInfo": [
{
"id": "424621be-d2b4-4d42-ad16-92d4d5c19fa4",
"type": "WIRED",
"ip": "212.1.10.20",
"linkInformationSource": "Wired"
},
{
"id": "8beada2e-cd2c-421d-941f-3ba42696c489",
"name": "CAMPUS-Access1",
"type": "SWITCH",
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
(dynamic) Policy Injection

APIC-EM Easy QoS App and API


APIC-EM Easy QoS App

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
APIC-EM Easy QoS App

“QoS rollouts were once 6-month projects costing


over $200K. With Cisco APIC EM Easy QoS, we will
go from months to minutes with nominal costs. ”

Brian McEvoy, Sr. Network Engineer, Symantec


© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
APIC-EM Easy QoS App – Dynamic QoS

SDN API APIC Application


EM Dynamic Policy
Management

Client A calls Client sends call setup App Server calls APIC-EM QoS policy enabled
client B info to App server to setup policy on network device

SDN API APIC Application


EM Dynamic Policy
Management

Call ends Client sends call teardown App Server calls APIC-EM QoS policy removed
info to App Server to delete policy from network device

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 47
Real-World Example

Example: Dynamic Admission Control


Problem: How to consistently and predictably implement dynamic call admission control (DAC)
policies on top of an IP network, across campus and branches, supporting multiple communication
and collaboration technologies ?
Solution: Leverage DNA and APIC-EM
capabilities to integrate with communication 2)
and collaboration controllers 1)
Policy Engine
1) Define Admission Control Policies in Netwrapper CAC Service Topology QoS
Netwrapper Adapter Analyzer Adapter
2) Integrate with Communication Controllers
(Skype4Business, Cisco CUCM, …) 3)
3) Integrate with APIC-EM NIB and Easy QoS
4) Communicate and Operate with predictable
Branch Branch
QoS and SLA
4)
See: www.italtel.com/products/sdn-monitoring-automation
https://marketplace.cisco.com/catalog/companies/italtel-s-p-a/products/netwrapper--2
WAN
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Yes, but ...

APIC-EM 1.4 Command Runner


APIC-EM 1.4 – Command Runner
Problem: A controller API which is model-based and policy-driven is great – but sometimes we just
need some arbitrary operational data. Why can’t I just run a plain old show command via the API?

Solution:
1. Upgrade to APIC-EM 1.4

2. Select Devices from Inventory

3. Run Commands

4. Wait for Task Completion

5. Read Results

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
APIC-EM 1.4 – Command Runner
Problem: A controller API which is model-based and policy-driven is great – but sometimes we just
need some arbitrary operational data. Why can’t I just run a plain old show command via the API?

Solution:
1. Upgrade to APIC-EM 1.4

2. Select Devices from Inventory • POST a cli read request using


/network-device-poller/cli/read-request
 accepts a JSON-encoded request
3. Run Commands maximum of 100 device IPs and a maximum of 5 commands)
 returns a Task ID, which can be polled for status:
/task/{taskId}
• 3) when the task is complete, the response will return a File ID.

4. Wait for Task Completion


• Resulting file contains the command output:
/file/{fileId}
5. Read Results

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 51
APIC-EM 1.4 – Command Runner
Problem: A controller API which is model-based and policy-driven is great – but sometimes we just
need some arbitrary operational data. Why can’t I just run a plain old show command via the API?
[{'commandResponses': {'BLACKLISTED': {},
'FAILURE': {},
'SUCCESS': {'show configuration id detail': 'Configuration '

Solution: 'version
': 56303\n'
'Last '
'

'change '
'time '
1. Upgrade to APIC-EM 1.4 ': '
'2017-01-19T06:12:53.573Z\n'
'Changed by '
'user '
': cisco\n'
'Changed '
2. Select Devices from Inventory 'from '
'process '
': Virtual '
'Exec',
'show ip interface brief': 'Interface '
'IP-Address '
'OK? Method '
3. Run Commands 'Status
'Protocol\n'
'

'Embedded-Service-Engine0/0 '
'unassigned '
'YES NVRAM '
'administratively '
'down down \n'
4. Wait for Task Completion 'GigabitEthernet0/0
'172.16.2.2 '
'

'YES manual '


'up '
'up \n'
'GigabitEthernet0/1 '
'10.2.2.1 '
5. Read Results 'YES manual '
'up '
'up \n'
'GigabitEthernet0/2 '
'10.2.1.18 '
'YES manual '
'up '
© 2017 'up \n'
Cisco and/or its affiliates. All rights reserved. Cisco Public
'Loopback0 '
APIC-EM 1.4 – Command Runner
Problem: A controller API which is model-based and policy-driven is great – but sometimes we just
need some arbitrary operational data. Why can’t I just run a plain old show command via the API?

Solution:
1. Upgrade to APIC-EM 1.4

2. Select Devices from Inventory

3. Run Commands

4. Wait for Task Completion

5. Read Results

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Building Apps on Top

Leverage APIC-EM and


NeXt UI Toolkit ...
Real-World Example

Example: Visualizing Multicast


Problem: In a Hospital, Multicast is used for critical Medical Equipment as well as
Patient Entertainment and Media – data privacy is a key concern.
How to visualize the relevant multicast information?
Solution: Harvest information from the network
and create custom, augmented displays
1) Collect relevant Topology, Inventory and
Host information from APIC-EM
NeXt UI Toolkit
2) Augment with Multicast tree(s) 3)
Multicast Visualizer App
3) Use NeXt UI to for visual representation
1) 2)
4) Share with operational staff

See: http://www.anyweb.ch
http://www.hsr.ch
Network
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications
Policy | Orchestration

Open APIs | Developers Environment


Insights &
Experiences
Automation Analytics
Principles Abstraction & Policy Control Network Data,
Automation
from Core to Edge Contextual Insights & Assurance
Open & Programmable | Standards-Based
Security &
Infrastructure Compliance
Physical | Virtual | Programmable | App Hosting

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 56
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications
Policy | Orchestration

Open APIs | Developers Environment


Insights &
Experiences
Automation Analytics
Principles Abstraction & Policy Control Network Data,
Automation
from Core to Edge Contextual Insights & Assurance
Open & Programmable | Standards-Based
Security &
Infrastructure Compliance
Physical | Virtual | Programmable | App Hosting

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 57
Separation of IT areas and buying
centers preventing IT to move at the
speed demanded by the business

Focus evolved from Consolidation to


Automation and now it’s all about
Consumption

Business Owners and App


Developers went straight to Public DevOps
Cloud to meet agility and demand.
Security and Data Sovereignty arise.

Operations become bi-modal – IT


governance AND agile business
interaction.
Shift from “how it works”
to “how to consume it”

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Interacting with Humans – #1 Requirement

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 59
Interacting with Humans – #1 Requirement
Enable
• Rapid Adoption
- TTFHW (time-to-first hellow world): Minutes
- TTFPP (time-to-first production pilot) : Hours

• Scale and Quality Interaction


- with the same skills,
technologies, architecture
and tooling

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 60
Multi-Domain Topology
Visualization

NeXt UI Toolkit
Interacting with Humans – NeXt
Problem: How to quickly provide a Graphical UI for
network-centric custom SDN/DevOps Applications ?

Solution: NeXt
Embedded User eXperience for Network UIs Web Applications
• HTML 5 / JavaScript based
• Open source Topology Component
• Developed within Cisco
• Used by APIC-EM, Glance, DNA and others UI Core
UI Component/View Engine/DOM/AOP/Application Support
• Rapid Adoption
developer.cisco.com/site/neXt/ JavaScript Core
OOP/MVVM/Data Binding/Data Type

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
NeXt is on DevNet – Try it Out

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 63
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
It is all open sourced now for free with
eclipse license 1.0

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 65
Anatomy of a NeXt UI
<html>
• index.html  your web page <head>
<link rel="stylesheet" href="dest/css/next.css">
<script src="dest/js/next.js"></script>
can be dynamic, no static body elements required <script src="Data.js"></script>
<script src="Shell.js"></script>
</head>
<body>
</body>
• Data.js  topology data </html>

single topology object, from file or in memroy


var topologyData = {
nodes: [
{"id": 0, "x": 050, "y": 100, "name": "65.1.1.46"},
{"id": 1, "x": 100, "y": 50, "name": "AP7081.059f.19ca"},
• Shell.js  (custom) behavior {"id": 2, "x": 150, "y": 100, "name": "CAMPUS-Access1"}
],
links: [
extend and override for custom behavior
{"source": 0, "target": 1},
{"source": 1, "target": 2}
default functionality is present already ]
(pan, zoom, select, tooltips, colors, etc) };

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 66
Sharing NeXt Code – Client Side JavaScript
NeXt on DevNet
• Documentation
• Tutorials and Labs
• Downloads
• Community
http://developer.cisco.com/site/neXt/
http://communities.cisco.com/community/developer/devnetlabs/next

Sharing and Running NeXt Examples


• Works best on Platforms such as JSFiddle.net or
Codepen.io
http://codepen.io/collection/nrBeEQ/
http://codepen.io/collection/nMWevE/
http://jsfiddle.net/user/nextsupport/fiddles/

 Engage with your peers/users

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
ChatOps

Cisco Spark APIs


Interacting With Humans – ChatOps

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 69
Cisco Spark for Developers

Developer Portal Interactive Docs

24/7 Dev Support Server SDKs


https://developer.ciscospark.com/

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 70
Interacting with Humans – Spark
Problem: How to post instant information
to a chat room and/or interact?

Solution: Use the Cisco Spark REST APIs


• Login to developer.ciscospark.com
• Copy Access Token
• Query Rooms SPARK_HEADERS = {'Content-type': 'application/json',
developer.ciscospark.com
'Authorization': 'Bearer YOUR-ACCESS-TOKEN'}
/endpoint-rooms-get.html

• Copy Room ID msg = json.dumps({'roomId':SPARK_ROOM,


'text':'Hello Spark'})
• Post 
q = requests.post('https://api.ciscospark.com/v1/messages',
data=msg,
headers=SPARK_HEADERS)

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 71
ChatOps Advanced

Spark Integrations and Bots


Spark API GET vs. Webhooks vs. Bots

4. Apps which interact with other


users via Spark can register as
Bots – much like humanoids
1. User’s Clients interact with
the Spark Service

2. Scripts and Apps can GET or


POST messages by calling 3. A webhook allows an App to
the Spark API subscribe for Notifications from
Spark in real time

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Example: ChatOps with Humans Bots

Bot
Human: @Bot Who has the
lease for 10.100.252.43?

Bot: 10.100.252.43 is
leased by …

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Interacting with Humans – ChatOps
Problem: What if your Ops users are road
warriors, managers and remote workers?

Solution: ChatOps – Integrate via Cisco


Spark REST APIs and/or Tropo.com
Demo at Italtel Booth G12 – Hall 3.2
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Real-World Example

Example Bot: Exploring and Interacting


Problem: How to explore SDN Controllers and DevOps-style Human Interaction?

Solution: Combine a few things:


• DevNet Sandbox
• APIC-EM in the Sandbox
• APIC-EM REST API via Python
• Spark REST APIs
Then query host information in
APIC-EM from a Spark Room 
See: https://github.com/CiscoDevNet/awesome-ciscospark and
https://github.com/CiscoDevNet/spark-webhooks-sample

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 76
Reaching Road Warriors
and Managers

Tropo Voice and Text APIs


Interacting with Humans – Tropo
www.tropo.com

Problem: How to automate Phone Interactions ?


<?php
Solution: Tropo Scripting and Web APIs answer();
say("Hello World");
• Voice Interaction APIs hangup();
• SMS/Text Interaction APIs ?>
answer();
• Custom logic can be say("Hello World");
hangup();
• cloud-hosted (Scripting API) {"tropo":[
• on-premise (Web API) {"say": "Hello World"}
]}
• Rapid Adoption via PHP, Ruby, Python, answer()
JavaScript, JSON, Groovy, … say("Hello World")
hangup()
www.tropo.com/docs/scripting/quickstarts

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
Interacting with Humans – Tropo
Example - Simple IVR Readout and Choice
• Create an App in Development Mode
• Script based on QuickStart Examples
• Call in to test (+41 43 508 13 03)
• Evolve ...

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 80
Agenda

• Embracing the Software Defined Era


• 13
• 12
:
• 2
• 1
• Summary and Next Steps
Cisco Digital Network Architecture
Cloud Services and Management

Network-enabled Applications Cloud-Level APIs


Policy | Orchestration Examples include: Case API, proTACtive,
apiconsole.cisco.com, ...
Open APIs | Developers Environment

Automation Analytics
Controller-Level APIs
Abstraction & Policy Control Network Data, Examples include: APIC-EM NB REST API,
from Core to Edge Contextual Insights DNA Analytics NB API, ...

Open & Programmable | Standards-Based

Infrastructure Infrastructure-Level APIs


Examples include: RESTCONF, Open Service
Physical | Virtual | Programmable | App Hosting Containers, embedded EEM/Python, ...

Cloud-enabled | Software-delivered

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 82
What can DevNet Accelerate Your Journey
do for me? as you and your business
adopt Programmability and
DevOps Practices

Learn Code Inspire

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 83
Helping you on the Journey….
Learn Code Inspire
Technology Tracks
DevNet membership
Learning Paths 300+ Network
DevNet Zone
350,000+ Partners and Growing

Getting Started and API


Reference Guides
Roadshows &
Pop-up Events
DevNet Express 1500+ Solutions
Sample Applications

Structured Training Community and 250+ “Compatible”


eLearning Instructor Led
Pay-for Developer Support Network Solutions
40+ DevNet Learning Labs
Cisco Professional Services
Certification Program 40+ 9,800+ Developers 2500+ Partners Strong
Coming in 2017 Developer
Sandboxes 4,400+ Companies

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 84
DevNet Learning Labs
• Self paced learning
• Modular format (modules 10 – 45
min in duration)
• Beginner and refresher content
• Content includes; programming
technologies, concepts and APIs

learninglabs.cisco.com

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 85
Join a DevNet Express

“Educate and equip customers and partners


to begin leveraging
next-generation solution sets – powered by
APIs and Programmability.”

DevNet Express Event Team

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 86
Join a DevNet Express
DNA Programmability free flowing step-by-step

Hackathon Instructor-Led
Training (ILT)
• Learn and be inspired
• Meet with Peers
Technical
• Engage with DevNet Seed Talks

• Lead the transformation

Side-by-side
• Seed Talks, Hands-On Missions, Exploration

Fun, Collaborative and Engaging

See http://hackathon.cisco.com/events Hands-on


Missions

© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
To learn more about the API just described and other LEARN
development opportunities…

Visit the DEVNET ZONE! CODE

LEARN, PLAY, AND GET HANDS ON WITH”


• APIS
• LEARNING LABS,
INSPIRE
• CODING CLASSES,
• WORKSHOPS,
• PRODUCT DEMOS,
AND MUCH MORE….
CONNECT

Let’s Connect Follow @CiscoDevNet #DevNet


Complete Your Online Session Evaluation
• Please complete your Online
Session Evaluations after each
session
• Complete 4 Session Evaluations &
the Overall Conference Evaluation
(available from Thursday) to receive
your Cisco Live T-shirt
• All surveys can be completed via
the Cisco Live Mobile App or the
Don’t forget: Cisco Live sessions will be available
Communication Stations for viewing on-demand after the event at
CiscoLive.com/Online

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 89
Continue Your Education
• Demos in the Cisco campus
• Walk-in Self-Paced Labs
• Lunch & Learn
• Meet the Engineer 1:1 meetings
• Related sessions

PSOCRS-3114 © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 90
SDN @ CiscoLive 2017
Software-Driven Network Architectures
• Analytics
• Automation
• Programmability
• Virtualization
Highlights Include:
BRKSDN-1009 Python 101 for Network Engineers
BRKSDN-2935 From Zero to Network Programmability in 90 minutes - APIC-EM, Prime Infrastructure, UCSD, Spark and Tropo
BRKARC-3004 APIC-EM: Policy automation with DNA and network automation easy, fast, reliable
BRKSDN-1001 Programming Cisco APIC Enterprise Module with visual oriented programming languages
BRKSDN-2046 DNA Quality of Service
BRKSDN-2066 Service Function Chaining: Programming Your Data and Service Planes
BRKSDN-2116 Containers on routers and switches: Run your apps and tools natively on Cisco boxes
BRKSDN-3004 DNS-AS - How to use DNS as a Source of Metadata to Identify your Applications for QoS and Beyond...
BRKSDN-3900 Network Automation with the Meraki API
BRKSDN-2901 Next-gen Network Telemetry is Within Your Packets: In-band OAM
PSOCRS-3114 13 Smart Ways to Program Your Cisco Network

TECSDN-2602 Enterprise SDN: Architectures and Key Concepts


TECSDN-3602 Enterprise SDN: Advanced Network Programming - Hands-On Lab
TECSDN-3600 APIC-EM: Redefining the Campus and Branch through a policy based controller

LTRSDN-2500 A Practical Look at Cisco Application Policy Infrastructure Controller Enterprise Module (APIC-EM): Hands-On Lab
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public
LTRSDN-2870 Implementing Cloud based virtual managed services with NFV & vBranch
Q&A
What will YOU
Program First?
Thank You

You might also like