INVENTORY

INVENTORY protocol can be used by Inventory, NetDiscovery and NetInventory agent tasks, and also by injector, to submit any inventory.

Hint

Supported since GLPI 10.0.0

A. Agent request to submit an inventory

The request MUST match GLPI "inventory_format" specs and COMMON.

{
    "action": "inventory",
    "deviceid": "<device id>",
    "content": {
        "...inventory object following inventory_format..."
    },
    "itemtype": "Computer"
}
Description:
  • "action": [optional] and could be set to "inventory", "netdiscovery" or "netinventory", defaults is "inventory" when missing

  • "deviceid": [mandatory] as defined in inventory_format

  • "content": [mandatory] as defined in inventory_format

  • "itemtype": [optional] as defined in inventory_format but defaults to Computer

B. Server answer to a submitted inventory

See also COMMON protocol specs.

On successul submission, we expect a simple answer:

{
    "status": "ok",
    "expiration": 24
}

The server can return an error like:

{
    "status": "error",
    "message": "bad-format",
    "expiration": 24
}

or

{
    "status": "error",
    "message": "busy server",
    "expiration": 1
}

On busy server error, the agent should keep the inventory and retry its submission at the specified expiration.