cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1011
Views
4
Helpful
2
Replies

Cannot add devices with bulk Import

sfloresk
Cisco Employee
Cisco Employee

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!

2 Replies 2

Spencer Zier
Cisco Employee
Cisco Employee

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.

Thank you, I will try with that to see what is wrong with the job.

I appreciate your help!