Task Set Task State
Sets task state and optionally sets results or fault, as appropriate for state
Required privileges: Task.Update
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}.
The vSphere release schema. The current specification covers vSphere 9.1.0.0 APIs.
Show optional properties
{
"state": "string"
}
{
"state": "string",
"result": {
"_typeName": "string"
},
"fault": {
"_typeName": "string",
"faultCause": {
"_typeName": "string",
"faultCause": "MethodFault Object",
"faultMessage": [
{
"_typeName": "string",
"key": "string",
"arg": [
{
"_typeName": "string",
"key": "string",
"value": {
"_typeName": "string"
}
}
],
"message": "string"
}
]
},
"faultMessage": [
{
"_typeName": "string",
"key": "string",
"arg": [
{
"_typeName": "string",
"key": "string",
"value": {
"_typeName": "string"
}
}
],
"message": "string"
}
]
}
}
New state for task
Result to set, valid only if task state is TaskInfo.State.success
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.
No Content
InvalidState: If attempting to change states after task is completed or in error, or attempting to set the result or fault incorrectly
{
"_typeName": "string",
"faultCause": "MethodFault Object",
"faultMessage": [
{
"_typeName": "string",
"key": "string",
"arg": [
{
"_typeName": "string",
"key": "string",
"value": {
"_typeName": "string"
}
}
],
"message": "string"
}
]
}
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"state":"{}"}' https://{api_host}/sdk/vim25/{release}/Task/{moId}/SetTaskState