Getting virtualized system instances with host view

Get instances under a specific virtualized system such as vCenter Server and Microsoft Hyper-V Server using the hostview mode.

Method and URI

To get information about all virtualized systems with the hostview filter, use

GET     https://{hostname|IP}/api/hypervisor/{hypervisorHypervisorId}/hostcontent

Tip

To get a {hypervisorHypervisorId} by hostname/IP, follow the instructions in Getting a {hypervisorHypervisorId}.

Parameters

Optionally, you may use the filter to specify a type of virtualized systems. If you do not use this parameter, you will get all the types of virtualized systems.

Key

Value

Type

Description

from

hlo

System Required

***

Data

None.

Example

Consider you have a virtualized system VMware - Dallas1 which is vCenter Server. You get the {hypervisorHypervisorId} of it: 1001. The Python script snippet below will give you a list of instances:

hypervisor_hypervisor_id = "1001"    # VMware - Dallas

_params = {"from": "hlo"}

requests.get('https://' + spp_ipv4 + '/api/hypervisor/'
    + hypervisor_hypervisor_id + '/hostcontent'
    headers={...}, params=_params, data="", verify=...)

The resposnse below with the HTTP status of 200 (OK) shows the list of all the virtualized systems. As you see there are vCenter Servers ("type": "vmware") and Microsoft Hyper-V Servers ("hyperv") in the same list.

{
    "links": {...},
    "total": 1,
    "contents": [
        {
            "links": {...},
            "name": "PS_SE-Datacenter",
            "type": "datacenter",
            "association": null,
            "protectionInfo": null,
            "recoveryInfo": null,
            "recoveryPoint": null,
            "siteId": null,
            "autoProvisionedsubPolicyName": null,
            "rbacPath": "root:0/hypervisor.all:0/hypervisor.type:vmware/hypervis
or:1001/vdc:717dafb25bbbca30d8dc72ed3cbf81f0",
            "rbacPathId": 3440,
            "extInfo": null,
            "location": "/vmware-dallas1.bluemachines.com.invalid",
            "metadataPath": "/MS:1001/DC:717dafb25bbbca30d8dc72ed3cbf81f0",
            "inHLO": true,
            "hypervisorType": "vmware",
            "hypervisorKey": "1001",
            "hypervisorManagementServerID": "1001",
            "nativeKey": "datacenter-2",
            "cloudType": null,
            "tags": [
                {
                    "name": "MGP Test2",
                    "key": "a3269bb10cfbe7a1588a5a3a5b3637de"
                }
            ],
            "tagCategories": [
                {
                    "name": "MGP-Test",
                    "key": "a6068ad43059b6b6fc3a0986ba7a0bed"
                }
            ],
            "metadataPathVmHost": null,
            "rbacPathVmHost": null,
            "rbacPathIdVmHost": null,
            "alternatePaths": [
                {
                    "rbacPath": "root:0/hypervisor.all:0/hypervisor.type:vmware/
hypervisor:1001/vtagcategory:a6068ad43059b6b6fc3a0986ba7a0bed/vtag:a3269bb10cfb
e7a1588a5a3a5b3637de/vdc:717dafb25bbbca30d8dc72ed3cbf81f0",
                    "rbacPathId": 3535,
                    "metadataPath": "/MS:1001/TAGCATEGORY:a6068ad43059b6b6fc3a09
86ba7a0bed/TAG:a3269bb10cfbe7a1588a5a3a5b3637de/DC:717dafb25bbbca30d8dc72ed3cbf
81f0"
                }
            ],
            "accountName": null,
            "hypervisorHostKey": null,
            "nativeObject": {},
            "windows": false,
            "volumes": [],
            "linux": false,
            "volumeId": null,
            "protected": false,
            "systemHold": false,
            "id": "717dafb25bbbca30d8dc72ed3cbf81f0",
            "resourceType": "datacenter",
            "storageProfiles": []
        }
    ]
}