Skip to content
Alberto Gonzalez edited this page Jun 19, 2017 · 2 revisions

(GET)/inventory

Description

Get the inventory for the specified system, or the children of a specified inventory node.

Request

Syntax

GET /api/inventory/?sid={sid}
GET /api/inventory/{id}/?sid={sid}
GET /api/inventory/{id}/all/?sid={sid}
GET /api/inventory/{id}/children/?sid={sid}
Host: <server host name>
Accept: application/json
AuthToken: <authentication token returned from authenticate>

Parameters

Optional filters include:

Filter Description Example
?sid={sid} return only the inventory of the current system GET /inventory/?sid=1
?cid={cid} return inventory for current system's client GET /inventory/?cid=2
?appid={appid} return inventory for a particular application GET inventory/?appid=40
?instid={instid} return inventory for a particular instance GET inventory/?instid=11
?esx_uuid={esx_uuid} return inventory for VMWare ESX servers GET inventory/?esx_uuid=53d1a494-d663-a0e7-890b-003048bf47d4
?diskid={diskid} return inventory of disk for given VMware client GET inventory/?diskid=11
?key={key} return inventory of VMware client GET inventory/?key=2
/{id} return inventory starting at the defined node GET /inventory/1
  • | default is "all" inventory starting at this node | /{id}/all | return inventory starting at the defined node | GET /inventory/1/all /{id}/children | return only children of the defined node | GET /inventory/4/children &disks={disks} | return disks of VMs (1) or not (0) | GET /inventory/4/all?disks=1
  • | default is 0 (no disks) | ?grandclient={1 or 0} | return only copied assets (replicated grandclients) (1) or return only directly attached assets | GET /inventory/?grandclient=1
  • | default is 0 (directly attached clients) |

Response

200 success

Parameters

Index Value Type Returned
id node ID int always
name node name string always
hv hv type int always
  • | 0 = N/A |
  • | 1 = Xen-Server |
  • | 2 = N/A |
  • | 3 = VMware |
  • | 4 = Hyper-V | type | node type | int | always
  • | 0 = none |
  • | 1 = disk |
  • | 2 = VM |
  • | 3 = folder |
  • | 4 = resource pool |
  • | 5 = host |
  • | 6 = datacenter |
  • | 7 = environment |
  • | 8 = universe |
  • | 9 = cluster |
  • | 10 = vm template folder |
  • | 11 = tag |
  • | 12 = template |
  • | 13 = vApp |
  • | 14 = root folder |
  • | 15 = root tag |
  • | 16 = xen (N/A) |
  • | 17 = computer |
  • | 18 = vApp root |
  • | 19 = cdrom |
  • | 20 = nic |
  • | 21 = usb |
  • | 22 = snapshot |
  • | 23 = datastore |
  • | 24 = job (not used) |
  • | 25 = discovered vm |
  • | 26 = Windows server |
  • | 27 = Linux server |
  • | 99 = generic | nodes | direct children of this node | array or null if no children | always

Examples

Sample Request

GET /api/inventory/?sid=1
Host: <server host name>
Accept: application/json
AuthToken: 8a00sjerhterqerjlqkjlk443l4j56869h4f_)(fjdkasHHHHHkdal324

Sample Response

GET /inventory/?sid=1

{
    "inventory": [
        {
            "hv": 0,
            "id": "0_0",
            "name": "Appliances",
            "nodes": [
                {
                    "hv": 0,
                    "id": "1",
                    "name": "UEB-CentOS6-lmc",
                    "nodes": [
                        {
                            "hv": 1,
                            "id": "1_4",
                            "name": "lisa-dev",
                            "nodes": [],
                            "type": 17
                        },
                        {
                            "hv": 3,
                            "id": "1_2_40_510E309C-32F7-4C7F-899F-E3CCE07D33BC",
                            "name": "vCenter-lmc",
                            "nodes": [
                                {
                                    "hv": 3,
                                    "id": "1_2_40_510E309C-32F7-4C7F-899F-E3CCE07D33BC_resgroup-116",
                                    "name": "LisaTest",
                                    "nodes": [
                                        {
                                            "hv": 3,
                                            "id": "1_2_40_510E309C-32F7-4C7F-899F-E3CCE07D33BC_44",
                                            "name": "win7-lmc-restored",
                                            "nodes": [],
                                            "type": 2
                                        }
                                    ],
                                    "type": 4
                                },
                                {
                                    "hv": 3,
                                    "id": "1_2_40_510E309C-32F7-4C7F-899F-E3CCE07D33BC_22",
                                    "name": "centos6 lmc",
                                    "nodes": [],
                                    "type": 2
                                 }
                            ],
                            "type": 5
                        }
                    ],
                    "type": 6
                }
            ],
            "type": 8
        }
    ],
    "timestamp": 1412960954
}


Clone this wiki locally