- Having issues adding devices to Prime:
- Using 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.
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.
Comments
0 comments
Please sign in to leave a comment.