Inventory Objects¶
-
GET
/api/v2/objects/
¶ List of inventory objects.
Example request:
GET /api/v2/objects/ HTTP/1.1
Example response:
HTTP 200 OK Content-Type: application/json Vary: Accept Allow: GET, POST, HEAD, OPTIONS [ { "id": 353, "name": "ci-slave13-scc.fuel-infra.org", "location": { "name": "Moscow", "fact": "msk" }, "type": { "name": "HW Server" }, "labels": [], "attributes": { "zabbix_host_id": "10586", "puppet_manifests_version": "$Id: 705d0793d2b22d879ec5132c9148685976c68dac $", "fqdn": "ci-slave13-scc.fuel-infra.org", "hardware": "" }, "responsible": [] }, ... ]
Query Parameters: - sort – one of
id
,-id
- name – object name
- responsible – responsible user id
- location__fact – location fact
- type__name – type name
- sort – one of
-
POST
/api/v2/objects/
¶ Create inventory object.
Example request:
POST /api/v2/objects/ HTTP/1.1 { "attributes": { "fqdn": "myhost.local", "zabbix_host_id": "11235" }, "labels": [], "location": null, "name": "myhost.local", "responsible": [], "type": null }
Example response:
HTTP/1.1 200 OK { "attributes": { "fqdn": "myhost.local", "zabbix_host_id": "11235" }, "labels": [], "location": null, "name": "myhost.local", "responsible": [], "type": null }
-
PUT
/api/v2/objects/
(int: id)/
¶ Example request:
PUT /api/v2/objects/ HTTP/1.1 { "attributes": { "fqdn": "myhost.local", "zabbix_host_id": "11235" }, "id": 1, "labels": [], "location": null, "name": "myhost.local", "responsible": [], "type": null }
Example response:
HTTP/1.1 200 OK { "attributes": { "fqdn": "myhost.local", "zabbix_host_id": "11235" }, "id": 1, "labels": [], "location": null, "name": "myhost.local", "responsible": [], "type": null }
-
PATCH
/api/v2/objects/
(int: id)/
¶ Example request:
PATCH /api/v2/objects/1/ HTTP/1.1 { "location": {"fact": "newfact"}, "type": {"name": "newtype"}, }
Example response:
HTTP/1.1 200 OK { "attributes": { "fqdn": "myhost.local", "zabbix_host_id": "11235" }, "id": 1, "labels": [], "location": {"name": null, "fact": "newfact"}, "name": "myhost.local", "responsible": [], "type": {"name": "newtype"} }
-
DELETE
/api/v2/objects/
(int: id)/
¶ Example request:
DELETE /api/v2/objects/ HTTP/1.1
Example response:
HTTP/1.1 204 No Content