mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Document flattened Inventory API function (#12404)
This commit is contained in:
@@ -11,7 +11,8 @@ cage, then the sfp itself. The way this API call is designed is to
|
||||
enable a recursive lookup. The first call will retrieve the root
|
||||
entry, included within this response will be entPhysicalIndex, you can
|
||||
then call for entPhysicalContainedIn which will then return the next
|
||||
layer of results.
|
||||
layer of results. To retrieve all items together, see
|
||||
[get_inventory_for_device](#get_inventory_for_device).
|
||||
|
||||
Route: `/api/v0/inventory/:hostname`
|
||||
|
||||
@@ -65,3 +66,52 @@ Output:
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### `get_inventory_for_device`
|
||||
|
||||
Retrieve the flattened inventory for a device. This retrieves all
|
||||
inventory items for a device regardless of their structure, and may be
|
||||
more useful for devices with with nested components.
|
||||
|
||||
Route: `/api/v0/inventory/:hostname/all`
|
||||
|
||||
- hostname can be either the device hostname or the device id
|
||||
|
||||
Example:
|
||||
|
||||
```curl
|
||||
curl -H 'X-Auth-Token: YOURAPITOKENHERE' https://librenms.org/api/v0/inventory/localhost?entPhysicalContainedIn=65536
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "ok",
|
||||
"message": "",
|
||||
"count": 1,
|
||||
"inventory": [
|
||||
{
|
||||
"entPhysical_id": "2",
|
||||
"device_id": "32",
|
||||
"entPhysicalIndex": "262145",
|
||||
"entPhysicalDescr": "Linux 3.3.5 ehci_hcd RB400 EHCI",
|
||||
"entPhysicalClass": "unknown",
|
||||
"entPhysicalName": "1:1",
|
||||
"entPhysicalHardwareRev": "",
|
||||
"entPhysicalFirmwareRev": "",
|
||||
"entPhysicalSoftwareRev": "",
|
||||
"entPhysicalAlias": "",
|
||||
"entPhysicalAssetID": "",
|
||||
"entPhysicalIsFRU": "false",
|
||||
"entPhysicalModelName": "0x0002",
|
||||
"entPhysicalVendorType": "zeroDotZero",
|
||||
"entPhysicalSerialNum": "rb400_usb",
|
||||
"entPhysicalContainedIn": "65536",
|
||||
"entPhysicalParentRelPos": "-1",
|
||||
"entPhysicalMfgName": "0x1d6b",
|
||||
"ifIndex": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user