Getting virtualized system instances with view filters¶
You can use view filters to filter the information about virtualized system instances. Use one of the following view filters:
View filter |
|
VMware |
Hyper-V |
Amazon EC2 |
---|---|---|---|---|
Tags |
|
x |
x |
|
Datastore |
|
x |
x |
|
Hosts and clusters |
|
x |
Method and URI¶
To get information about all virtualized systems with one of the view filters, use a GET method and a URI:
GET https://{hostname|IP}/api/hypervisor/{hypervisorHypervisorId}/{hypervisorView}
Tip
To get a {hypervisorHypervisorId}
based on the hostname or the IPv4 address, follow the instructions in Getting a {hypervisorHypervisorId}.
Data¶
None.
Example 1: Get information about virtualize system instances with the tag view filter¶
Assume that you added VMware vCenter Server: VMware - Dallas 1 ({hypervisorHypervisorId}
1001). A Python snippet that is similar to the following example can be used to request information about virtualized system instances with the tag view filter:
hypervisor_hypervisor_id = "1001" # VMware - Dallas
_params = {"from": "hlo"}
requests.get('https://' + spp_ipv4 + '/api/hypervisor/'
+ hypervisor_hypervisor_id + '/tagcontent',
headers={...}, params=_params, data="", verify=...)
The resposnse below with the HTTP status of 200 (OK) shows the list of all virtualized systems.
{
"links": {...},
"total": 2,
"contents": [
{
"links": {...},
"name": "All",
"type": "tagcategory",
"association": null,
"protectionInfo": null,
"recoveryInfo": null,
"recoveryPoint": null,
"siteId": null,
"autoProvisionedsubPolicyName": null,
"rbacPath": "root:0/hypervisor.all:0/hypervisor.type:vmware/hypervis
↪or:1001/vtagcategory:512150d081814f93e4deb6055d66bcf4",
"rbacPathId": 2,
"extInfo": null,
"location": "/DALLAS.BLUEMACHINES.com.invalid",
"metadataPath": "/MS:1001/TAGCATEGORY:512150d081814f93e4deb6055d66bc
↪f4",
"inHLO": true,
"hypervisorType": "vmware",
"hypervisorKey": "1001",
"hypervisorManagementServerID": "1001",
"nativeKey": "urn:vmomi:InventoryServiceCategory:24b74365-f672-4aac-
↪8862-0f733c5cf9de:GLOBAL",
"cloudType": null,
"tags": null,
"tagCategories": null,
"metadataPathVmHost": null,
"rbacPathVmHost": null,
"rbacPathIdVmHost": null,
"alternatePaths": null,
"description": "",
"cardinality": "MULTIPLE",
"associableTypes": [],
"nativeObject": {},
"hypervisorHostKey": null,
"windows": false,
"volumeId": null,
"linux": false,
"volumes": [],
"protected": false,
"systemHold": false,
"id": "512150d081814f93e4deb6055d66bcf4",
"resourceType": "tagcategory",
"storageProfiles": []
}
]
}
Example 2: Get information about virtualize system instances with the storage view filter¶
Assume that 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 + '/storagecontent',
headers={...}, params=_params, data="", verify=...)
The resposnse below with the HTTP status of 200 (OK) shows the list of instances under the virtualized system “VMware - Dallas1”, with the storage view filter.
{
"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": "/dallas.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": []
}
]
}
Example 3: Get information about virtualize system instances with the host view filter¶
Assume that 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 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": []
}
]
}