04-19-2017 07:59 AM
Hi, I am having issues adding devices to Prime:
I use the following URL:
https://192.168.4.2/webacs/api/v1/op/devices/bulkImport.json
This is the body of the request
{
"devicesImport" : {
"devices" : {
"device" : {
"ipAddress" : "192.168.4.151",
"networkMask" : "255.255.255.0",
"snmpReadCommunity" : "public",
"snmpRetries" : "2",
"snmpTimeout" : "10",
"snmpVersion" : "v2c",
"snmpWriteCommunity" : "private"
}
}
}
}
I got an response status 200 (that's fine) and this reply:
{
"mgmtResponse": {
"@responseType": "operation",
"@requestUrl": "https://192.168.4.2/webacs/api/v1/op/devices/bulkImport",
"@rootUrl": "https://192.168.4.2/webacs/api/v1/op",
"bulkImportResult": {
"jobName": "Job_BulkImport_05_48_57_668_AM_04_19_2017",
"message": "An import job has been successfully created. "
}
}
}
The issue is that the device is not in the list of network devices. Am I missing something in the request that make prime to ignore it?
Thanks!
04-19-2017 10:23 AM
Devices are added asynchronously. So an import job is created, and this resource comes back with a success response and gives you the job name. But in order to see if the device was able to be added, you'll have to check the status of the job.
For that, use the GET op/jobService/runhistory resource. So for your example, /webacs/api/v1/op/jobService/runhistory?jobName=Job_BulkImport_05_48_57_668_AM_04_19_2017
Note that the runhistory resource will return a blank response when the job is still in the scheduled and pending state.
04-19-2017 04:10 PM
Thank you, I will try with that to see what is wrong with the job.
I appreciate your help!
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