Skip to main content

Since the R12 upgrade, I'm not able to get all device using the API: /ServicesAPI/API/V1/CMDB/Devices

I'm only pulling 50 devices, and can’t seem to get the whole inventory. This was working fine previously. 

Anyone else running into a similar issue? Not sure if its an issue with my install and something changed or something with R12?

Hi ​@slodowic,

Thank you for your questions about the API endpoint: /ServiceAPI/API/V1/CMDB/Devices.

Name Type Description
hostname string OR list of string A list of device hostnames
ignoreCase boolean Recognizes as case-insensitive hostname
ip string OR list of string A list of device management IPs
    If provided both of hostname and ip, hostname has higher priority. If any of the devices are not found from the provided query parameter, return the found devices as a list in response and add another json key "deviceNotFound", the value is a mixed list of hostnames and IPs that are not found.
*fullattr integer Default is 0.
0: return basic device attributes (device id, management IP, hostname, device type, first discover time, last discover time).
1: return all device attributes, including customized attributes
*version string 0 - returns basic device attributes (device id, mgmt ip, hostname, device type, first discover time, last discover time)
1 - returns all device properties
skip integer The amount of records to be skipped. The value cannot be negative. If the value is negative, API throws exception {"statusCode":791001,"statusDescription":"Parameter 'skip' cannot be negative"}. No upper bound for this parameter.
limit integer The up limit amount of device records to return per API call. The value cannot be negative. If the value is negative, API throws exception {"statusCode":791001,"statusDescription":"Parameter 'limit' cannot be negative"}. No upper bound for this parameter. If the parameter is not specified in API call, it means there is not limitation setting on the call.
    If only skip value is provided, return the device list with 50 devices information start from the skip number. If only provide limit value, return from the first device in DB. If provided both skip and limit, return as required. Error exceptions follow each parameter's description.
Skip and limit parameters are based on the search result from DB. The "limit" value valid range is 10 - 100, if the assigned value exceeds the range, the server will respond error message: Parameter 'limit' must be greater than or equal to 10 and less than or equal to 100.
filter json If specified, return the matched device list with device attributes. Supported filtering attributes: name, assetTag, contact, descr, layer, loc, mgmtIP, model, site(complete site path, for example: "My Network\\Burlington"), sn, subTypeName, vendor, ver, hasBGPConfig, hasOSPFConfig, hasEIGRPConfig, hasISISConfig, hasMulticastConfig, hasOTVConfig, isHA, hasBPEConfig, isTransparent, isCluster, hasVXLANConfig, hasVPLSConfig, alias(the alias name of device Telnet/SSH settings)
    Only support AND operator, when multiple filter attributes are specified in JSON.
If provide invalid data format, return error invalid filter input.

 

Here's the updated link for your reference:

NetBrain-REST-API-R12/REST APIs Documentation/Devices Management/Get Device API Version_1.md at main · NetBrainAPI/NetBrain-REST-API-R12 · GitHub

Thanks,

Michael

 


Reply