List Tasks
If vSphere APIs begin with /rest (vs /api), any maps are consumed/returned instead as arrays of objects, each containing a key and a value property field.
Returns information about at most 1000 visible (subject to permission checks) tasks matching the Tasks.FilterSpec. All tasks must be in the same provider.
Request
URLURL
https://{api_host}/rest/cis/tasks
Query Parameters
Query Parameters
array
filter_spec.operations
Optional
Identifiers of operations. Tasks created by these operations match the filter (see CommonInfo.operation).
Note that an operation identifier by itself is not globally unique. To filter on an operation, the identifier of the service interface containing the operation should also be specified in Tasks.FilterSpec.services.
If unset or empty, tasks associated with any operation will match the filter.
When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.vapi.operation. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.vapi.operation.
array
filter_spec.services
Optional
Identifiers of services. Tasks created by operations in these services match the filter (see CommonInfo.service).
This field may be unset if Tasks.FilterSpec.tasks is specified. Currently all services must be from the same provider. If this field is unset or empty, tasks for any service will match the filter.
When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.vapi.service. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.vapi.service.
array
filter_spec.status
Optional
Status that a task must have to match the filter (see CommonInfo.status).
If unset or empty, tasks with any status match the filter.
array
filter_spec.targets
Optional
Identifiers of the targets the operation for the associated task created or was performed on (see CommonInfo.target).
If unset or empty, tasks associated with operations on any target match the filter.
array
filter_spec.tasks
Optional
Identifiers of tasks that can match the filter.
This field may be unset if Tasks.FilterSpec.services is specified. Currently all tasks must be from the same provider. If unset or empty, tasks with any identifier will match the filter.
When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.cis.task. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.cis.task.
array
filter_spec.users
Optional
Users who must have initiated the operation for the associated task to match the filter (see CommonInfo.user).
If unset or empty, tasks associated with operations initiated by any user match the filter.
boolean
result_spec.exclude_result
Optional
If true, the result will not be included in the task information, otherwise it will be included.
If unset, the result of the operation will be included in the task information.
boolean
result_spec.return_all
Optional
If true, all data, including operation-specific data, will be returned, otherwise only the data described in Info will be returned.
If unset, only the data described in Info will be returned.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, obtained by first calling Create Session API
Example: b00db39f948d13ea1e59b4d6fce56389
Response
Response
Response BodyResponse Body
200 OK returns
TasksListResponseBody
of type application/json
Map of task identifier to information about the task. The key in the result map will be an identifier for the resource type: com.vmware.cis.task.
{
"value": [
"string"
]
}
array of
string
value
Optional
Map of task identifier to information about the task. The key in the result map will be an identifier for the resource type: com.vmware.cis.task.
cURL Command
curl -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" https://{api_host}/rest/cis/tasks
Errors
404
com.vmware.vapi.std.errors.resource_inaccessible : if a task's state cannot be accessed or over 1000 tasks matching the Tasks.FilterSpec.
503
com.vmware.vapi.std.errors.service_unavailable : if the system is unable to communicate with a service to complete the request.
400
com.vmware.vapi.std.errors.invalid_argument : if any of the specified parameters are invalid.
401
com.vmware.vapi.std.errors.unauthenticated : if the user can not be authenticated. | com.vmware.vapi.std.errors.unauthorized : if the user doesn't have the required privileges.