12-11-2017 04:07 AM - edited 03-01-2019 04:42 AM
I am using these 2 requests to get all network devices and config for all these devices:
1. http://sandboxapic.cisco.com/api/v1/network-device
2. http://sandboxapic.cisco.com/api/v1/network-device/config
But the device id list returned by these 2 requests doesn't match. So I cannot correlate and find out which config output belongs to which device.
I know that I can execute config request per device, but that would result in too many requests, thus defeating the purpose.
Is this by design or bug or am I missing something obvious?
Device id list returned as part of 1st command
"id": "cd6d9b24-839b-4d58-adfe-3fdf781e1782"
"id": "26450a30-57d8-4b56-b8f1-6fc535d67645"
"id": "0dd240fd-5cca-4774-a801-9f1c04edcc70"
"id": "d337811b-d371-444c-a49f-9e2791f955b4"
"id": "5b5ea8da-8c23-486a-b95e-7429684d25fc"
"id": "30d39b18-9ada-4148-ad6c-2ee20975b845"
"id": "1b329f52-95eb-44ad-9314-55932162ab86"
"id": "c8ed3e49-5eeb-4dee-b120-edeb179c8394"
"id": "4af8bf34-295f-46f4-97b7-0a2d2ea4cf22"
"id": "9712ab62-6140-43fd-b1ee-1b07d1fb67d7"
"id": "55450140-de19-47b5-ae80-bfd741b23fd9"
"id": "ae19cd21-1b26-4f58-8ccd-d265deabb6c3"
-----
Device id list returned as part of 2nd command:
"id": "3f5fce09-5059-44f9-b388-b732b310bb3a"
"id": "883fdd02-8a94-4369-912c-78580c0cbdab"
"id": "ecba86e8-bbdc-4680-abd0-f4a9f0695c6b"
"id": "46f771f3-f3d3-4c0a-b385-c4b87bd46fba"
"id": "199344f7-1260-477f-9169-f15cc6a3c24f"
"id": "1a2490d0-3713-4c4d-8681-6139cfcc2758"
"id": "f0424d6b-4c33-4424-9bed-98f6795b4ba8"
"id": "438a5c6e-cb4b-450d-981b-52a4e3f43115"
"id": "1c3647d0-e426-431a-b9be-cdc1870883bf"
"id": "aac41324-cb34-41bb-b7b0-06d8bbab9a51"
Solved! Go to Solution.
12-11-2017 10:07 PM
Hi Umesh,
the id (UUID) is specific to the particular resource. You can think of it as a primary key in a database.
Every network device has an id that can be used to identify it. For example "cd6d9b24-839b-4d58-adfe-3fdf781e1782" will identify a particular network device.
Similarly every configuration has an id, to identify that configuration file.
You can get the config file for a specific network device by using the id of the network device. For example, if i take the second device (id=26450a30-57d8-4b56-b8f1-6fc535d67645),
You can get the configuration file for that device with the following request.
network-device/26450a30-57d8-4b56-b8f1-6fc535d67645/config
NOTE: you need to use the ID of the network-device, not the configuration file.
You also need to be careful about the config file for an access point. They do not really have a configuration file as the WLC will have that.
Hope that helps.
Adam
12-11-2017 10:07 PM
Hi Umesh,
the id (UUID) is specific to the particular resource. You can think of it as a primary key in a database.
Every network device has an id that can be used to identify it. For example "cd6d9b24-839b-4d58-adfe-3fdf781e1782" will identify a particular network device.
Similarly every configuration has an id, to identify that configuration file.
You can get the config file for a specific network device by using the id of the network device. For example, if i take the second device (id=26450a30-57d8-4b56-b8f1-6fc535d67645),
You can get the configuration file for that device with the following request.
network-device/26450a30-57d8-4b56-b8f1-6fc535d67645/config
NOTE: you need to use the ID of the network-device, not the configuration file.
You also need to be careful about the config file for an access point. They do not really have a configuration file as the WLC will have that.
Hope that helps.
Adam
12-11-2017 10:52 PM
Thanks Adam for the reply. I was wrongly assuming that id associated with config file is the device id. Now I understand. I was hoping to get all device config in one request and then associate these with respective devices. But I believe there's no such shortcut, I would have to send separate request to get each device config as you have mentioned above.
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