0% found this document useful (0 votes)
114 views

Devnet-3603 (2018)

Uploaded by

Paul Zeto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views

Devnet-3603 (2018)

Uploaded by

Paul Zeto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

DEVNET-3603

Explore the Programmability


Options of DNA Center for
Managing Network Intent

Adam Radford, Distinguished Systems Engineer


Cisco Spark
Questions?
Use Cisco Spark to communicate
with the speaker after the session

How
1. Find this session in the Cisco Live Mobile App
2. Click “Join the Discussion”
3. Install Spark or go directly to the space
4. Enter messages/questions in the space

cs.co/ciscolivebot#DEVNET-3603

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

• Introduction to DNAC
• API Overview
• Discovery/Inventory
• PnP
• SWIM
• Other
• Conclusion
Some Operational Challenges

95% 70% 75%

Manual Changes Policy Violations OpEx spent on


Due to Human Error Network Visibility and
Troubleshooting
Source: 2016 Cisco Study

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 5
The Network. Intuitive.
LEARNING
Informed
DNA Center by Context
Visibility into traffic
and threat patterns
Who, What, When,
Policy Automation Analytics
Where, How

INTENT CONTEXT
Powered Intent-based
by Intent Network Infrastructure
Translate Business Intent
to Network Policy
Automate the management
and provisioning millions of
devices instantly

SECURITY

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
Abstractions

Intent (policy) Context (health)

"WHAT" I want "WHAT" is happening

"HOW" it's done "HOW" it's working

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 7
Comparison

PI APIC-EM DNAC 1.1

PnP Uses APIC-EM Stacking workaround. API only until March 2018

Visibility/assurance Netflow based. Limited abstraction None. Limited to EasyQoS Health based. No Application health until Jan

Day-N Configuration change Template based None- EQ only New Integrated workflow. Site settings +
configuration templates.
Day-N Software upgrade Limited scale – 5 devices None New workflow. Golden Images. Pre/Post
checks.
API Not complete. Retro fitted API first Limited until March 2018

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 8
DNA Center

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
DNAC Day-N configuration change

Policy Segmentation, QoS

Configuration template
Non Policy Configuration
(Day 0-N)

NTP server, MOTD, DHCP,


Non- Device Controllability
DNS, TimeZone
Network Profile Settings
SNMP trap, netflow, aaa,
Device Controllability syslog, IPDT, Certificate

DNAC Network Device Configuration File

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
API Documentation

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 11
Documentation

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Unofficial API

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
Always on Sandbox

User: devnetuser
Password: Cisco123!

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
TLS and Cipher Changes on DNAC

TLS 1.0 RC4 cipher

Implications:
- Older versions of IOS cannot establish Plug and Play connection.
- Need to upgrade software e.g. 3850 requires 16.3.3
- Unable to import software images from devices (uses TLS connection)
- Import image from CCO/filesystem
- REST API connections from python may fail with Error: , ConnectionResetError(54, 'Connection reset by peer')
- 'pip install pyOpenSSL'

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
API Overview
Why API?

Automation Integration Innovation

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
DNAC Official API support

Design Policy Provision


- Device credentials - PnP
- SWIM

Assurance Other
- network-device
- hosts
- discovery

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
Taxonomy

Discovery Plug and Play System


- CRUD credentials - CRUD Project - File CRUD
- CRUD discovery - CRUD device rules - PKI CRUD
- Filter discovery results - CRUD Settings
- Image/Config/Templates

Network Device Network Host SWIM


- GET network-device - Get host - CRUD/upload image
- Filter network-device - Filter host - Distribute image
- GET module - Activate image
- Image recommendation

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
API: VERBS + NOUNS + Syntax

GET JSON Syntax:


{
/host "policyOwner": "Admin",
POST "networkUser":
/network-device {"userIdentifiers":["40.0.0.15"],
PUT
"applications":[{"raw": "12340;UDP"}]
}
/interface }
DELETE Header: Content-Type: Application/JSON

https://adam-dnac/api/v1/host GET

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
Authentication request - POSTMAN

APIC-EM DNAC

