REST API - check-task

esx settings clusters software: check-task

Runs checks on the cluster before applying the desired software document across all hosts in the cluster. Checks if all hosts in the cluster are in a good state to be updated with the desired software document. If commit field is set it implies the minimum commit that the check operation should use, however if subsequent commits have been made to the desired state document the check operation will use the most recent desired state document. The result of this operation can be queried by calling the cis/tasks/{task-id} where the task-id is the response of this operation.

Request:

HTTP request

POST https://{server}/api/esx/settings/clusters/{cluster}/software

?action=check
&vmw-task=true
{
    "hosts"[
        "obj-103",
        "obj-103"
    ],
    "commit""obj-103"
}

Path Parameters

Name Type Description
Required
cluster string Identifier of the cluster.

Body Parameters:

Name Type Description
bold = required
- check_spec Check specification.
-.commit string The minimum commit identifier of the desired software document to be used during the check operation.

Optional. if unset or empty the check opertion will use the latest commit to fetch the desired state document.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.esx.settings.commit. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.esx.settings.commit.

-.hosts string[] The specific hosts for which checks need to be performed

Optional. if unset or empty checks are run for all hosts within the cluster.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: HostSystem. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: HostSystem.

Response:

HTTP Status Code: 202

Response Body Structure:

"obj-103"

Headers:

None

Type:

Name Type Description
bold = required
- string The results of all checks performed.

Errors:

HTTP Status Code Type Description
500 error If there is unknown internal error. The accompanying error message will give more details about the failure.
400 invalid_argument If the commit field of spec specifies an invalid commit, or the hosts field of spec specifies an invalid host or a host not part of the cluster.
400 not_allowed_in_current_state If there is another operation in progress or if the commit field of spec specifies a commit that has already been applied.
404 not_found If there is no cluster associated with cluster in the system.
503 service_unavailable If the service is not available.
500 timed_out If the operation times out.
401 unauthenticated If the caller is not authenticated.