Task Set Task State

Task Set Task State

Sets task state and optionally sets results or fault, as appropriate for state

Required privileges: Task.Update

Request
URI
POST
https://{api_host}/sdk/vim25/{release}/Task/{moId}/SetTaskState
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case Task/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.


Request Body
SetTaskStateRequestType of type(s) application/json
Required
"SetTaskStateRequestType Object"
state
Required

New state for task

result
Optional

Result to set, valid only if task state is TaskInfo.State.success

fault
Optional

Fault to set, valid only if task state is error. The fault must be a of a fault type that directly or indirectly extends VimFault.

Authentication
This operation uses the following authentication methods.
Responses
204

No Content

Operation doesn't return any data structure

500

InvalidState: If attempting to change states after task is completed or in error, or attempting to set the result or fault incorrectly

Returns InvalidState of type(s) application/json
"InvalidState Object"

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/Task/{moId}/SetTaskState