Authentication POST JSON Body Basic


request Auth
Response ["response"]["serviceTicket"] ["Token"]

Roles:
Make network changes
Read only role
Make Assurance changes
Able to make all changes

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
Discovery/Inventory
Getting started

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 23
Relationships

/global-credential/cli /network-device
/global-credential/snmpv2-read-community

/interface
/discovery

/host

Discovery Inventory

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 24
network-device
https://dnac/api/v1/network-device GET "hostname": "2960x-iwan.adamlab.cisco.com",
"memorySize": "378565216",
{ "roleSource": "AUTO",
"macAddress": "c0:7b:bc:28:4f:00", "collectionInterval": "Global Default",
"upTime": "50 days, 18:41:32.19", "lineCardCount": "1",
"softwareType": "IOS", "collectionStatus": "In Progress",
"family": "Switches and Hubs", "role": "ACCESS",
"snmpContact": "", "location": null,
"platformId": "WS-C2960X-48FPD-L", "inventoryStatusDetail": "<status><general code=",
"series": "Cisco Catalyst 2960 Series Switches", "type": "Cisco Catalyst 29xx Stack-able Ethernet Switch",
"errorCode": null, "lineCardId": "faf00256-f02d-4634-90c6-aa2421dad065",
"bootDateTime": "2017-11-13 06:31:36", "waasDeviceMode": null,
"interfaceCount": "55", "apManagerInterfaceIp": "",
"tunnelUdpPort": null, "errorDescription": null,
"id": "31475e4c-3246-4737-86e2-752b65b99756", "lastUpdated": "2018-01-03 01:17:48",
"locationName": null, "managementIpAddress": "192.168.12.160",
"associatedWlcIp": "", "serialNumber": "FOC1743S0XB",
"instanceUuid": "31475e4c-3246-4737-86e2-752b65b99756", "reachabilityFailureReason": "",
"lastUpdateTime": 1514942268169, "softwareVersion": "15.2(4)E5",
"reachabilityStatus": "Reachable", "snmpLocation": "",
"hostname": "2960x-iwan.adamlab.cisco.com", "tagCount": "0"
<cont> }

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
interface
https://dnac/api/v1/interface/268adabc-d16c-4155-a548-96163ddd4e03 GET

{ "description": " link to pp for client",


"adminStatus": "UP", "vlanId": "66",
"macAddress": "c0:7b:bc:28:4f:2f", "nativeVlanId": "1",
"series": "Cisco Catalyst 2960 Series Switches", "lastUpdated": "2018-01-03 01:46:48.742",
"pid": "WS-C2960X-48FPD-L", "portName": "GigabitEthernet1/0/47",
"ifIndex": "10147", "ipv4Mask": null,
"interfaceType": "Physical", "ospfSupport": "false",
"speed": "1000000", "className": "SwitchPort",
"id": "268adabc-d16c-4155-a548-96163ddd4e03", "portMode": "access",
"ipv4Address": null, "deviceId": "31475e4c-3246-4737-86e2-752b65b99756"
"instanceUuid": "268adabc-d16c-4155-a548-96163ddd4e03", }
"isisSupport": "false",
"duplex": "FullDuplex",
"serialNo": "FOC1743S0XB",
"voiceVlan": null,
"mediaType": "10/100/1000BaseTX",
"mappedPhysicalInterfaceId": null,
"portType": "Ethernet Port",
"status": "up",
"mappedPhysicalInterfaceName": null,
<cont>

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 26
host
https://dnac/api/v1/host GET

