APIC-EM API Deep Dive

74

Transcript of APIC-EM API Deep Dive

Page 1: APIC-EM API Deep Dive
Page 2: APIC-EM API Deep Dive

APIC-EM API Deep Dive DevNet-1093

Adam Radford Distinguished Systems Engineer

Page 3: APIC-EM API Deep Dive

• Introduction

• Tools• Authentication/Getting Started• Inventory/Topology

• PnP

• IWAN

• Policy – QoS – Dynamic QoS

Agenda

Page 4: APIC-EM API Deep Dive
Page 5: APIC-EM API Deep Dive
Page 6: APIC-EM API Deep Dive

`

APIC-EM - Platform Architecture

Network PnP Network InventoryPath TraceIWAN

Advanced Topology Visualizer

APIC-EM Applications

APIC-EM ControllerNorthbound REST APIs

APIC-EMServices

Grapevine

Inventory Manager RBAC Policy Analysis Policy

Programmer

Network PnPData Access Service

Topology Services

IWANServices

Elastic Service Infrastructure

APIC-EM Applications

APIC-EM Services

AddressesScale Outand HA

Requirements

Page 7: APIC-EM API Deep Dive

sandboxapic.cisco.com:9443

admin/C1sc0123

Page 8: APIC-EM API Deep Dive

Tools

Page 9: APIC-EM API Deep Dive

Swagger

9

Page 10: APIC-EM API Deep Dive

Try it out..

10

Page 11: APIC-EM API Deep Dive

Postman (now with JetPacks free)

11

Noun

verb

Body - JSON(with variables)

Page 12: APIC-EM API Deep Dive

Github Collection

12

Page 13: APIC-EM API Deep Dive

Authentication/Getting Started

Page 14: APIC-EM API Deep Dive

Roles Based Access Control

14

Three Roles TodayScope is for future use

Page 15: APIC-EM API Deep Dive

Getting a Ticket

15

https://adam-iwan:443/api/v1/ticket POST (need Content-Type header){

"username":"admin", "password":"secrete"

}

{ "response": { "serviceTicket": "ST-2-e7PF7jy6GJ43JEhmCbKi-cas" }, "version": "0.0"}

Page 16: APIC-EM API Deep Dive

Getting/Using the authentication ticket

16

Page 17: APIC-EM API Deep Dive

Inventory/Topology

Page 18: APIC-EM API Deep Dive

Relationships

18

/discovery /network-device /location

/interface

/host

/link

/tag

/flow-analysis

/topology

Page 19: APIC-EM API Deep Dive

Network-devicehttps://sandboxapic.cisco.com:9443/api/v1/network-device GET

{ "family": "Switches and Hubs","location": "e53d2525-6071-439b-b16d-17f92205a52b","type": "Cisco Catalyst 3850-48U-E Switch","serialNumber": "FOC1703V36B","role": "ACCESS","macAddress": "f0:29:29:5c:30:e2","softwareVersion": "03.03.00.SE","upTime": "12 days, 0:18:10.78","hostname": "CAMPUS-Access1","tagCount": "3","lastUpdated": "2015-10-28 21:44:50.936","locationName": "San Jose, CA","roleSource": "MANUAL","collectionStatus": "Managed","interfaceCount": "62","lineCardCount": "18","series": "Cisco Catalyst 3850 Series Ethernet Stackable Switch","apManagerInterfaceIp": "","bootDateTime": "2015-10-16 21:23:36.065","instanceUuid": "93a73198-850b-4002-bbf3-a224befae61d","id": "93a73198-850b-4002-bbf3-a224befae61d

"lineCardId": "6124970f-f0e8-42b9-9a3c-b3180b314729, 4066a0e5-c8ef-47dd-8db9-5bc8c11e3aab, 64e78af1-c910-4e79-8320-ffd6f97c3192, 1ed983ae-956c-45c8-ab0b-a0fa92e2b129, aeb9c8ae-573c-4d53-9f3e-6333071a9a39, b50fffb8-4841-4e02-948e-85fa0c0c1a60, 1e14c576-07f3-4bb6-a1d7-4e65821534ea, dc6d6fd4-8c03-45e0-96d5-dedd199fac9d, 2e543e11-71e0-4b6f-ac1a-be4afdcc4910, d83e1785-7e1c-4143-b075-decfc13caa63, 16635b81-2dba-4eed-9303-9f9fe7353e8b, 5943da96-5aeb-40f3-85b1-ff39ffa64b14, 77d9ca1c-ce5c-4be0-8beb-d8ec3246d6bc, 5b11cd8d-1801-42b5-ab38-521171f70d0e, e763c72c-7633-4b14-9184-87832c4c1c4d, 9ad4a2ed-a518-44a5-aa43-b3f63966dc19, d304ce80-02f6-4916-805c-65a60ba00f3e, abd72d26-f078-479e-a477-decdb259f4c9","managementIpAddress": "212.1.10.1","memorySize": "536870912","platformId": "WS-C3850-48U","reachabilityFailureReason": "Completed","reachabilityStatus": "Reachable","snmpContact": "","snmpLocation": "","tunnelUdpPort": null,

Page 20: APIC-EM API Deep Dive

Host

https://sandboxapic.cisco.com:9443/api/v1/host?limit=100&offset=1GET

{"id": "8c989306-818e-488f-9974-1476be6ca7b5","hostIp": "212.1.10.20","hostMac": "5c:f9:dd:52:07:78","hostType": "wired","connectedNetworkDeviceId": "93a73198-850b-4002-bbf3-a224befae61d","connectedNetworkDeviceIpAddress": "212.1.10.1","connectedInterfaceId": "0c429f3d-776d-40c6-96b1-17f460545764","connectedInterfaceName": "GigabitEthernet1/0/47","vlanId": "200","lastUpdated": "1446068511023","source": "200"}

Page 21: APIC-EM API Deep Dive

Topology

21

Page 22: APIC-EM API Deep Dive

Topology

https://sandboxapic.cisco.com:9443/api/v1/topology/physical-topology GET

{"deviceType": "wired","label": "212.1.10.20","ip": "212.1.10.20","nodeType": "HOST","family": "WIRED","role": "HOST","customParam":{},"id": "8c989306-818e-488f-9974-1476be6ca7b5"}

{"deviceType": "Cisco Catalyst 3850-48U-E Switch","label": "CAMPUS-Access1","ip": "212.1.10.1","softwareVersion": "03.03.00.SE","nodeType": "device","family": "Switches and Hubs","platformId": "WS-C3850-48U","tags":["Company-ABC", "Campus-Site", "POC-Site"],"role": "ACCESS","roleSource": "MANUAL","customParam":{},"id": "93a73198-850b-4002-bbf3-a224befae61d"}

Nodes[]

Page 23: APIC-EM API Deep Dive

Topologyhttps://sandboxapic.cisco.com:9443/api/v1/topology/physical-topology GET

{"source": "93a73198-850b-4002-bbf3-a224befae61d","startPortID": "0c429f3d-776d-40c6-96b1-17f460545764","target": "8c989306-818e-488f-9974-1476be6ca7b5","linkStatus": "UP"},

/host/8c989306-818e-488f-9974-1476be6ca7b5

network-device/93a73198-850b-4002-bbf3-a224befae61d

interface/0c429f3d-776d-40c6-96b1-17f460545764

links[]

{"source": "93a73198-850b-4002-bbf3-a224befae61d","startPortID": "ea919b9d-cf40-41b9-83bc-42e1ea07806e","startPortName": "GigabitEthernet1/0/1","startPortSpeed": "1000000","target": "b3aa8311-62f5-44a3-b432-fa857324f447","endPortID": "07132e28-404b-4335-8682-28fd294c06cf","endPortName": "GigabitEthernet5/5","endPortSpeed": "1000000","linkStatus": "up","id": "60067"},

Page 24: APIC-EM API Deep Dive

Location

24

See examples in POSTMAN

Page 25: APIC-EM API Deep Dive

Path Trace

25

Page 26: APIC-EM API Deep Dive

Path Trace

26

https://sandboxapic.cisco.com:9443/api/v1/flow-analysis POST{ "sourceIP" : "65.1.1.83", "destIP" : "212.1.10.20"}

{ "response": { "taskId": "c7896f2e-ee65-40c7-8213-a32e314eceb2", "url": "/api/v1/task/c7896f2e-ee65-40c7-8213-a32e314eceb2" }, "version": "1.0"}

Page 27: APIC-EM API Deep Dive

Path Trace – get TASK

27

https://sandboxapic.cisco.com:9443/api/v1/task/c7896f2e-ee65-40c7-8213-a32e314eceb2 GET

{ "response": { "progress": "9238c613-b5cc-4db5-b7df-bb1c1eca6306", "version": 1454732293035, "startTime": 1454732293035, "endTime": 1454732294870, "serviceType": "Policy Analysis Service", "rootId": "c7896f2e-ee65-40c7-8213-a32e314eceb2", "isError": false, "id": "c7896f2e-ee65-40c7-8213-a32e314eceb2" }, "version": "1.0"}

Page 28: APIC-EM API Deep Dive

Path Trace – get result

28

https://sandboxapic.cisco.com:9443/api/v1/flow-analysis/9238c613-b5cc-4db5-b7df-bb1c1eca6306 GET

{ "response": { "request": { "sourceIP": "65.1.1.83","destIP": "212.1.10.20" }, "lastUpdate": "Sat Feb 06 04:18:14 UTC 2016", "properties": [], "networkElementsInfo": [ { "id": "cf05d21e-29bc-4b9d-8a32-12f7877a8355", "type": "wireless", "ip": "65.1.1.83", "linkInformationSource": "Switched" }, { "id": "0a15fd77-44ba-4858-b3b1-0df37c4328e0", "name": "AP7081.059f.19ca", "type": "Unified AP", "ip": "55.1.1.3", "role": "ACCESS", "linkInformationSource": "Switched", "tunnels": [ "CAPWAP Tunnel" ] },

{ "id": "93a73198-850b-4002-bbf3-a224befae61d", "name": "CAMPUS-Access1", "type": "Switches and Hubs", "ip": "212.1.10.1", "ingressInterface": { "physicalInterface": { "id": "101550de-e72c-4071-81f7-3e2f4f3fbf62", "name": "GigabitEthernet1/0/26" } }, "egressInterface": { "physicalInterface": { "id": "ea919b9d-cf40-41b9-83bc-42e1ea07806e", "name": "GigabitEthernet1/0/1" } }, "role": "ACCESS", "linkInformationSource": "Switched", "tunnels": [ "CAPWAP Tunnel" ] },

Page 29: APIC-EM API Deep Dive

PnP

Page 30: APIC-EM API Deep Dive

5 apps that use the PNP API today• APIC-EM GUI

• IWAN App in APIC-EM

• Mobile PnP App (android/iphone)

• Prime Infrastructure (3.x)

• ESA

30

Page 31: APIC-EM API Deep Dive

Relationships

31

/file/image

/pnp-project

/file/config

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

/pnp-device

Pre-provisioned Ad-HocPost-provisioned

Page 32: APIC-EM API Deep Dive

PnP

32

/file/config/file/image

1

/pnp-project2

/pnp-project/{project-id}/device3

Page 33: APIC-EM API Deep Dive

File upload

33

No Content-type : application/json

Page 34: APIC-EM API Deep Dive

Get List of Config files

34

https://sandboxapic.cisco.com:9443/api/v1/file/namespace/config GET

{ "response": [ { "nameSpace": "config", "name": "README.md", "downloadPath": "/file/a95f7952-7eee-40cc-8664-d1abfa560611", "fileSize": "2174", "fileFormat": "text/x-markdown", "md5Checksum": "ae20d2b1ca4302e2bd7d9d3b2bfca907", "sha1Checksum": "888b09e200c9e25e13e563df10e7a101a959e648", "id": "a95f7952-7eee-40cc-8664-d1abfa560611" } ], "version": "1.0"}

Page 35: APIC-EM API Deep Dive

Create a Project

35

https://sandboxapic.cisco.com:9443/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"}

Page 36: APIC-EM API Deep Dive

Look at the Task

36

https://sandboxapic.cisco.com:9443/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"}

Page 37: APIC-EM API Deep Dive

GET list of projects

37

https://sandboxapic.cisco.com:9443/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"}

Page 38: APIC-EM API Deep Dive

Create a project rule

38

https://sandboxapic.cisco.com:9443/api/v1/pnp-project/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"}

Page 39: APIC-EM API Deep Dive

Mobile App – create a rule with no serial number

39

Page 40: APIC-EM API Deep Dive

Look at the Task

40

https://sandboxapic.cisco.com:9443/api/v1/task/81689911-1eb4-4bf9-a98a-cb0e23be49d1 GET

{ "response": {"progress": "{\"message\":\"Success creating new site device(rule)\",\"ruleId\":\"a0ec4fe5-ba3b-49ef-8ff4-ac5b41f7c0cd\"}", "version": 1454811570096, "startTime": 1454811570096, "endTime": 1454811570163, "serviceType": "Ztd Service", "rootId": "81689911-1eb4-4bf9-a98a-cb0e23be49d1", "isError": false, "id": "81689911-1eb4-4bf9-a98a-cb0e23be49d1" }, "version": "1.0"

Page 41: APIC-EM API Deep Dive

GET list of project rules

41

https://sandboxapic.cisco.com:9443/api/v1/pnp-project/91bf82f8-99b3-4908-9145-19a435ee86e8/device GET

{"response": [{ "hostName": "syd-sw1", "platformId": "C2960X", "serialNumber": "12345678901", "site": "Sydney", "pkiEnabled": true, "sudiRequired": false, "apCount": "0", "isMobilityController": "false", "state": "PENDING", "stateDisplay": "Pending",

<contined next page>

<continuation>

"authStatus": { "type": "Unknown", "status": "None", "errorMessage": null, "timestamp": 1454811700178, "certInfo": null }, "attributeInfo": {}, "id": "a0ec4fe5-ba3b-49ef-8ff4-ac5b41f7c0cd" }],"version": "1.0"}

Page 42: APIC-EM API Deep Dive

DELETE project (and rules)

42

https://sandboxapic.cisco.com:9443/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"}

Page 43: APIC-EM API Deep Dive

Look at the Task

43

https://sandboxapic.cisco.com:9443/api/v1/task/cd9d7e8a-78a8-4512-a905-14671a23d535 GET

{ "response": { "progress": "Success Deleting ZTD Site: id# 91bf82f8-99b3-4908-9145-19a435ee86e8", "version": 1454812176855, "startTime": 1454812176855, "endTime": 1454812176907, "serviceType": "Ztd Service", "rootId": "cd9d7e8a-78a8-4512-a905-14671a23d535", "isError": false, "id": "cd9d7e8a-78a8-4512-a905-14671a23d535" }, "version": "1.0"}

Page 44: APIC-EM API Deep Dive

Unclaimed devices

44

Page 45: APIC-EM API Deep Dive

GET unclaimed devices

45

https://adam-iwan/api/v1/pnp-device?state=UNCLAIMED&matchDeviceState=true GET

[{"platformId": "WS-C3650-48PQ", "hostName": "Switch", "bootVariable": "flash:packages.conf", "id": "02b0adcf-dd6b-4945-a703-44b5b0bc187e", "configReg": "0x102", "pnpProfileUsedAddr": "10.10.10.140", "state": "UNCLAIMED", "pnpProfileAutoCreated": true, "unclaimedHint": "new-device","deviceDetailsLastUpdate": "2016-02-07 04:11:24","lastStateTransitionTime": "2016-02-07 04:11:25", "firstContact": "2016-02-07 04:06:05.000906", "versionCompatible": "supported", "attributeInfo": {}, "topologyInfo": "neighborLink: Local Interface=null Local MacAddress=6c41.6a0d.e781 Remote Interface=null Remote MacAddress=7c95.f3bd.2a05 Remote DeviceName=null Remote Platform=null;\n", "imageFile": "flash:packages.conf", "versionString": "15.2(2)E3", "apCount": "0",

<continuation> "pkiEnabled": true, "stateDisplay": "Unclaimed", "returnToRomReason": "reload", "serialNumber": "FDO1732Q00B", "sudiRequired": false, "filesystemInfo": "fileSystem: name=crashinfo type=disk size=248354816 freespace=248353792;\n", "certificateNeededState": "NULL_STATE", "mainMemSize": "0", "authStatus": { "status": "Unsupported", "timestamp": 1454818039783, "errorMessage": null, "type": "Unsupported", "certInfo": null }, "lastContact": "2016-02-07 04:11:25.000051", "ipAddress": "10.10.14.4", "isMobilityController": "false" },

Page 46: APIC-EM API Deep Dive

Claim a device -- PUT

46

https://sandboxapic.cisco.com:9443/api/v1/pnp-device PUT

[{"state" : "START_PROVISIONING","id" : "02b0adcf-dd6b-4945-a703-44b5b0bc187e","pkiEnabled" : true,"configId" : "ac828621-dd47-4201-856d-be605413f33b"

}]

{ "response": {

"taskId": "d8502137-5d2b-4e81-a0e6-e0e71a07abc9", "url": "/api/v1/task/d8502137-5d2b-4e81-a0e6-e0e71a07abc9"

}, "version": "1.0" }

Even though "pkiEnable is true by default, need to set this is want device certificate to be provisioned

Page 47: APIC-EM API Deep Dive

Look at the Task

47

https://adam-iwan/api/v1/task/d8502137-5d2b-4e81-a0e6-e0e71a07abc9 GET

{ "response": { "progress": "Success Updating Device: id# 02b0adcf-dd6b-4945-a703-44b5b0bc187e", "startTime": 1454819475470, "endTime": 1454819475594, "version": 1454819475470, "serviceType": "Ztd Service", "rootId": "d8502137-5d2b-4e81-a0e6-e0e71a07abc9", "isError": false, "id": "d8502137-5d2b-4e81-a0e6-e0e71a07abc9" }, "version": "1.0"}

Page 48: APIC-EM API Deep Dive

State changes

48

./watch_provision.py FDO1732Q00BWatching unclaimed for serial:FDO1732Q00B19:49:35: Duration (0) Unclaimed19:49:43: Duration (9) Waiting for Resource19:50:02: Duration (28) Start Provisioning19:51:08: Duration (94) Deploying Device Certificate19:52:09: Duration (155) Deploying Config19:54:09: Duration (275) Provisioned19:54:09: Completed (275): PROVISIONED

Page 49: APIC-EM API Deep Dive

GET provisioned device

49

https://adam-iwan/api/v1/pnp-device?serialNumber=FDO1732Q00B GET

[{"platformId": "WS-C3650-48PQ", "hostName": "3650-dhcp", "bootVariable": "flash:packages.conf", "id": "02b0adcf-dd6b-4945-a703-44b5b0bc187e", "configId": "ac828621-dd47-4201-856d-be605413f33b", "configReg": "0x102", "pnpProfileUsedAddr": "10.10.10.140", "unclaimedHint": "new-device", "pnpProfileAutoCreated": true, "state": "PROVISIONED", "provisioningType": "new-device-adhoc", "deviceDetailsLastUpdate": "2016-02-07 04:31:39", "lastStateTransitionTime": "2016-02-07 04:34:46", "firstContact": "2016-02-07 04:06:05.000906", "versionCompatible": "supported", "attributeInfo": {}, "topologyInfo": "neighborLink: Local Interface=null Local MacAddress=6c41.6a0d.e781 Remote Interface=null Remote MacAddress=7c95.f3bd.2a05 Remote DeviceName=null Remote Platform=null;\n",

<continuation>"imageFile": "flash:packages.conf","versionString": "15.2(2)E3","apCount": "0","pkiEnabled": false,"stateDisplay": "Provisioned","returnToRomReason": "reload","serialNumber": "FDO1732Q00B","sudiRequired": false,"filesystemInfo": "fileSystem: name=crashinfo type=disk size=248354816 freespace=248353792;\n","certificateNeededState": "NULL_STATE","mainMemSize": "0","authStatus": {"status": "Unsupported", "timestamp": 1454818039783, "errorMessage": null, "type": "Unsupported", "certInfo": null}, "isMobilityController": "false", "ipAddress": "10.10.14.4", "lastContact": "2016-02-07 04:34:46.000425" }

Page 50: APIC-EM API Deep Dive

UI

50

Page 51: APIC-EM API Deep Dive

Iwan

Page 52: APIC-EM API Deep Dive

Relationships

52

/relevance

/category

/application /policyQoSPath Selection

Page 53: APIC-EM API Deep Dive

Policy Construct - IWAN

/relevance/category

/application

/policy

Page 54: APIC-EM API Deep Dive

GET Policy

54

https://adam-iwan/api/v1/policy/323476c2-07d7-4065-9d01-151dfd01822f GET

{"policyName": "email", "instanceUuid": "323476c2-07d7-4065-9d01-151dfd01822f", "resource": { "categories": [ { "id": "07675131-e383-4e80-97a2-9ec503b9f6a4", "name": "email" }] }, "actions": [ "SET_PROPERTY"], "state": "Active", "taskId": "f861eb13-26ad-4911-90f1-76112a58a6df", "scope": "GLOBAL", "actionProperty": { "pathControlFlag": true, "PrimaryPathPref": [ "mpls"], "SecondaryPathPref": [ "interne"], "pathPreferenceFlag": true, "relevanceLevel": "Business-Critical" }, "id": "323476c2-07d7-4065-9d01-151dfd01822f"}

Page 55: APIC-EM API Deep Dive

PUT Policy

55

https://adam-iwan/api/v1/policy/ PUT[{"policyName": "email", "instanceUuid": "323476c2-07d7-4065-9d01-151dfd01822f", "resource": { "categories": [ { "id": "07675131-e383-4e80-97a2-9ec503b9f6a4", "name": "email" }] }, "actions": [ "SET_PROPERTY"], "state": "Active", "taskId": "f861eb13-26ad-4911-90f1-76112a58a6df", "scope": "GLOBAL", "actionProperty": { "pathControlFlag": true, "PrimaryPathPref": [ "mpls"], "SecondaryPathPref": [ "interne"], "pathPreferenceFlag": true, "relevanceLevel": "Default" }, "id": "323476c2-07d7-4065-9d01-151dfd01822f"}]

Page 56: APIC-EM API Deep Dive

Get Task

56

https://adam-iwan/api/v1/task/b58dae3a-2702-4160-a6ef-5517c54af36c GET

{ "rootId": "b58dae3a-2702-4160-a6ef-5517c54af36c", "serviceType": "Policy Service", "id": "b58dae3a-2702-4160-a6ef-5517c54af36c", "operationIdList": [ "b3e9423c-ffa5-4869-a0db-6321310848d5" ], "version": 1454836724342, "startTime": 1454836724341, "endTime": 1454836732262, "isError": false}

Page 57: APIC-EM API Deep Dive

UI

57

Page 58: APIC-EM API Deep Dive

Get Policy count

58

https://adam-iwan/api/v1/policy/count GET

{ "response": 23, "version": "1.0"}

Page 59: APIC-EM API Deep Dive

Categories

59

https://adam-iwan/api/v1/category GET

[{ "id": "03326c93-6169-46c6-8b8b-5da0a6689e83", "name": "voice-and-video" }, { "id": "07675131-e383-4e80-97a2-9ec503b9f6a4", "name": "email" }, { "id": "11d04044-74c6-4e9c-9f6a-fffa8c8bcf78", "name": "business-and-productivity-tools" }, { "id": "170f7fba-a098-4b6f-8f63-83cfb7135be6", "name": "inter-process-rpc" }, { "id": "267f0bda-e545-4bc8-825f-13df9b1ded26", "name": "backup-and-storage" }, { "id": "3c5478e6-46cc-4417-a2e4-61b9109504a6", "name": "software-updates" }, <continued>

Page 60: APIC-EM API Deep Dive

Applications in Category

60

https://adam-iwan/api/v1/application?categoryId=07675131-e383-4e80-97a2-9ec503b9f6a4 GET

[{ "pfrThresholdOneWayDelay": 100, "tcpPorts": "143,220", "encrypted": "false", "references": "http://tools.ietf.org/html/rfc3501", "udpPorts": "143,220", "pfrThresholdJitter": 1, "applicationGroup": "imap-group", "pfrThresholdJitterPriority": 3, "category": "email", "instanceUuid": "1ba5312a-892e-4d59-b0c3-f403342766d6", "subCategory": "enterprise-transactional-apps", "pfrThresholdLossRate": 5, "helpString": "Internet Mail Access Protocol", "id": "1ba5312a-892e-4d59-b0c3-f403342766d6", "pfrThresholdLossRatePriority": 2, "indicativeUdpPorts": "143,220", "categoryId": "07675131-e383-4e80-97a2-9ec503b9f6a4", "nbarId": "17", "p2pTechnology": "false", "appProtocol": "tcp/udp", <continued>

"longDescription": "Internet Message Access protocol (IMAP) allows users to acess their email servers and to receive and send emails. The protocol simulates a local use when in fact it is a connection to a server. An IMAP server usually listens on port 143.", "pfrThresholdOneWayDelayPriority": 1, "name": "imap", "globalId": "L4:143", "tunnel": "false", "popularity": 9, "enabled": "true", "trafficClass": "BULK_DATA", "indicativeTcpPorts": "143,220", "selectorId": "143", "engineId": "3" },

Page 61: APIC-EM API Deep Dive

EasyQoS/Dynamic QoS

Page 62: APIC-EM API Deep Dive

Relationships

62

/relevance

/application

/policy QoS

/policy/tag

Page 63: APIC-EM API Deep Dive

Easy QoS

63

/policy/tag

/relevance

/application

Page 64: APIC-EM API Deep Dive

Easy QoS -tags

64

https://ga-1/api/v1/policy/tag GET

{ "response": { "policyTags": [ "New-York-Branch", "Chicago-Campus", "San-Francisco-Branch" ] }, "version": "1.0"}

Page 65: APIC-EM API Deep Dive

Easy QoS –tag Association

65

https://ga-1/api/v1/policy/tag/association GET

{ "response": [ { "policyTag": "New-York-Branch", "networkDeviceIds": [ "69d11938-f1b6-40b5-a81c-12d19ed728b9", "b657086d-63a3-4052-bdbb-33d9638bec8b", "1cba8dd8-877b-466e-8e2d-9db83bd1c451" ] },{ "policyTag": "Chicago-Campus", "networkDeviceIds": [ "601d6cb7-a254-45cd-bb28-3193f7fc7e78", "acb3f02c-3101-478b-abed-0cba2d827c75", "0a4de2ea-23e4-4c01-a7b8-394b156c69e6", "fcd91e8e-c7ab-4e4e-87e1-aa87fa8b8756", "fbadfdb7-53b3-48c7-80fd-b06d8aac808d", "bea293d2-2b48-448a-9c2d-92074309151e", "13062fd6-4eb4-44be-b646-684015440b66", "2ac6c4f7-8975-4830-a03b-9dfe7448054a" ] }, <CONTINUED>

{ "policyTag": "San-Francisco-Branch", "networkDeviceIds": [ "f2a2c29c-ed9d-48ef-aab7-fa81c3035126", "219b0443-08e6-4bd6-a15c-74d9ea965ba2" ] } ], "version": "1.0"}

Page 66: APIC-EM API Deep Dive

Easy QoS - Relvance

66

https://ga-1/api/v1/relvance GET

{ "response": [ "Default", "Business-Irrelevant", "Business-Relevant" ], "version": "1.0"}

Page 67: APIC-EM API Deep Dive

Easy QoS – Specific Policy

67

https://ga-1/api/v1/policy/e0bd599a-2bfb-48b0-862e-dc11549c9dd8 GET

{ "policyName": "Enterprise-SanFran-QOS", "policyPriority": 4095, "policyScope": "San-Francisco-Branch", "resource": { "applications": [ { "id": "6fcf0f08-ad86-44bb-bffd-3eb946d5c749", "appName": "groove" },{ "id": "7172a1d9-b1eb-4629-9e3c-47ab5570882e", "appName": "streamwork" },{ "id": "6f509514-73a5-4486-a59e-499e4b5fc141", "appName": "secure-http" },{ "id": "77bfc7f7-da7d-40dd-a0d2-328a03905acb", "appName": "ripng" },{ "id": "708743aa-5033-4497-b1d5-a7d68eab157d", "appName": "xdmcp" } ]},

"actions": [ "SET_PROPERTY" ], "state": "Active", "taskId": "302da30f-11b7-438b-be58-00f51c703d9f", "instanceUuid": "e0bd599a-2bfb-48b0-862e-dc11549c9dd8", "actionProperty": { "pathControlFlag": false, "pathPreferenceFlag": false, "relevanceLevel": "Business-Relevant" }, "id": "e0bd599a-2bfb-48b0-862e-dc11549c9dd8"}

Page 68: APIC-EM API Deep Dive

Easy QoS – Specific Policy Task

68

https://ga-1/api/v1/task/302da30f-11b7-438b-be58-00f51c703d9f GET

{ "rootId": "302da30f-11b7-438b-be58-00f51c703d9f", "serviceType": "Policy Service", "version": 1454515356826, "id": "302da30f-11b7-438b-be58-00f51c703d9f", "operationIdList": [ "4e3a182f-e583-441b-bc69-a25b3169d0b3" ], "startTime": 1454515356826, "endTime": 1454515357098, "isError": false}

Page 69: APIC-EM API Deep Dive

Current Differences between IWAN and EQ Policy

69

IWAN EasyQoS

Scope Global (until May) Tag based

Relevance Categorization

Per Application Category Per Application

Devices Supported Routers – IWAN deployed

Routers/switches/WLAN

Dynamic Policy NA Yes, Voice, Video

Page 70: APIC-EM API Deep Dive

Dynamic QoS

70

Dynamic QoS Enabled

Dynamic QoS Policies

Page 71: APIC-EM API Deep Dive

Dynamic QoS

71

https://ga-1/api/v1/policy/flow POST{ "sourceIP" : "172.28.97.54", "destIP" : "10.10.10.51", "sourcePort" : "30952", "destPort" : "22754", "protocol" : "tcp", "flowType" : "VOICE", "averageBandwidth": "64", "peakBandwidth": "64", "qosClassName": "conversational.audio.avconf.aq",

"appId": "e40d4836-45aa-39b2-e46b-84018b289e15",

"codec": "g.711u"}

https://ga-1/api/v1/task/5a8b0c01-b944-4ea5-aa66-7f9c44dafc37 GET{ "response": { "progress": "3c24b97b-c417-4a49-adcc-870209b81fcd", "startTime": 1455440014855, "endTime": 1455440014858, "version": 1455440014855, "serviceType": "Policy Service", "isError": false, "operationIdList": [ "4441f491-ab3b-41eb-a382-c9e6ef4ff6f5" ], "rootId": "5a8b0c01-b944-4ea5-aa66-7f9c44dafc37", "id": "5a8b0c01-b944-4ea5-aa66-7f9c44dafc37" }, "version": "1.0"}

Page 72: APIC-EM API Deep Dive

Dynamic Policy

72

https://ga-1/api/v1/policy/flow GET

"response": [ { "id": "3c24b97b-c417-4a49-adcc-870209b81fcd", "sourceIP": "172.28.97.54", "destIP": "10.10.10.51", "sourcePort": "30952", "destPort": "22754", "protocol": "tcp", "flowType": "VOICE", "averageBandwidth": "64", "peakBandwidth": "64", "codec": "g.711u", "status": "CONFIG_ADD_SUCCESS" } ]

Page 73: APIC-EM API Deep Dive

Delete Dynamic Policy

73

https://ga-1/api/v1/policy/flow/3c24b97b-c417-4a49-adcc-870209b81fcd DELETEhttps://ga-1/api/v1/task/ce0e653c-9bc2-4ab0-9783-ef6505bd1d2f GET

{ "response": { "progress": "3c24b97b-c417-4a49-adcc-870209b81fcd", "startTime": 1455440274442, "endTime": 1455440274446, "version": 1455440274446, "serviceType": "Policy Service", "isError": false, "operationIdList": [ "d38a1716-2b90-4fd1-9032-17ed47dd0661" ], "rootId": "ce0e653c-9bc2-4ab0-9783-ef6505bd1d2f", "id": "ce0e653c-9bc2-4ab0-9783-ef6505bd1d2f" }, "version": "1.0"}

Page 74: APIC-EM API Deep Dive