06-23-2017 07:53 AM - edited 03-01-2019 04:38 AM
I have a python application that runs incrementally to check for unplanned devices and depending on what hardware platform, and how many ports the device has it pulls the serial number and creates a device within a project. That piece works well however I am having issues with the configId and imageId that are being sent to APIC EM through the API. If I put the text string for either in the API data it will appear on the web GUI correctly but fail to complete. If I reference the ID obtained through the API call to the configuration or images it will instead list that as a string value in the GUI, and also fail. Is there a specific format or process that I should be using to find these values?
06-23-2017 09:39 AM
In APIC-EM, after the image and config name appear in the gui and then the image fails. Can you click on status and post an image of what the steps the status has gone through up to the failure?
06-23-2017 09:52 AM
Brennan,
Dave is out of Texas and has been working with APIC-EM and has lots of programming experience. If we can figure out a time he is available, we might be able to get to the bottom of this whether it is a matter of order of operations, syntax, or a bug.
Philip
06-23-2017 12:34 PM
Take a look at my blog post, it shows how to use "configId". Network Automation with Plug and Play (PnP) – Part 2
Both "configId" and "imageId" are 32 character UUID, and should be passed as strings.
You PUT body should be something like this:
[{
"serialNumber": "12345678901",
"platformId": "C2960X",
"hostName": "syd-sw2",
"pkiEnabled": true,
"configId": "d300a372-ce55-4b02-9aac-b49e9c0d6e20"
"id" : "projectDeviceId"
}]
Can you include a screenshot to show the completed rule?
Maybe even some debugs from your script to show the data you are sending to the PUT API call (and the URL)
Adam
06-23-2017 01:47 PM
Hi Adam,
Please see the requests below:
Create Device Sent:
[{
"platformId": "WS-C3650-48PD",
"hostName": "Superswitch" ,
"configId": "58792682-97d0-4ae7-9fae-7217ab1dfb81",
}
]
Recieved:
202 Accepted
{
"response": {
"taskId": "b748d0a9-7fb8-4bc8-a172-6d44d05fe62e",
"url": "/api/v1/task/b748d0a9-7fb8-4bc8-a172-6d44d05fe62e"
},
"version": "1.0"
}
History Info | |||||||||||||||
|
06-23-2017 04:06 PM
If you manually add the config in the GUI instead of using the API to add the config, does it push the image successfully?
Also, are you getting the 32 character string that refers to the config you want to attach in a previous part of your script before POSTing it back? I am wondering if the string has changed for some reason from when you got it vs. when you send it back - that would be unlikely if you GET it 2 seconds before you POST it.
06-23-2017 04:57 PM
Thanks.
Is the config file saved in the config datastore?
Sent from my iPhone
06-23-2017 08:12 PM
Further to above comment.
If you do a GET of https://<apic-ip>/api/v1/file/namespace/config
you should see a list of file entries.
Can I have a look at the one for configId "58792682-97d0-4ae7-9fae-7217ab1dfb81". It will appear as the "id"
For example, mine looks like this ("id": "032cbf1a-7754-4e3c-b7a8-e4494060b198")
{ "nameSpace": "config",
"name": "3650-IWAN-dns.txt",
"downloadPath": "/file/032cbf1a-7754-4e3c-b7a8-e4494060b198",
"fileSize": "457",
"fileFormat": "text/plain",
"md5Checksum": "caaef9007391476913d958315a40e335", "sha1Checksum": "cb89a0c994df16cad9ee431f08d1073c17314f84",
"id": "032cbf1a-7754-4e3c-b7a8-e4494060b198" },
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