This article details instructions for two calls:
- api/inventory (listing assets on a server, and adding a new asset)
- api/inventory/{deviceId} (listing details of, updating, or deleting an asset, and tracking the queue status of a newly added asset).
Summary:
List the inventory devices (assets) on a server, and add a new device to the inventory.
URL:
http(s)://{server hostname}/api/inventory
Summary:
List details of, update, or delete an inventory device (asset) and, as of Entuity v23.0 P02 upwards, track the queue status of a newly added device, or remove a device from the queue.
URL:
http(s)://{server hostname}/api/inventory/{deviceId}
Note on the use of credential sets
GET Method - inventory/{deviceId}
PUT Method - inventory/{deviceId}
DELETE Method - inventory/{deviceId}
Note regarding backwards compatibility for adding a device using a local credential
Method summary
inventory:
- GET Method - list the contents of the inventory (XML, JSON).
- POST Method - queue a device to add to the inventory of a server (XML, JSON).
inventory/{deviceId}:
- GET Method - list details of an inventory device (XML, JSON) and, as of Entuity v23.0 P02 upwards, track the queue status of a newly added device.
- PUT Method - change an inventory device's details (XML, JSON).
- DELETE Method - remove a device from the inventory or, as of Entuity v23.0 P02 upwards, remove a device from the queue.
Note on the use of credential sets
From Entuity v19.0 upwards, users can create shared credential sets that can then be bulk-applied to multiple assets. Entuity recommends that you add devices using these shared credential sets. Please see below for the attributes required to define different types of credentials (credentials can be specified or seen by the corresponding credential name):
SNMP and virtualization-type devices:
- credentialId
Config Management:
- cmCredentialId
- cmCredentialName
Server or storage hardware:
- hwConnMethod
- hwConnPort
- hwCredentialId
- hwCredentialName
Server OS:
- osConnMethod
- osConnPort
- osCredentialId
- osCredentialName
User Defined REST Poller:
- udConnMethod
- udConnPort
GET Method - inventory
List the contents of the inventory, in either XML or JSON formats.
Response:
| Name | Description |
|---|---|
| count | number of devices in the inventory. |
| items |
list of device summary details:
|
Examples:
INPUT
curl –u admin:admin https://localhost/api/inventory?media=json
OUTPUT
{
"items": [
{
"serverId": "34564e92-3b4f-43ba-94a8-04309c0e48fe",
"id": "2",
"name": "A",
"added": true,
"polledName": "10.66.24.2"
}
],
"count": 1
}
INPUT
curl -u admin:admin https://localhost/api/autodiscoveryResults?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items count="1">
<item xsi:type="device" added="true" polledName="10.66.24.2" name="A" id="2" serverId="34564e92-3b4f-43ba-94a8-04309c0e48fe" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"/>
</items>
POST Method - inventory
Queue a device to add to the inventory of a server, via either XML or JSON formats.
URL parameters:
Note, URL parameters are appended to the end of the URL and are delimited from the main part of the URL using a question mark (?) character, see the example below.
| Name | Description |
|---|---|
|
allowduplicateIps (Pre Entuity v20.0) |
allow duplicate IP addresses. By default, ENA will not manage a device that has IP addresses that have already been seen on an existing managed device. The duplicateIps flag can be used to override this behavior. The flag will accept the values; "false", "no", "0", "true", "yes" or "1". To override ENA's default behavior, set this flag to true. For default behavior, set the flag to false or omit the flag altogether. |
Request parameters:
| Name | Description |
|---|---|
| agentId | ID of the Entuity Agent that you want to monitor the device upon adding the device to the inventory. See Entuity Agents. |
|
allowDuplicateIps (Entuity v20.0 upwards) |
allow duplicate IP addresses. To override the default behavior, the attribute has to be set to true and included in the body of the request. "allowDuplicateIps": "true" |
| cmCredentialId | ID of the config management credential set. |
| cmCredentialName | name of the config management credential - this name is only displayed if it is a shared credential (or, not a local credential). |
| configurationManagementLicense | if Configuration Management is enabled ('true') or disabled ('false'), by default false. |
| credentialId | ID of the shared credential set, used only for SNMP and virtualization assets. The credential must be a valid credential for the specified device type. credentialId is based on the credentials you have created and therefore can be any value. For example, if credentialId = 1 is an SNMP credential, and the device requires an API Key credential, the request will then fail. |
| deviceType |
Device type, one of:
Note, omit the deviceType parameter if deviceType is to be set automatically. |
| hwConnMethod |
connection method used to connect to the hardware asset, which is the collector name based on the device type being added: Server:
Storage:
VM Platform (VM Collector):
|
| hwConnPort | connection port used to connect to the hardware asset. |
| hwCredentialId | ID of the hardware asset credential set. |
| hwCredentialName | name of the hardware credential - this name is only displayed if it is a shared credential (or, not a local credential). |
| managementLevel |
management level:
|
| name | device name. |
| nameUsing |
device name is determined using one of the following:
|
| osConnMethod |
connection method used to connect to the OS, which is the collector name based on the device type being added, from the following:
|
| osConnPort | connection port used to connect to the OS. |
| osCredentialId | ID of the OS credential set. |
| osCredentialName | name of the OS credential - this name is only displayed if it is a shared credential (or, not a local credential). |
| polledName | DNS name or IP address. |
| protocol | transport protocol: IPv4, IPv6. |
| snmpBulk | whether SNMPBulkGet is used ('true' or 'false', by default false). |
| snmpPDUSize |
maximum size of SNMP PDU. 0 = system default |
| snmpRetry |
number of SNMP retries. 0 = system default |
| snmpTimeout |
SNMP timeout in seconds. 0 = system default |
| snmpType |
SNMP type:
|
| snmpPort | SNMP port number (if omitted, the default value is used). |
| udConnMethod | connection method used to connect to the user defined object. |
| udConnPort | connection port used to connect to the user defined object. |
| webURL |
web URL, applicable to the following asset types:
|
Response:
200 - OK (Device is queued to be added to the inventory.)
| Name | Description |
|---|---|
| message | the status information message is “Queued” or “Replaced”, depending on whether this is the first attempt to add a device, or if there is a previous failed attempt to add the device with the same polledName. |
|
deviceID (Entuity v23.0 P02 upwards) |
unique device ID that's allocated to a device upon being queued/added.
|
Examples:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST –H "content-type:application/json" -d \
'{
"polledName" : "10.66.23.1",
"managementLevel" : "FULL",
"protocol" : "IPv4",
"snmpType" : "v2c",
"credentialId" : "1"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": 1
}'
INPUT
curl -u admin:admin https://localhost/api/inventory?media=xml -X POST –H "content-type:application/xml" -d \
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<inventoryDevice
polledName="10.66.23.1"
managementLevel="FULL"
protocol="IPv4"
snmpType="v2c"
credentialId="1"
/>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusInfo>
<message>Queued</message>
<deviceID>1</deviceID>
</statusInfo>
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST –H "content-type:application/json" -d \
'{
"polledName" : "10.66.23.1",
"managementLevel" : "FULL",
"protocol" : "IPv4",
"snmpType" : "v2c",
"credentialId" : "1",
"allowDuplicateIps": "true"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "1"
}'
To add a device that is not a VM Platform, Cloud Controller, SDN Controller, Ping Only, or Custom Device:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"nameUsing" : "POLLEDNAME",
"polledName" : "10.66.33.2",
"managementLevel" : "FULL",
"protocol" : "IPv4",
"snmpType" : "v2c",
"credentialId" : "1"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "2"
}'
To add a device to an Entuity Agent (Entuity v23.0 GA upwards):
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"deviceType": "Server",
"polledName": "ATLESXPRDVM003",
"hwConnMethod" : "hpilorest",
"hwCredentialAttributes" : {"UserAndPasswordAttributes" : { "username" : "admin", "password" : "admin" }},
"agentId" : "f70ec589-c66f-41b3-88bb-21ff1de7c0c9"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "14"
}'
To specify a Ping Only device:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"nameUsing" : "POLLEDNAME",
"polledName" : "10.66.33.2",
"managementLevel" : "PING_ONLY",
"protocol" : "IPv4"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "3"
}'
To specify a device type such as VM Platform, Cloud Controller, SDN Controller:
i). To add an Amazon Web Services platform:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "WEB",
"polledName" : "AWS",
"deviceType" : "VM Platform",
"credentialId" : "4"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "4"
}'
ii). To add a Meraki Cloud Controller platform:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "WEB",
"polledName" : "Meraki",
"deviceType" : "Cloud Controller",
"webURL" : "https://api.meraki.com/api/v0/"
"credentialId" : "3"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "5"
}'
iii). To add an Azure platform:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "WEB",
"polledName" : "AZURE",
"deviceType" : "VM Platform",
"credentialId" : "5"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "6"
}'
iv). To add a Cisco APIC SDN Controller:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"polledName": "CiscoApic",
"webURL" : "https://sandboxapicdc.cisco.com/api/",
"webPlatformType" : "CISCO_APIC",
"credentialId" : "14"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "7"
}'
v). To add a VMWare Platform:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "WEB",
"polledName" : "vortex",
"deviceType" : "VM Platform",
"webURL" : "https://vortex/sdk",
"credentialId" : "6"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "8"
}'
vi). To add a Proxmox VE Platform:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"polledName": "10.12.345.67",
"deviceType": "VM Platform",
"hwConnMethod": "proxmoxrest",
"hwCredentialId": 7,
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "9"
}'
vii). To add a Viptela device:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "WEB",
"polledName" : "Viptela1",
"deviceType" : "Cloud Controller",
"webURL" : "https://api.viptela/com/api/v1",
"credentialId" : "6"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "10"
}'
viii). To add a Cisco DNA Center:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "WEB",
"polledName" : "DNAC1",
"deviceType" : "Cisco DNA Center",
"webURL" : "https://1.2.3.4",
"credentialId" : "6"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "11"
}'
ix). To add an Cisco UCS server device:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "CLI",
"polledName" : "CISCO UCS",
"deviceType" : "Server",
"hwConnMethod" : "ciscoucscimcsnmp",
"hwConnPort" : "0",
"hwCredentialId" : "9"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "12"
}'
x). To add a Linux OS:
INPUT
curl -u admin:admin https://localhost/api/inventory?media=json -X POST -H "content-type:application/json" -d \
'{
"managementLevel" : "FULL",
"polledName" : "LINUX UCS",
"deviceType" : "Server",
"osConnMethod" : "oslinuxssh",
"osConnPort" : "0",
"osCredentialId" : "5"
}'
OUTPUT
'{
"message": "Queued"
"deviceID": "13"
}'
GET Method - inventory/{deviceId}
List details of an inventory device, in either XML or JSON formats, and as of Entuity v23.0 P02, track the queue status of a newly added device.
Response:
| Name | Description |
|---|---|
| capabilities | device capabilities: routing, switching, switching & routing. |
| certified | if the device has been certified. |
| cmCredentialId | ID of the config management credential set. |
| cmCredentialName | name of the config management credential - this name is only displayed if it is a shared credential (or, not a local credential). |
| configurationManagementLicense | if Configuration Management is enabled ('true') or disabled ('false'), by default false. |
| context | SNMP v3 context. |
| credentialId | ID of the shared credential set, used for SNMP and virtualization assets. The credential must be a valid credential for the specified device type. credentialId is based on the credentials you have created and therefore can be any value. For example, if credentialId = 1 is an SNMP credential, and the device requires an API Key credential, the request will then fail. |
| deviceType | device type. |
| dsObjectId | device’s stormworks identifier. |
| id | device’s unique identifier. |
| hwConnMethod |
connection method used to connect to the hardware asset, which is the collector name based on the device type being added, from the following: Server:
Storage:
VM Platform (VM Collector):
|
| hwConnPort | connection port used to connect to the hardware asset. |
| hwCredentialId | ID of the hardware asset credential set. |
| hwCredentialName | name of the hardware credential - this name is only displayed if it is a shared credential (or, not a local credential). |
| managementIP | management IP address. |
| managementLevel |
management level:
|
| name | device name |
| nameUsing |
device name is determined using one of the following:
|
| osConnMethod |
connection method used to connect to the OS, which is the collector name based on the device type being added, from the following:
|
| osConnPort | connection port used to connect to the OS. |
| osCredentialId | ID of the OS credential set. |
| osCredentialName | name of the OS credential - this name is only displayed if it is a shared credential (or, not a local credential). |
| polledName | DNS name or IP Address. |
| protocol | Transport protocol: IPv4 or IPv6. |
|
queueStatus (Entuity v23.0 P02 upwards) |
The status of the device in the queue:
|
|
queueStatusMessage (Entuity v23.0 P02 upwards) |
Error message or failure reason. |
| serverId | server identifier. |
| snmpBulk | whether SNMPBulkGet is used ('true' or 'false', by default false). |
| snmpPDUSize | maximum size of SNMP PDU, where 0 = system default. |
| snmpPort | SNMP port number (if omitted, the default value will be used). |
| snmpRetry | number of SNMP retries, where 0 = system default. |
| snmpTimeout | SNMP timeout in seconds, where 0 = system default. |
| snmpType | SNMP version: v1, v2, v3 or v1/2. For a non-SNMP device, this will be 'none'. |
| sysDescription | SNMP description field. |
| sysLocation | SNMP retrieved system Location field. |
| sysOid | SNMP system identifier field. |
| udConnMethod | connection method used to the user defined object. |
| udConnPort | connection port used to the user defined object. |
| username | SNMP v3 user name. |
| webURL | virtual platform URL (non-Amazon virtual platforms). |
| zoneId | the ID of a zone. |
Examples:
INPUT
curl -u admin:admin https://localhost/api/inventory/2?media=json
OUTPUT
{
"serverId" : "12345e92-6b4f-73ba-89a8-04309c0e48fe",
"id": "2",
"name": "10.66.55.4",
"dsObjectId": 814,
"snmpTimeout": 0,
"snmpRetry": 0,
"snmpPDUSize": 0,
"protocol": "IPv4",
"snmpType": "v3",
"nameUsing": "CUSTOMNAME",
"certified": "Yes",
"polledName": "10.12.34.5",
"managementIP": "10.66.55.4",
"sysOid": ".1.3.6.1.4.1.2.3.50",
"sysDescription": "10/100 Mbps Ethernet Switch",
"sysLocation": "Simulator",
"deviceType": "Ethernet Switch",
"queueStatus": "Queued",
"queueStatusMessage": "Successful",
"readCommunity": "public",
"userName": "entuity",
"authType": "MD5",
"encrType": "DES",
"managementLevel": "FULL",
"context": "",
"zoneId": 0,
"cliUsername": ""
}
INPUT
curl -u admin:admin https://localhost/api/inventory/2?media=xml
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<inventoryDevice cliUsername="" zoneId="0" snmpPDUSize="0" snmpRetry="0" snmpTimeout="0" context="" encrType="NONE" authType="NONE" userName="" readCommunity="public" snmpType="v1/v2c" protocol="IPv4" certified="Yes" deviceType="Ethernet Switch" queueStatus: "Queued" queueStatusMessage: "Successful" managementLevel="FULL_MGMT_PORT_ONLY" capabilities="Switch" sysLocation="Simulator" sysDescription="10/100 Mbps Ethernet Switch" sysOid=".1.3.6.1.4.1.2.3.50" managementIP="10.66.55.4" polledName="10.66.55.4" nameUsing="CUSTOMNAME" dsObjectId="922" name="10.66.55.4" id="2" serverId="12345e92-6b74f-43ba-94a8-04309c0e48fe"/>
PUT Method - inventory/{deviceId}
Change the details of an inventory device, in either XML or JSON formats. For more information on managing assets from the Entuity UI, see this section.
Request:
Same as for GET - inventory/{deviceId} above.
Response:
200 OK
Examples:
INPUT
curl -u admin:admin https://localhost/api/inventory/2?media=json -X PUT -H "content-type:application/json" -d \
'{
"managementLevel" : "FULL",
"protocol" : "IPv4",
"snmpType" : "v3",
"userName" : "entuity",
"authType" : "MD5",
"authPass" : "entuity123",
"encrType" : "DES",
"encrPass" : "entuity123"
}'
OUTPUT
{
"serverId": "12345e92-6b4f-73ba-89a8-04309c0e48fe",
"id": "2",
"name": "10.66.55.4",
"dsObjectId": 814,
"snmpTimeout": 0,
"snmpRetry": 0,
"snmpPDUSize": 0,
"protocol": "IPv4",
"snmpType": "v3",
"nameUsing": "CUSTOMNAME",
"certified": "Yes",
"polledName": "10.66.55.4",
"managementIP": "10.66.55.4",
"sysOid": ".1.3.6.1.4.1.2.3.50",
"sysDescription": "10/100 Mbps Ethernet Switch",
"sysLocation": "Simulator",
"deviceType": "Ethernet Switch",
"queueStatus": "Successful",
"readCommunity": "public",
"userName": "entuity",
"authType": "MD5",
"encrType": "DES",
"managementLevel": "FULL",
"context": "",
"zoneId": 0,
"cliUsername": ""
}
INPUT
curl -H -u admin:admin https://localhost/api/inventory/2?media=xml -X PUT -d \
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<inventoryDevice
managementLevel="FULL"
snmpType="v3"
userName="entuity"
authType="MD5"
authPass="entuity123"
encrType="DES"
encrPass="entuity123"
/>'
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<inventoryDevice cliUsername="" zoneId="0" snmpPDUSize="0" snmpRetry="0" snmpTimeout="0" context="" encrType="DES" authType="MD5" userName="entuity" readCommunity="public" snmpType="v3" protocol="IPv4" certified="Yes" deviceType="Ethernet Switch" "queueStatus": "Successful", managementLevel="FULL" capabilities="Switch" sysLocation="Simulator" sysDescription="10/100 Mbps Ethernet Switch" sysOid=".1.3.6.1.4.1.2.3.50" managementIP="10.66.55.4" polledName="10.66.55.4" nameUsing="CUSTOM" dsObjectId="922" name="10.66.55.4" id="6" serverId="12345e92-6b4f-73ba-89a8-04309c0e48fe"/>
Changing the management level of an asset from Full to Basic:
Note, the device type must support the management level.
INPUT
curl -H -u admin:admin https://localhost/api/inventory/2?media=json -X PUT-H "content-type:application/json" -d \
'{
"managementLevel" : "BASIC",
"deviceType" : "Basic_SNMP",
}'
OUTPUT
{
"serverId": "{serverId}",
"id": "326",
"name": "123.45.6.7",
"dsObjectId": 1629,
"snmpTimeout": 0,
"snmpRetry": 0,
"snmpPDUSize": 0,
"protocol": "IPv4",
"snmpType": "v2c",
"deviceType" : "Basic_SNMP",
"queueStatus": "Successful",
"nameUsing": "IPADDRESS",
"certified": "Yes",
"polledName": "123.45.5.6",
"managementIP": "123.34.5.6",
"sysOid": ".1.3.6.1.4.1.2.3.50",
"managementLevel" : "BASIC",
}
Changing the credentials of a Cisco UCS server device:
INPUT
curl -H -u admin:admin https://localhost/api/inventory/14?media=json -X PUT -H "content-type:application/json" -d \
'{
"managementLevel" : "CLI",
"polledName" : "CISCO UCS",
"deviceType" : "Server",
"hwConnMethod" : "ciscoucscimcsnmp",
"hwConnPort" : "0",
"hwCredentialId" : "6"
}'
OUTPUT
{
"serverId": "{serverId}",
"id": "11",
"name": "CISCO UCS",
"dsObjectId": 1629,
"snmpTimeout": 0,
"snmpRetry": 0,
"snmpPDUSize": 0,
"protocol": "IPv4",
"snmpType": "None",
"nameUsing": "POLLEDNAME",
"certified": "",
"polledName": "CISCO UCS",
"managementIP": "xx.xx.xxx.xxx",
"sysOid": "",
"sysDescription": "",
"sysLocation": "",
"deviceType": "Server",
"queueStatus": "Successful",
"managementLevel": "CLI",
"zoneId": 0,
"snmpPort": 0,
"snmpBulk": false,
"hwConnMethod": "ciscoucscimcsnmp",
"hwCredentialId": 9,
"hwCredentialName": "snmpCreds2",
"deviceName": "CISCO UCS",
"configManagementLicense": false
}
DELETE Method - inventory/{deviceId}
Remove a device from the inventory or from the queue (if the device's queueStatus parameter is "Failed" or "Queued").
Note, you can't remove a device from the queue if its queueStatus parameter is "In Progress".
Request:
The ID of the object that is to be deleted is sent as a part of a URL.
Response:
“OK” message if the device was removed successfully, an error message otherwise.
Examples:
INPUT
curl -u admin:admin https://localhost/api/inventory/2?media=json –X DELETE
OUTPUT
{
"message": "OK"
}
INPUT
curl -u admin:admin https://localhost/api/inventory/2?media=xml –X DELETE
OUTPUT
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusInfo>
<message>OK</message>
</statusInfo>
Note regarding backwards compatibility for adding a device using a local credential:
Note, for backwards compatibility, users can still add a device or devices using a local credential (via api/inventory POST or api/inventory/{deviceId} PUT), but the credential details of such devices are not accessible via GET calls. The applicable parameters are as follows:
- authKey, authPass, authType.
- encrKey, encrPass, encrType.
- readCommunity, writeCommunity.
- webAccessKey, webPassword, webPlatformType, webSecretKey, webTenantId, webUser.
Comments
0 comments
Please sign in to leave a comment.