esx health hosts status: check
Check the host status against the given spec. This operation was added in vSphere API 7.0.1.0.
Request:
HTTP request
POST https://{server}/api/esx/health/hosts/{host}/status
?action=check
?action=check
{
"spec" : {
"exclude_checks" : [
"obj-103",
"obj-103"
],
"target_spec" : {
"state_changes" : {
"obj-103" : "INSTALL"
}
},
"perspective" : "BEFORE_ENTER_MAINTENANCE",
"maintenance_mode_type" : "string"
}
}
"spec" : {
"exclude_checks" : [
"obj-103",
"obj-103"
],
"target_spec" : {
"state_changes" : {
"obj-103" : "INSTALL"
}
},
"perspective" : "BEFORE_ENTER_MAINTENANCE",
"maintenance_mode_type" : "string"
}
}
Path Parameters
Name | Type | Description |
---|---|---|
Required | ||
host | string | The ID of the host to which the health query is related. |
Body Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
-.spec | check_spec | Specifies the context in which the check needs to be performed. |
-.spec.perspective | string | The host-level perspective for the health query. This attribute was added in vSphere API 7.0.1.0. The available host-level health perspectives. A perspective represents specific state transitions in the host's lifecycle. Health checks that are part of a given perspective should evaluate whether the host can proceed to the next state in its lifecycle without this resulting in service health degradation. Typically, a host goes through the following steps during its lifecycle: - The host is hosting workloads, for example there are powered-on VMs and the host is an active vSAN node. - The host is entered into maintenance mode. - The host is remediated. - The host exits maintenance mode. - The host starts hosting workloads again. This enumeration was added in vSphere API 7.0.1.0. Value is one of: BEFORE_ENTER_MAINTENANCE: A health perspective related to the host being ready to be put into maintenance mode. Checking the health status for this perspective when the host is already in maintenance mode always returns @{link Status#OK}. This constant was added in vSphere API 7.0.1.0. BEFORE_MODIFICATION: Health perspective for before modification of the desired state on the host is started. Health checks for this perspective should be about whether the host can safely transition from its current state to its target state. This constant was added in vSphere API 7.0.1.0. AFTER_MODIFICATION: Health perspective for after modification of the desired state on the host has completed. Health checks for this perspective should check the host health after the state changes to make sure that the new state does not degrade service health. This constant was added in vSphere API 7.0.1.0. BEFORE_EXIT_MAINTENANCE: A health perspective for the host being ready to exit maintenance mode. Checking the health status for this perspective when the host is not in maintenance mode always returns @{link Status#OK}. This constant was added in vSphere API 7.0.1.0. FINALIZE: A health perspective for final checks before it is considered that the host has reached its desired state successfully. This constant was added in vSphere API 7.0.1.0. |
-.spec.target_spec | target_spec | The target desired specification. This attribute was added in vSphere API 7.0.1.0. Optional. If unset no desired specification changes will occur. |
-.spec.target_spec.state_changes | object | The software state change for each solution. Captures the overall changes to the software of a HOST. If a SOLUTION is not present in the mapping, its software will not be changed in the current remediation. This attribute was added in vSphere API 7.0.1.0. 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.esx.health.solution . 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.esx.health.solution .Object with element values of type string. |
-.spec.target_spec.state_changes.* | string | The action that will be taken on a solution's software as part of the on-going remediation. This enumeration was added in vSphere API 7.0.1.0. Value is one of: INSTALL: The software of the Solution is being installed. This constant was added in vSphere API 7.0.1.0. UPGRADE: The software of the Solution is being upgraded. This constant was added in vSphere API 7.0.1.0. DELETE: The Solution is being deleted. This constant was added in vSphere API 7.0.1.0. |
-.spec.maintenance_mode_type | string | The maintenance mode type that the host is about to enter or exit. The supported values are defined in the vmodl1 definition of vim.host.ServiceModeId. This parameter is valid only for the BEFORE_ENTER_MAINTENANCE and BEFORE_EXIT_MAINTENANCE perspectives. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. Optional. It is only relevant when perspective has value [BEFORE_ENTER_MAINTENANCE, BEFORE_EXIT_MAINTENANCE]. if unset, full maintenance mode is assumed. |
-.spec.exclude_checks | string[] | The set of IDs of the health checks that should not be considered in the overall health status. This attribute was added in vSphere API 7.0.1.0. When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.esx.health.check . When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.esx.health.check . |
Response:
HTTP Status Code: 200
Response Body Structure:
{
"wait_duration" : 1,
"status" : "OK",
"check_statuses" : [
{
"wait_duration" : 1,
"issues" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
}
],
"info" : {
"name" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"description" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"check" : "obj-103"
},
"status" : "OK"
},
{
"wait_duration" : 1,
"issues" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
}
],
"info" : {
"name" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"description" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"check" : "obj-103"
},
"status" : "OK"
}
]
}
"wait_duration" : 1,
"status" : "OK",
"check_statuses" : [
{
"wait_duration" : 1,
"issues" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
}
],
"info" : {
"name" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"description" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"check" : "obj-103"
},
"status" : "OK"
},
{
"wait_duration" : 1,
"issues" : [
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
{
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
}
],
"info" : {
"name" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"description" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {
"<string>" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : {}
}
}
}
}
}
}
},
"check" : "obj-103"
},
"status" : "OK"
}
]
}
Headers:
NoneType:
Name | Type | Description |
---|---|---|
bold = required | ||
- | status_info | The status of the health query in respect to the given input spec. |
-.status | string | Aggregated status from all Checks, which are part of this entity. Represents system status of a particular check. Value is one of: OK: The check is successful, i.e. the entity can transition to the target state. WAIT: The check is still running. Check the {#member CheckStatus.waitDuration} to see the expected wait time. NOT_OK: The check has failed, i.e. the entity is not ready to transition to the target state. Any reported issues in the {#member CheckStatus.issues} field need to resolved. |
-.wait_duration | long | If status value is WAIT the duration in miliseconds to wait before issuing status check again. Optional. It is only relevant when status has value WAIT. This field is optional and it is only relevant when the value of status is WAIT. |
-.check_statuses | check_status[] | List of CheckStatus objects for all Checks, which were executed and did NOT return an OK Status. |
-.check_statuses[].info | check_info | Information about the check. |
-.check_statuses[].info.check | string | The check ID. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.esx.health.check . When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.esx.health.check . |
-.check_statuses[].info.name | localizable_message | The check name. |
-.check_statuses[].info.name.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. |
-.check_statuses[].info.name.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. |
-.check_statuses[].info.name.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. |
Errors:
HTTP Status Code | Type | Description |
---|---|---|
404 | not_found | If the host is not found. |
401 | unauthenticated | if the caller is not authenticated. |
403 | unauthorized | If the caller does not have the necessary privileges. |