Note: the Inventory API is deprecated in favor of the JSON Store API.
An organization can contain one or more inventories.
The REST API provides support for working with inventories:
To remove a project’s value, specify an empty value. For example, you can use an
empty parent
inventory JSON object to remove a parent inventory from an
inventory.
Creates a new inventory with specified parameters.
/api/v1/org/{orgName}/inventory
POST
Authorization
, Content-Type: application/json
{
"name": "inventory",
"orgId": "---",
"orgName": "---",
"visibility": "Public/Private",
"owner": {
"id": "---",
"username": "---"
},
"parent": {
"id": "---",
"name": "---",
...
}
}
All parameters except name
are optional.
Parent inventory is also an inventory JSON object.
Success response
Content-Type: application/json
{
"result": "CREATED",
"ok": true,
"id": "..."
}
Updates parameters of an existing inventory.
/api/v1/org/{orgName}/inventory
POST
Authorization
, Content-Type: application/json
{
"name": "new name",
"id": "---",
"orgId": "---",
"orgName": "---",
"visibility": "---",
"owner": {
"id": "---",
"username": "---"
},
"parent": {
"id": "---",
"name": "---",
...
}
}
All parameters are optional except when updating inventory ‘name’, ‘id’ is required.
Omitted parameters are not updated.
Success response
Content-Type: application/json
{
"result": "UPDATED",
"ok": true,
"id": "..."
}
Removes an existing inventory and all its data and associated queries.
/api/v1/org/${orgName}/inventory/${inventoryName}
DELETE
Authorization
Content-Type: application/json
{
"ok": true,
"result": "DELETED"
}
Lists all existing inventories for the specified organization.
/api/v1/org/${orgName}/inventory
GET
Content-Type: application/json
[
{ "id": "...", "name": "..." },
...
]
Adds or updates host data. ${itemPath}
is a unique to identify the data (e.g.
a fully-qualified hostname).
/api/v1/org/${orgName}/inventory/${inventoryName}/data/${itemPath}
POST
Authorization
, Content-Type: application/json
{
"host": "my.host.example.com",
"meta": {
"env": "cert",
...
}
}
Content-Type: application/json
{
"host": "my.host.example.com",
"meta": {
"env": "cert",
...
}
}