REST API - list

vcenter storage policies VM: list

Returns information about the virtual machines and/or their virtual disks that are associated with the given storage policy. This operation was added in vSphere API 6.7.

Request:

HTTP request

GET https://{server}/rest/vcenter/storage/policies/{policy}/vm

Path Parameters

Name Type Description
Required
policy string storage policy identifier.

Response:

HTTP Status Code: 200

Representation:

{
    "value"[
        {
            "value"{
                "disks"[
                    "obj-103",
                    "obj-103"
                ],
                "vm_home"true
            },
            "key""obj-103"
        }
    ]
}

Response Type:

Name Type Description
bold = required
value list Information about the virtual machines and/or their virtual disks that are associated with the given storage policy.List of {"key": string, "value": info}
value[].key string
value[].value info
value[].value.vm_home boolean Flag to indicate whether or not the virtual machine home is associated with the given storage policy. This attribute was added in vSphere API 6.7.

value[].value.disks string[] List of the virtual disks that are associated with the given storage policy. This attribute was added in vSphere API 6.7.

When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.vcenter.vm.hardware.Disk. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.vcenter.vm.hardware.Disk.

Errors:

HTTP Status Code Type Description
404 not_found if there is no policy associated with policy in the system.
500 unable_to_allocate_resource if more than 1000 virtual machines are associated with the specified policy.
401 unauthenticated if the user cannot be authenticated.
503 service_unavailable if the system is unable to communicate with a service necessary to complete the request.
500 error if the backend server encounters some an error while processing the request.
403 unauthorized if the user does not have the required priveleges.