Cisco Prime Infrastructure API
Prime Infrastructure API Documentation

PUT devices/bulkImport

Resource Information

Rate Limiting?

Yes

Sorting?

No

Paging?

No

Filtering?

No

Response Formats

xml

json

User Group

NBI Write

HTTP Methods

PUT

An operation to add or update multiple devices using a batch job

Credential Profiles Support

  • There is limitation on attaching imported device to the credential profile. If credentialProfileName parameter is given and is not empty, this device must not contain any other credential parameters. Parameters allowed to be used with credentialProfileName are: ipAddress, networkMask, and udfs. If any credential parameter is set along with credentialProfileName, the entire import operation will fail; none of the devices in the import request will be added or updated.

User Defined Field Support

  • CPI 2.0+ supports importing and exporting devices with User Defined Field (UDF).
  • The maximum length of a UDF value is 255 characters. for CPI 2.0+, presently devices which have UDF values greater than 255 characters will be ignored
  • Each bulk Import service request overwrites existing UDF records. To update the UDF of a device, follow the steps:
    • Retrieve the full list UDFs of the device using devices/exportDevices service
    • Find the UDF entry to be updated in the list
    • Assign the new value of the entry
    • Use devices/bulkImport service to save the change

Resource URL

/webacs/api/v1/op/devices/bulkImport

Since : 2.2

Request Payload Parameters

Type Attribute Name Description

Device[]

devices

a list of devices to be imported in xml or json format

Response Parameters

Type Attribute Name Description

String

jobName

The job name created by the bulk import operation. The job name can be referred to check the status of the job using job management services

String

message

a message returned from the bulk import operation

Sample Payloads

Sample payloads are for information only. They are automatically generated and the values included may not be representative of actual valid data values.

Sample XML Request Payload

https://szier-m8-106.cisco.com/webacs/api/v1/op/devices/bulkImport

XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<devicesImport>
    <devices>
        <device>
            <cliEnablePassword>String value</cliEnablePassword>
            <cliPassword>String value</cliPassword>
            <cliRetries>String value</cliRetries>
            <cliTimeout>String value</cliTimeout>
            <cliUsername>String value</cliUsername>
            <credentialProfileName>String value</credentialProfileName>
            <httpConfigPassword>String value</httpConfigPassword>
            <httpConfigUsername>String value</httpConfigUsername>
            <httpMonitorPassword>String value</httpMonitorPassword>
            <httpMonitorUsername>String value</httpMonitorUsername>
            <httpPort>String value</httpPort>
            <httpServer>String value</httpServer>
            <ipAddress>String value</ipAddress>
            <networkMask>String value</networkMask>
            <protocol>String value</protocol>
            <snmpCommunity>String value</snmpCommunity>
            <snmpRetries>String value</snmpRetries>
            <snmpTimeout>String value</snmpTimeout>
            <snmpVersion>String value</snmpVersion>
            <snmpv3AuthPassword>String value</snmpv3AuthPassword>
            <snmpv3AuthType>String value</snmpv3AuthType>
            <snmpv3PrivacyPassword>String value</snmpv3PrivacyPassword>
            <snmpv3PrivacyType>String value</snmpv3PrivacyType>
            <snmpv3UserName>String value</snmpv3UserName>
            <udfs>
                <udf>
                    <name>String value</name>
                    <value>String value</value>
                </udf>
            </udfs>
        </device>
    </devices>
</devicesImport>

Sample JSON Request Payload

https://szier-m8-106.cisco.com/webacs/api/v1/op/devices/bulkImport.json

{
  "devicesImport" : {
    "devices" : {
      "device" : {
        "cliEnablePassword" : "String value",
        "cliPassword" : "String value",
        "cliRetries" : "String value",
        "cliTimeout" : "String value",
        "cliUsername" : "String value",
        "credentialProfileName" : "String value",
        "httpConfigPassword" : "String value",
        "httpConfigUsername" : "String value",
        "httpMonitorPassword" : "String value",
        "httpMonitorUsername" : "String value",
        "httpPort" : "String value",
        "httpServer" : "String value",
        "ipAddress" : "String value",
        "networkMask" : "String value",
        "protocol" : "String value",
        "snmpCommunity" : "String value",
        "snmpRetries" : "String value",
        "snmpTimeout" : "String value",
        "snmpVersion" : "String value",
        "snmpv3AuthPassword" : "String value",
        "snmpv3AuthType" : "String value",
        "snmpv3PrivacyPassword" : "String value",
        "snmpv3PrivacyType" : "String value",
        "snmpv3UserName" : "String value",
        "udfs" : {
          "udf" : {
            "name" : "String value",
            "value" : "String value"
          }
        }
      }
    }
  }
}

Sample XML Response Payload

https://szier-m8-106.cisco.com/webacs/api/v1/op/devices/bulkImport

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mgmtResponse rootUrl="https://szier-m8-106.cisco.com/webacs/api/v1/op/" requestUrl="https://szier-m8-106.cisco.com/webacs/api/v1/op/devices/bulkImport" responseType="operation">
    <bulkImportResult>
        <jobName>String value</jobName>
        <message>String value</message>
    </bulkImportResult>
</mgmtResponse>

Sample JSON Response Payload

https://szier-m8-106.cisco.com/webacs/api/v1/op/devices/bulkImport.json

{
  "mgmtResponse" : {
    "@rootUrl" : "https : \/\/szier-m8-106.cisco.com\/webacs\/api\/v1\/op\/",
    "@requestUrl" : "https : \/\/szier-m8-106.cisco.com\/webacs\/api\/v1\/op\/devices\/bulkImport",
    "@responseType" : "operation",
    "bulkImportResult" : {
      "jobName" : "String value",
      "message" : "String value"
    }
  }
}