cis tasks: list
Returns information about at most 1000 visible (subject to permission checks) tasks matching the cis.tasks.filter_spec. All tasks must be in the same provider. This operation was added in vSphere API 6.7.1.
Request:
HTTP request
GET https://{server}/rest/cis/tasks
?result_spec.exclude_result=true
&result_spec.return_all=true
&filter_spec.operations.1=obj-103
&filter_spec.operations.2=obj-103
&filter_spec.services.1=obj-103
&filter_spec.services.2=obj-103
&filter_spec.targets.1.id=obj-103
&filter_spec.targets.1.type=string
&filter_spec.targets.2.id=obj-103
&filter_spec.targets.2.type=string
&filter_spec.tasks.1=obj-103
&filter_spec.tasks.2=obj-103
&filter_spec.users.1=string
&filter_spec.users.2=string
&filter_spec.status.1=PENDING
&filter_spec.status.2=PENDING
?result_spec.exclude_result=true
&result_spec.return_all=true
&filter_spec.operations.1=obj-103
&filter_spec.operations.2=obj-103
&filter_spec.services.1=obj-103
&filter_spec.services.2=obj-103
&filter_spec.targets.1.id=obj-103
&filter_spec.targets.1.type=string
&filter_spec.targets.2.id=obj-103
&filter_spec.targets.2.type=string
&filter_spec.tasks.1=obj-103
&filter_spec.tasks.2=obj-103
&filter_spec.users.1=string
&filter_spec.users.2=string
&filter_spec.status.1=PENDING
&filter_spec.status.2=PENDING
Request Query Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
filter_spec | filter_spec | Optional. Specification of matching tasks. |
filter_spec.tasks | string[] | Identifiers of tasks that can match the filter. This attribute was added in vSphere API 6.7.1. Optional. This field may be unset if 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 . |
filter_spec.services | string[] | Identifiers of services. Tasks created by operations in these services match the filter (see cis.task.common_info.service). This attribute was added in vSphere API 6.7.1. Optional. This field may be unset if 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 . |
filter_spec.operations | string[] | Identifiers of operations. Tasks created by these operations match the filter (see cis.task.common_info.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 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 . |
filter_spec.status | string[] | Status that a task must have to match the filter (see cis.task.common_info.status). This attribute was added in vSphere API 6.7.1. Optional. If unset or empty, tasks with any status match the filter. |
filter_spec.targets | dynamic_ID[] | Identifiers of the targets the operation for the associated task created or was performed on (see cis.task.common_info.target). This attribute was added in vSphere API 6.7.1. Optional. If unset or empty, tasks associated with operations on any target match the filter. |
filter_spec.targets[].type | string | The type of resource being identified (for example com.acme.Person ). Services that contain operations for creating and deleting resources typically contain a constant specifying the resource type for the resources being created and deleted. The API metamodel metadata services include a service that allows retrieving all the known resource types. |
filter_spec.targets[].id | string | The identifier for a resource whose type is specified by vapi.std.dynamic_ID.type. When clients pass a value of this structure as a parameter, the field type must contain the actual resource type. When operations return a value of this structure as a result, the field type will contain the actual resource type. |
filter_spec.users | string[] | Users who must have initiated the operation for the associated task to match the filter (see cis.task.common_info.user). This attribute was added in vSphere API 6.7.1. Optional. If unset or empty, tasks associated with operations initiated by any user match the filter. |
result_spec | get_spec | Optional. Specification of what to return for a task. |
result_spec.return_all | boolean | If true, all data, including operation-specific data, will be returned, otherwise only the data described in cis.task.info will be returned. This attribute was added in vSphere API 6.7.1. Optional. If unset, only the data described in cis.task.info will be returned. |
result_spec.exclude_result | boolean | If true, the result will not be included in the task information, otherwise it will be included. This attribute was added in vSphere API 6.7.1. Optional. If unset, the result of the operation will be included in the task information. |
Response:
HTTP Status Code: 200
Representation:
{
"value" : [
{
"value" : {
"parent" : "obj-103",
"cancelable" : true,
"end_time" : "2015-01-01T22:13:05.651Z",
"description" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
},
"error" : {},
"target" : {
"id" : "obj-103",
"type" : "string"
},
"result" : "opaque_string_value",
"start_time" : "2015-01-01T22:13:05.651Z",
"service" : "obj-103",
"progress" : {
"total" : 1,
"completed" : 1,
"message" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"operation" : "obj-103",
"user" : "string",
"status" : "PENDING"
},
"key" : "obj-103"
}
]
}
"value" : [
{
"value" : {
"parent" : "obj-103",
"cancelable" : true,
"end_time" : "2015-01-01T22:13:05.651Z",
"description" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
},
"error" : {},
"target" : {
"id" : "obj-103",
"type" : "string"
},
"result" : "opaque_string_value",
"start_time" : "2015-01-01T22:13:05.651Z",
"service" : "obj-103",
"progress" : {
"total" : 1,
"completed" : 1,
"message" : {
"args" : [
"string",
"string"
],
"default_message" : "string",
"localized" : "string",
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"value" : {
"dt" : "2015-01-01T22:13:05.651Z",
"s" : "string",
"d" : 1.5,
"precision" : 1,
"format" : "SHORT_DATE",
"i" : 1,
"l" : {
"id" : "string",
"params" : [
{
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"key" : "string"
}
]
}
},
"operation" : "obj-103",
"user" : "string",
"status" : "PENDING"
},
"key" : "obj-103"
}
]
}
Response Type:
Name | Type | Description |
---|---|---|
bold = required | ||
value | list | Map of task identifier to information about the task.List of {"key": string, "value": info} |
value[].key | string | |
value[].value | info | |
value[].value.progress | progress | Progress of the operation. This attribute was added in vSphere API 6.7. Optional. It is only relevant when status has value [RUNNING, BLOCKED, SUCCEEDED, FAILED]. This field is optional and it is only relevant when the value of #status is one of RUNNING, BLOCKED, SUCCEEDED, or FAILED. |
value[].value.progress.total | long | Total amount of the work for the operation. This attribute was added in vSphere API 6.7. |
value[].value.progress.completed | long | The amount of work completed for the operation. The value can only be incremented. This attribute was added in vSphere API 6.7. |
value[].value.progress.message | localizable_message | Message about the work progress. This attribute was added in vSphere API 6.7. |
value[].value.progress.message.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. |
value[].value.progress.message.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. |
value[].value.progress.message.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 |
---|---|---|
400 | invalid_argument | if any of the specified parameters are invalid. |
500 | resource_inaccessible | if a task's state cannot be accessed or over 1000 tasks matching the cis.tasks.filter_spec. |
503 | service_unavailable | if the system is unable to communicate with a service to complete the request. |
401 | unauthenticated | if the user can not be authenticated. |
403 | unauthorized | if the user doesn't have the required privileges. |