Inventory

The inventory API provides the core functionality of manipulating devices in the Net LineDancer inventory, including: adding devices, deleting devices, modifying devices, searching devices, etc.

See the Inventory Objects section for a description of the various objects consumed and returned by these APIs.

Inventory.createDevice

Add a device to the inventory, in the specified network. If the device was created successfully, the return value is null, otherwise an error message is returned.

Parameters

Parameter Type Description
network String Name of an existing network, e.g. “Default”
ipAddress String IPv4 or IPv6 address
adapterId String The ID of the adapter to use for backup, see Appendix A

Return: an error message or null

Inventory.deleteDevice

Delete a device from the inventory.

Parameters

Parameter Type Description
network String Name of an existing network, e.g. “Default”
ipAddress String IPv4 or IPv6 address

Return: null

Inventory.getDevice

The Inventory.getDevice method returns a Device object as described above, or null if the requested device does not exist.

Parameters

Parameter Type Description
network String Name of an existing network, e.g. “Default”
ipAddress String IPv4 or IPv6 address

Return: Device object or null

Inventory.updateDevice

The Inventory.updateDevice method is used to update an existing device in the inventory. It requires only network and ipAddress as parameters, all other parameters are optional.

Parameter Type Description
network String Name of the device’s network
ipAddress String IPv4 or IPv6 address
newNetwork String A new Network name for the device, or null
newIpAddress String A new IP address for the device, or null
newAdapterId String A new AdapterId for the device, or null
newHostname String A new Hostname for the device, or null

Return: null

Python Example:

error = netld.call('Inventory.updateDevice', 'Default', '10.0.0.1', null, null, null, 'newhostname')

Inventory.updateDevices

The Inventory.updateDevices method updates Adapter IDs and/or custom field values for multiple devices in a single operation.

Parameter Type Description
ipCsv String A comma separated list of devices of the form IPAddress@network
adapterId String The new adapter ID or null if it should remain unmodified.
customFields String Array An indexed array of custom fields

The ipCsv parameter is a comma separated list of devices of the form IPAddress@network (e.g. 192.168.0.254@NetworkA*,*10.0.0.1@NetworkB).

The adapterId parameter is either a new Adapter ID to assign to the specified devices, or null to leave the device’s Adapter ID at their current values. See Appendix A for a list of valid Adapter IDs.

The customFields parameter is an array of UTF-8 string values. The first element of the array corresponds to the Custom 1 custom field, and the fifth element corresponds to the Custom 5 custom field. Elements of the customFields array that are null will leave the corresponding custom fields at their current values.

Return: null

Python example:

netld.call('Inventory.updateDevices',
           '192.168.0.254@NetworkA,192.168.0.252@NetworkA',
           null,
           ['Tokyo HQ', 'Rack 1F-8'])

Inventory Objects

Device

Field Type Description
ipAddress String The IPv4 or IPv6 address of the device
hostname String The hostname of the device
network String The name of the managed network that the device resides in
adapterId String The NetLD “Adapter ID” used to manage this device
deviceType String The type of the device, “router”, “switch”, “firewall”, etc.
hardwareVendor String The hardware vendor who manufactured the device
model String The model number of the device
softwareVendor String The operating system vendor of the device
osVersion String The vendor specific OS version number string
backupStatus String The backup status of the device (SUCCESS, FAILURE, INVALID_CREDENTIAL, etc.)
complianceState Integer The compliance status of the device (0=compliant, 1=unsaved changes, 2=policy violations)
lastBackup Integer The timestamp of the most recent backup (in Unix Epoch time milliseconds)
lastTelemetry Integer The timestamp of the most recent neighbor collection (in Unix Epoch time milliseconds)
memoSummary String The first 60 characters of the device memo, or null
custom1 String The custom1 value, or null
custom2 String The custom2 value, or null
custom3 String The custom3 value, or null
custom4 String The custom4 value, or null
custom5 String The custom5 value, or null
serialNumber String The chassis serial number of the device, or null if not available

PageData

Attribute Type Description
offset Integer The starting offset in the results to begin retrieving pageSize number of Device objects. This value is required when PageData is used as a parameter.
pageSize Integer The maximum number of Device objects to retrieve in a single method call. This value is required when PageData is used as a parameter.
total Integer This value is set and retrieved from the server when an offset of zero (0) is passed. This indicates the total number of Device objects available. This value is ignored when PageData is used as a parameter.
devices Array An array of Device objects. This value is ignored when PageData is used as a parameter.

Inventory.getDeviceHardware

The Inventory.getDeviceHardware returns a list of hardware of the requested device.

Parameters

Parameter Type Description
ipAddress String IPv4 or IPv6 address
network String Name of the device’s network

Return: list of Hardware Objects