11-30-2017 03:04 AM - edited 03-01-2019 04:42 AM
I am trying to integrate our application with APIC-EM to fetch device inventory and config initially. Though I am able to find and use REST API to get device and host, it doesn't seem to have one to get device running config or any other show command output. Any workaround or is there something in the roadmap to include this API? I am using sandboxapic.cisco.com for my analysis and prototyping.
Our application features are dependent on the device running config and command output, hence the question.
Thanks
Solved! Go to Solution.
11-30-2017 05:11 AM
Both are supported.
one caveat, the /network-device/{network-device-id}/config API will return a sanitised configuration, with sensitive information removed.
NOTE: {network-device-id} is the 32char UUID for the device you want the configuration for.
I have documented the "command runner" api in this blog post.
APIC-EM 1.4 Update - Part 1 CommandRunner
Adam
11-30-2017 05:11 AM
Both are supported.
one caveat, the /network-device/{network-device-id}/config API will return a sanitised configuration, with sensitive information removed.
NOTE: {network-device-id} is the 32char UUID for the device you want the configuration for.
I have documented the "command runner" api in this blog post.
APIC-EM 1.4 Update - Part 1 CommandRunner
Adam
12-02-2017 04:01 AM
Thanks so much.
One more thing. I don't see device os name (i.e. ios, nxos) in the device inventory response. I know there are few other inventory attributes that can possibly be used to derive the os name, but still.
The output of http://sandboxapic.cisco.com/api/v1/network-device/ip-address/10.2.2.2:
{
"response": {
"location": "85b0e2d7-d5c3-4f78-8938-45bd482b2087",
"type": "Cisco 2911 Integrated Services Router G2",
"family": "Routers",
"errorCode": "DEV-UNREACHED",
"serialNumber": "FTX1840ALBY",
"role": "DISTRIBUTION",
"lastUpdateTime": 1512214557465,
"macAddress": "f0:7f:06:bb:dc:81",
"softwareVersion": "15.2(4)M6a",
"inventoryStatusDetail": "<status><general code=\"DEV_UNREACHED\"/></status>",
"upTime": "174 days, 23:49:53.28",
"series": "Cisco 2900 Series Integrated Services Routers G2",
"locationName": "Barcelona",
"tagCount": "1",
"hostname": "Branch-Router2",
"errorDescription": "SNMP timeouts are occurring with this device. Either the SNMP credentials are not correctly provided to controller or the device is responding too slow. Please ensure correct credentials are provided in discovery/global credentials and run discovery again. You can run the new discovery for this device alone using the “range discovery” feature",
"lastUpdated": "2017-12-02 11:35:57",
"roleSource": "MANUAL",
"apManagerInterfaceIp": "",
"bootDateTime": "2016-05-28 00:29:46",
"collectionStatus": "Partial Collection Failure",
"interfaceCount": "7",
"lineCardCount": "1",
"lineCardId": "94da60d6-5fc3-4613-bce7-7bc03e517647",
"managementIpAddress": "10.2.2.2",
"memorySize": "300246160",
"platformId": "CISCO2911/K9",
"reachabilityFailureReason": "SNMP Connectivity Failed",
"reachabilityStatus": "Unreachable",
"snmpContact": "",
"snmpLocation": "",
"tunnelUdpPort": null,
"instanceUuid": "6ce631db-9212-4587-867f-b8f3aed1702d",
"id": "6ce631db-9212-4587-867f-b8f3aed1702d"
},
"version": "1.0"
}
12-02-2017 07:18 PM
Yeap, that is a good point.
It can be inferred from the platform/family/type.
That is a good candidate for "make a wish".
Adam
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide