vcenter vm storage policy compliance: get

Returns the cached storage policy compliance information of a virtual machine. This operation was added in vSphere API 6.7

Request:

HTTP request

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

Path Parameters

Name Type Description
Required
vm string Virtual machine identifier.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "disks"[
            {
                "key""obj-103",
                "value"{
                    "check_time""2015-01-01T22:13:05.651Z",
                    "failure_cause"[
                        {
                            "args"[
                                "string",
                                "string"
                            ],
                            "default_message""string",
                            "id""string"
                        },
                        {
                            "args"[
                                "string",
                                "string"
                            ],
                            "default_message""string",
                            "id""string"
                        }
                    ],
                    "policy""obj-103",
                    "status""COMPLIANT"
                }
            }
        ],
        "overall_compliance""COMPLIANT",
        "vm_home"{
            "check_time""2015-01-01T22:13:05.651Z",
            "failure_cause"[
                {
                    "args"[
                        "string",
                        "string"
                    ],
                    "default_message""string",
                    "id""string"
                },
                {
                    "args"[
                        "string",
                        "string"
                    ],
                    "default_message""string",
                    "id""string"
                }
            ],
            "policy""obj-103",
            "status""COMPLIANT"
        }
    }
}

Response Type:

Name Type Description
bold = required
value info Optional. Virtual machine storage policy compliance Info vcenter.vm.storage.policy.compliance.info.
value.overall_compliance string The overall compliance status of the virtual machine and all it's entities. This attribute was added in vSphere API 6.7

Defines the storage compliance status of a virtual machine and its applicable entities. This enumeration was added in vSphere API 6.7 Value is one of:
COMPLIANT: Entity is in compliance. This constant was added in vSphere API 6.7
NON_COMPLIANT: Entity is out of compliance. This constant was added in vSphere API 6.7
UNKNOWN_COMPLIANCE: Compliance status of the entity is not known. This constant was added in vSphere API 6.7
NOT_APPLICABLE: Compliance computation is not applicable for this entity because it does not have any storage requirements that apply to the datastore on which it is placed. This constant was added in vSphere API 6.7
OUT_OF_DATE: The Compliance status becomes out-of-date when the profile associated with the entity is edited but not applied. The compliance status remains out-of-date until the edited policy is applied to the entity. This constant was added in vSphere API 6.7

value.vm_home vm_compliance_info The storage policy compliance information vcenter.vm.storage.policy.compliance.vm_compliance_info for the virtual machine's home directory. This attribute was added in vSphere API 6.7

Optional. If unset the virtual machine home directory has no storage policy association.

value.vm_home.status string Status of the compliance operation. This attribute was added in vSphere API 6.7

Defines the storage compliance status of a virtual machine and its applicable entities. This enumeration was added in vSphere API 6.7 Value is one of:
COMPLIANT: Entity is in compliance. This constant was added in vSphere API 6.7
NON_COMPLIANT: Entity is out of compliance. This constant was added in vSphere API 6.7
UNKNOWN_COMPLIANCE: Compliance status of the entity is not known. This constant was added in vSphere API 6.7
NOT_APPLICABLE: Compliance computation is not applicable for this entity because it does not have any storage requirements that apply to the datastore on which it is placed. This constant was added in vSphere API 6.7
OUT_OF_DATE: The Compliance status becomes out-of-date when the profile associated with the entity is edited but not applied. The compliance status remains out-of-date until the edited policy is applied to the entity. This constant was added in vSphere API 6.7

value.vm_home.check_time date_time Date and time of the most recent compliance check. This attribute was added in vSphere API 6.7

value.vm_home.policy string Identifier of the storage policy associated with the virtual machine. This attribute was added in vSphere API 6.7

Optional. If unset SPBM is unable to retrieve or determine the associated policy, vcenter.vm.storage.policy.compliance.vm_compliance_info.failure_cause is set in such casses.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.StoragePolicy. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.StoragePolicy.

value.vm_home.failure_cause localizable_message[] The exception that caused the compliance check to fail. There can be more than one cause, since a policy can contain capabilities from multiple providers. If empty, it implies no failures while retrieving compliance. This attribute was added in vSphere API 6.7

value.vm_home.failure_cause[].id string Unique identifier of the localizable string or message template.

This identifier is typically used to retrieve a locale-specific string or message template from a message catalog.

value.vm_home.failure_cause[].default_message string The value of this localizable string or message template in the en_US (English) locale. If vapi.std.localizable_message.id refers to a message template, the default message will contain the substituted arguments. This value can be used by clients that do not need to display strings and messages in the native language of the user. It could also be used as a fallback if a client is unable to access the appropriate message catalog.

value.vm_home.failure_cause[].args string[] Arguments to be substituted into a message template.

value.disks list The compliance information vcenter.vm.storage.policy.compliance.vm_compliance_info for the virtual machine's virtual disks that are currently associated with a storage policy. This attribute was added in vSphere API 6.7

When clients pass a value of this structure as a parameter, the key in the field key/value pairs must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk. When operations return a value of this structure as a result, the key in the field key/value pairs will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk.List of {"key": string, "value": vm_compliance_info}

value.disks[].key string
value.disks[].value vm_compliance_info
value.disks[].value.status string Status of the compliance operation. This attribute was added in vSphere API 6.7

Defines the storage compliance status of a virtual machine and its applicable entities. This enumeration was added in vSphere API 6.7 Value is one of:
COMPLIANT: Entity is in compliance. This constant was added in vSphere API 6.7
NON_COMPLIANT: Entity is out of compliance. This constant was added in vSphere API 6.7
UNKNOWN_COMPLIANCE: Compliance status of the entity is not known. This constant was added in vSphere API 6.7
NOT_APPLICABLE: Compliance computation is not applicable for this entity because it does not have any storage requirements that apply to the datastore on which it is placed. This constant was added in vSphere API 6.7
OUT_OF_DATE: The Compliance status becomes out-of-date when the profile associated with the entity is edited but not applied. The compliance status remains out-of-date until the edited policy is applied to the entity. This constant was added in vSphere API 6.7

value.disks[].value.check_time date_time Date and time of the most recent compliance check. This attribute was added in vSphere API 6.7

value.disks[].value.policy string Identifier of the storage policy associated with the virtual machine. This attribute was added in vSphere API 6.7

Optional. If unset SPBM is unable to retrieve or determine the associated policy, vcenter.vm.storage.policy.compliance.vm_compliance_info.failure_cause is set in such casses.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.vcenter.StoragePolicy. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.vcenter.StoragePolicy.

value.disks[].value.failure_cause localizable_message[] The exception that caused the compliance check to fail. There can be more than one cause, since a policy can contain capabilities from multiple providers. If empty, it implies no failures while retrieving compliance. This attribute was added in vSphere API 6.7

value.disks[].value.failure_cause[].id string Unique identifier of the localizable string or message template.

This identifier is typically used to retrieve a locale-specific string or message template from a message catalog.

value.disks[].value.failure_cause[].default_message string The value of this localizable string or message template in the en_US (English) locale. If vapi.std.localizable_message.id refers to a message template, the default message will contain the substituted arguments. This value can be used by clients that do not need to display strings and messages in the native language of the user. It could also be used as a fallback if a client is unable to access the appropriate message catalog.

value.disks[].value.failure_cause[].args string[] Arguments to be substituted into a message template.

Errors:

HTTP Status Code Type Description
500 error if the system reports an error while responding to the request.
503 service_unavailable if the system is unable to communicate with a service to complete the request.
401 unauthenticated if the user cannot be authenticated.
403 unauthorized if the user does not have the required privileges.