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
Device[]
|
devices
|
a list of devices to be imported in xml or json format
|
String
|
cliEnablePassword
|
|
String
|
cliPassword
|
|
String
|
cliRetries
|
|
String
|
cliTimeout
|
|
String
|
cliUsername
|
|
String
|
credentialProfileName
|
OPTIONAL Name of device credential profile. Important note on import operation: device can include credentialProfileName OR other credentials; if credentialProfileName is given along with other credential information, the entire import operation will fail and none of the devices in the import request will be added or updated; the only fields that can be specified along with credentialProfileName are ipAddress, networkMask, and udfs.
|
String
|
httpConfigPassword
|
|
String
|
httpConfigUsername
|
|
String
|
httpMonitorPassword
|
|
String
|
httpMonitorUsername
|
|
String
|
httpPort
|
|
String
|
httpServer
|
|
String
|
ipAddress
|
REQUIRED the ip address of this device. it is a mandatory field
|
String
|
networkMask
|
|
String
|
protocol
|
|
String
|
snmpCommunity
|
|
String
|
snmpRetries
|
|
String
|
snmpTimeout
|
|
String
|
snmpVersion
|
|
String
|
snmpv3AuthPassword
|
|
String
|
snmpv3AuthType
|
|
String
|
snmpv3PrivacyPassword
|
|
String
|
snmpv3PrivacyType
|
|
String
|
snmpv3UserName
|
|
UserTag[]
|
udfs
|
The User Defined Field (UDF)list that are associated with this devices.The udf value should no longer than 255 characters.Longer values will be truncated to 255 characters. Semicolon is not allowed in the udf values Note: to update a UDF of a device, follow the steps: 1) retrieve the full list UDFs of the device using devices/exportDevices service 2) find the UDF entry to be updated in the list 3) assign the new value to the entry 4) use devices/bulkImport service to save the change. If only inlucde UDFs to be udpated in devices/bulkImport, other existing UDFs will be erased
|
|
|
Response Parameters
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"
}
}
}