{
"hostMac": "00:50:56:b1:31:f3",
"connectedInterfaceName": "GigabitEthernet1/0/47",
"lastUpdated": "1514943771881",
"source": "200",
"connectedNetworkDeviceIpAddress": "192.168.12.160",
"hostType": "wired",
"id": "c91dde64-f371-4de9-b5bb-f702fdf057d5",
"connectedNetworkDeviceName": "2960x-iwan.adamlab.cisco.com",
"accessVLANId": "66",
"subType": "UNKNOWN",
"vlanId": "66",
"hostIp": "192.168.12.185",
"connectedNetworkDeviceId": "31475e4c-3246-4737-86e2-752b65b99756",
"connectedInterfaceId": "268adabc-d16c-4155-a548-96163ddd4e03"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 27
Base API Summary

api/v1/network-device GET GET Network-device known by DNAC

api/v1/interface GET GET all interfaces on network devices known by DNAC

api/v1/host GET GET all hosts (not network-devices) connected to network-devices known
by DNAC. Will return interface and device

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 28
PnP
Plug and Play
DNAC 1.1 – UI not officially supported
Will be supported in 1.2 release
https://dnac/mypnp - debugging

1.2 PnP architecture will change to use


built SWIM images and Provisioning
engine templates

** API likely change

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Relationships

/file/config
/file/image /pnp-device
/file/template

/pnp-project

/pnp-project/{project-id}/device

Ad-Hoc
Pre-provisioned
Post-provisioned

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 31
Create a Project
https://dnac/api/v1/pnp-project POST

[{"siteName": "Sydney"}]

{
"response": {
"taskId": "49f44442-9808-4341-98b7-be65c8b7197d",
"url": "/api/v1/task/49f44442-9808-4341-98b7-be65c8b7197d"
},
"version": "1.0"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 32
Look at the Task
https://dnac/api/v1/task/49f44442-9808-4341-98b7-be65c8b7197d GET

{
"response": {
"progress": "{\"message\":\"Success creating new site\",\"siteId\":\"91bf82f8-99b3-4908-9145-19a435ee86e8\"}",
"version": 1454811170949,
"startTime": 1454811170949,
"endTime": 1454811170969,
"serviceType": "Ztd Service",
"rootId": "49f44442-9808-4341-98b7-be65c8b7197d",
"isError": false,
"id": "49f44442-9808-4341-98b7-be65c8b7197d"
},
"version": "1.0"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
GET list of projects
https://dnac/api/v1/pnp-project GET

{
"response": [
{
"state": "PRE_PROVISIONED",
"siteName": "Sydney",
"deviceCount": 0,
"pendingDeviceCount": 0,
"provisionedBy": "admin",
"provisionedOn": "2016-02-07 02:12:50.949",
"id": "91bf82f8-99b3-4908-9145-19a435ee86e8"
}
],
"version": "1.0"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
Create a project rule
https://dnac/91bf82f8-99b3-4908-9145-19a435ee86e8/device POST

[{
"serialNumber": "12345678901",
"platformId": "C2960X",
"hostName": "syd-sw1",
"pkiEnabled": true
}]

{
"response": {
"taskId": "81689911-1eb4-4bf9-a98a-cb0e23be49d1",
"url": "/api/v1/task/81689911-1eb4-4bf9-a98a-cb0e23be49d1"
},
"version": "1.0"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
GET list of project rules
https://dnac/api/v1/pnp-project/91bf82f8-99b3-4908-9145-19a435ee86e8/device GET

{"response": <continuation>
[{
"hostName": "syd-sw1", "authStatus": {
"platformId": "C2960X", "type": "Unknown",
"serialNumber": "12345678901", "status": "None",
"site": "Sydney", "errorMessage": null,
"pkiEnabled": true, "timestamp": 1454811700178,
"sudiRequired": false, "certInfo": null
"apCount": "0", },
"isMobilityController": "false", "attributeInfo": {},
"state": "PENDING", "id": "a0ec4fe5-ba3b-49ef-8ff4-ac5b41f7c0cd"
"stateDisplay": "Pending", }],
"version": "1.0"
<contined next page> }

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
DELETE project (and rules)
https://dnac/api/v1/pnp-project/91bf82f8-99b3-4908-9145-19a435ee86e8deleteRule=1&deleteDevice=1 DELETE

{
"response": {
"taskId": "cd9d7e8a-78a8-4512-a905-14671a23d535",
"url": "/api/v1/task/cd9d7e8a-78a8-4512-a905-14671a23d535"
},
"version": "1.0"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
PNP API Summary

api/v1/project GET/POST/DELETE CRUD on projects

api/v1/pnp-project/{{projectId}}/device GET/PUT/POST/DELETE CRUD on project device rules. Map image, template to device

api/v1/file/config POST upload a configuration file

api/v1/file/template POST upload a template configuration file

api/v1/file/image POST upload an image file

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
SWIM
Image Upgrade

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 40
Relationships

/image/importation

/network-device

/image/distribution /image/activation/device

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 41
Distribute Image
https://dnac/api/v1/image/distribution POST

[
{
"deviceUuid": "d28cfaf6-652d-4135-9a48-deb9419e0135",
"imageUuid": "7b249de7-66c7-461d-b2c0-ccc18ec45af6"
}
]

{"response":
{
"taskId": "860e6d40-1d93-4cb7-9336-21a6b7334598",
"url": "/api/v1/task/860e6d40-1d93-4cb7-9336-21a6b7334598"
},
"version": "1.0"}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Distribute Task
https://dnac/api/v1/task/860e6d40-1d93-4cb7-9336-21a6b7334598 GET

{
"version": "1.0",
"response": {
"lastUpdate": 1514850068336,
"serviceType": "Swim Service",
"version": 1514850068336,
"rootId": "860e6d40-1d93-4cb7-9336-21a6b7334598",
"id": "860e6d40-1d93-4cb7-9336-21a6b7334598",
"additionalStatusURL": "/api/v1/image/task?taskUuid=860e6d40-1d93-4cb7-9336-21a6b7334598",
"startTime": 1514850068264,
"isError": false
}
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 43
Distribute Additional Information
https://dnac/api/v1/image/task?taskUuid=860e6d40-1d93-4cb7-9336-21a6b7334598 GET

{
"version": "1.0",
"response": [
{
"deviceIp": "10.10.14.2",
"logDetails": "",
"imageName": "cat3k_caa-universalk9.16.06.02s.SPA.bin",
"taskUuid": "860e6d40-1d93-4cb7-9336-21a6b7334598",
"taskStatus": "success",
"completionTime": "1514850842258",
"deviceId": "d28cfaf6-652d-4135-9a48-deb9419e0135",
"startTime": "1514850068337",
"taskType": "distribute",
"deviceTaskUuid": "e684c1cf-efa1-4127-8daf-8087154300ac",
"unitTaskUuid": "ff61ce58-2d7d-41bf-92f9-f25be316212e", Note: This distributes image to
"operation": ""
}
all switches in a stack. Will wait
] until distribution is completed to
} all members.

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
Activate Image
https://dnac/api/v1/image/activation/device POST [
{
"deviceUuid": "d28cfaf6-652d-4135-9a48-deb9419e0135",
"deviceUpgradeMode" can be "deviceUpgradeMode": "install",
• "install" "distributeIfNeeded": false,
• "bundle" "activateLowerImageVersion": false,
"imageUuidList": [
• "currentlyExists" "7b249de7-66c7-461d-b2c0-ccc18ec45af6"
]
}
]

{
"version": "1.0",
"response": {
"url": "/api/v1/task/28dea525-afd4-41b7-a99d-c1ca32b531fb",
"taskId": "28dea525-afd4-41b7-a99d-c1ca32b531fb"
}
}

This Command is executed on switch (before a reboot):


request platform software package install switch all file flash:cat3k_caa-universalk9.16.06.02s.SPA.bin new auto-copy

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 45
Activate Task
https://dnac/api/v1/task/28dea525-afd4-41b7-a99d-c1ca32b531fb GET

{
"version": "1.0",
"response": {
"lastUpdate": 1514863660632,
"serviceType": "Swim Service",
"version": 1514863660632,
"rootId": "28dea525-afd4-41b7-a99d-c1ca32b531fb",
"id": "28dea525-afd4-41b7-a99d-c1ca32b531fb",
"additionalStatusURL": "/api/v1/image/task?taskUuid=28dea525-afd4-41b7-a99d-c1ca32b531fb",
"startTime": 1514863660554,
"data": "activate",
"isError": false
}
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
Activation Additional Information
https://dnac/api/v1/image/task?taskUuid=28dea525-afd4-41b7-a99d-c1ca32b531fb GET

{
"version": "1.0",
"response": [
{
"deviceIp": "10.10.14.2",
"logDetails": "",
"imageName": "cat3k_caa-universalk9.16.06.02s.SPA.bin",
"taskUuid": "28dea525-afd4-41b7-a99d-c1ca32b531fb",
"taskStatus": "success",
"completionTime": "1514864835053",
"deviceId": "d28cfaf6-652d-4135-9a48-deb9419e0135",
"startTime": "1514863660634",
"taskType": "activate",
"deviceTaskUuid": "c7042a0e-324d-4710-8c90-c2472ba88989",
"unitTaskUuid": "7f8c7acd-f496-4d31-b81c-60834866ce20", Note: The task "completes" after the
"operation": "" device is up. Device needs to sync
}
]
again before task completes.
} (19 mins for task, vs 8 mins reboot)

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 47
Distribution/Activate Image – One shot
https://dnac/api/v1/image/activation/device POST [
{
"deviceUuid": "d28cfaf6-652d-4135-9a48-deb9419e0135",
"deviceUpgradeMode": "install",
"distributeIfNeeded": true,
"activateLowerImageVersion": false,
"imageUuidList": [
"7b249de7-66c7-461d-b2c0-ccc18ec45af6"
]
}
]

{
"version": "1.0",
"response": {
"url": "/api/v1/task/a7249f76-6e3c-4b12-841b-41e52fa1ebc4", "Task" as per previous examples
"taskId": "a7249f76-6e3c-4b12-841b-41e52fa1ebc4"
} "AdditionalStatusInfo" will return status
} of both distribution/activation

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 48
Image Repository

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 49
Upload Image
https://dnac/api/v1/image/importation/source/url POST

[
{
"siteUuid": "-1",
"sourceURL": "http://10.10.10.137:8000/cat3k_caa-universalk9.16.06.02.SPA.bin"
}
]

{"response":
{
"taskId": "cfc3355b-fa7c-4d06-89f4-bf60c715be08",
"url": "/api/v1/task/cfc3355b-fa7c-4d06-89f4-bf60c715be08"
}, Task + AdditionalStatusInfo
"version": "1.0"}
as per previous examples.

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 50
SWIM API Summary

api/v1/image/importation?name=<str> GET GET images that have <str> in their name

api/v1/image/distribution POST Distribute images to devices

api/v1/image/activation/device POST Activate images on the devices

api/v1/mage/importation/source/url POST Upload image to DNAC

api/v1/device-image/device?id=<idList> POST Gets the status of golden images for the list of devices. Comma
sepperated list of deviceId
api/v1/device-image/device<deviceId>file/<filename> DELETE Removes the file from the device.

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 51
Other
Template based provisioning

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 53
Day-N Automation – Router and Switch
Workflow from Design to Provision
Create
Assign Provision
Template in
Template to Device with
Template
Site Profile Site Profile
Editor

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 54
Template Programmer Relationships
/template-programmer/project

/template-programmer/template

/network-device

/template-programmer/template/deploy

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 55
Apply Template to Device
https://dnac/api/v1/template-programmer/template/deploy POST

{
"templateId": "7606f662-bb5c-47c0-9b55-29bbff9b386c",
"targetInfo": [
{

"id": "10.10.14.2",
"type": "MANAGED_DEVICE_IP",
"params": {"vpn": "adam-vpn", "PREFIXES":["1.1.1.0/28","2.2.2.0/28"]}
}
]
}

{
"deploymentId": "6f40eca7-c998-4326-9928-905c58e22768",
"startTime": "",
"endTime": "",
"duration": "0 seconds"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 56
Look at the deployment
https://dnac/api/v1/template-programmer/template/deploy/status/6f40eca7-c998-4326-9928-905c58e22768 GET

{
"deploymentId": "6f40eca7-c998-4326-9928-905c58e22768", One entry for each device.
"deploymentName": "CLIProvisioningWorkflowDesign-2", Tells me I selected by IP
"templateName": "create_prefix_list.txt", address
"templateVersion": "8",
"projectName": "Markus",
"status": "SUCCESS",
"startTime": "06:17:54 23/01/2018",
"endTime": "06:17:55 23/01/2018",
"duration": "0 minutes 1 seconds",
"devices": [
{
"deviceId": "10.10.14.2",
"name": "",
"status": "SUCCESS",
"startTime": "06:17:54 23/01/2018",
"endTime": "06:17:55 23/01/2018",
"ipAddress": "10.10.14.2",
"duration": "0 minutes 1 seconds"
}
]
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 57
Template API Summary

api/v1/template-programmer/project GET/POST/DELETE CRUD on template projects

api/v1/template-programmer/template GET/POST/DELETE CRUD on templates. A template is part of a project

api/v1/template-programmer/template/deploy POST Deploy a template to a device

/api/v1/template-programmer/template/deploy/status/{{deploymentId}} GET Status of the deployment job

api/v1/file/image POST upload an image file

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 58
Command Runner
https://dnac/api/v1/network-device-poller/cli/read-request POST Needs
admin
{ "name" : "show ver",
"commands" : ["show ver | inc RELEASE"],
privilege
"deviceUuids" : ["74b69532-5dc3-45a1-a0dd-6d1d10051f27"]}

{ "response": {
"taskId": "f31ee1a7-abff-4260-b070-ac4b799508bc",
"url": "/api/v1/task/f31ee1a7-abff-4260-b070-ac4b799508bc"
}, "version": "1.0"}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 59
Look at the Task
https://dnac/api/v1/task/f31ee1a7-abff-4260-b070-ac4b799508bc GET

File containing
{ the results
"response": {
"endTime": 1516755634701,
"id": "f31ee1a7-abff-4260-b070-ac4b799508bc",
"isError": false,
"lastUpdate": 1516755634700,
"progress": "{"fileId":"7b14b25e-516b-4bef-88de-c40ed53f95cc"}",
"rootId": "f31ee1a7-abff-4260-b070-ac4b799508bc",
"serviceType": "Command Runner Service",
"startTime": 1516755633660,
"username": "admin",
"version": 1516755634700
},
"version": "1.0"
}

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 60
Get the file
https://dnac/api/v1/file/7b14b25e-516b-4bef-88de-c40ed53f95cc GET

[{ "deviceUuid":"74b69532-5dc3-45a1-a0dd-6d1d10051f27" ,
"commandResponses":{
"SUCCESS":{"show ver | inc RELEASE":"show ver | inc RELEASE\nCisco IOS Software [Everest], Catalyst L3 Switch Software
(CAT9K_IOSXE), Version 16.6.1, RELEASE SOFTWARE (fc2)\nBOOTLDR: System Bootstrap, Version 16.6.1r [FC1], RELEASE SOFTWARE
(P)\ncat_9k_2#"},
"FAILURE":{},
"BLACKLISTED":{}}}]

NOTE: Not JSON syntax


Content-Type →text/html; charset=utf-8
Be careful!!

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 61
Command Runner API Summary

api/v1/network-device-poller/cli/read-request POST Create command runner job. Can apply to multiple


devices and have multiple commands
api/v1/file/{{fileId}} GET The fileId will be returned in the task. NOTE: The file
type is not JSON, but text

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
Conclusion
Cisco Spark
Questions?
Use Cisco Spark to communicate
with the speaker after the session

How
1. Find this session in the Cisco Live Mobile App
2. Click “Join the Discussion”
3. Install Spark or go directly to the space
4. Enter messages/questions in the space

cs.co/ciscolivebot#DEVNET-3603

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
• Please complete your Online Complete Your Online
Session Evaluations after each
session
Session Evaluation
• 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
Communication Stations
Don’t forget: Cisco Live sessions will be available
for viewing on-demand after the event at
www.ciscolive.com/global/on-demand-library/.

© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public
Continue Your Education
• Demos in the Cisco campus
• Walk-in Self-Paced Labs
• Tech circle
• Meet the Engineer 1:1 meetings
• Related sessions

DEVNET-3603 © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Public 66
Thank you

You might also like