vcenter vm storage policy compliance: check
Returns the storage policy Compliance vcenter.vm.storage.policy.compliance.info of a virtual machine after explicitly re-computing compliance check. This operation was added in vSphere API 6.7.
Request:
HTTP request
POST https://{server}/rest/vcenter/vm/{vm}/storage/policy/compliance?action=check
Path Parameters
Name | Type | Description |
---|---|---|
Required | ||
vm | string | Virtual machine identifier. |
Request Body Structure:
{
"check_spec" : {
"disks" : [
"obj-103",
"obj-103"
],
"vm_home" : true
}
}
"check_spec" : {
"disks" : [
"obj-103",
"obj-103"
],
"vm_home" : true
}
}
Request Body Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
check_spec | check_spec | Optional. Parameter specifies the entities on which storage policy compliance check is to be invoked. The storage compliance Info vcenter.vm.storage.policy.compliance.info is returned. |
check_spec.vm_home | boolean | Invoke compliance check on the virtual machine home directory if set to true. This attribute was added in vSphere API 6.7. |
check_spec.disks | string[] | Identifiers of the virtual machine's virtual disks for which compliance should be checked. This attribute was added in vSphere API 6.7. Optional. If unset or empty, compliance check is invoked on all the associated disks.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 . |
Response:
HTTP Status Code: 200
Representation:
{
"value" : {
"overall_compliance" : "COMPLIANT",
"disks" : [
{
"value" : {
"failure_cause" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
],
"status" : "COMPLIANT",
"check_time" : "2015-01-01T22:13:05.651Z",
"policy" : "obj-103"
},
"key" : "obj-103"
}
],
"vm_home" : {
"failure_cause" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
],
"status" : "COMPLIANT",
"check_time" : "2015-01-01T22:13:05.651Z",
"policy" : "obj-103"
}
}
}
"value" : {
"overall_compliance" : "COMPLIANT",
"disks" : [
{
"value" : {
"failure_cause" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
],
"status" : "COMPLIANT",
"check_time" : "2015-01-01T22:13:05.651Z",
"policy" : "obj-103"
},
"key" : "obj-103"
}
],
"vm_home" : {
"failure_cause" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
],
"status" : "COMPLIANT",
"check_time" : "2015-01-01T22:13:05.651Z",
"policy" : "obj-103"
}
}
}
Response Type:
Name | Type | Description |
---|---|---|
bold = required | ||
value | info | Optional. Virtual machine storage policy compliance info structure . |
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[] | Positional arguments to be substituted into the message template. This list will be empty if the message uses named arguments or has no arguments. |
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} |
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 necessary to complete the request. |
401 | unauthenticated | if the user cannot be authenticated. |
403 | unauthorized | if the user does not have the required privileges. |