list method
List tasks.
Request parameters:
parent - Required. The namespace from which the tasks should be listed.
Replace {namespace} with the project ID or number. It takes the form
namespaces/{namespace}. For example: namespaces/PROJECT_ID
Value must have pattern ^namespaces/\[^/\]+$.
continue_ - Optional. Optional encoded string to continue paging.
fieldSelector - Optional. Not supported by Cloud Run.
includeUninitialized - Optional. Not supported by Cloud Run.
labelSelector - Optional. Allows to filter resources based on a label.
Supported operations are =, !=, exists, in, and notIn. For example, to
list all tasks of execution "foo" in succeeded state:
run.googleapis.com/execution=foo,run.googleapis.com/runningState=Succeeded.
Supported states are: * Pending: Initial state of all tasks. The task
has not yet started but eventually will. * Running: Container instances
for this task are running or will be running shortly. * Succeeded: No
more container instances to run for the task, and the last attempt
succeeded. * Failed: No more container instances to run for the task,
and the last attempt failed. This task has run out of retry attempts. *
Cancelled: Task was running but got stopped because its parent execution
has been aborted. * Abandoned: The task has not yet started and never
will because its parent execution has been aborted.
limit - Optional. The maximum number of records that should be returned.
resourceVersion - Optional. Not supported by Cloud Run.
watch - Optional. Not supported by Cloud Run.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ListTasksResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<ListTasksResponse> list(
core.String parent, {
core.String? continue_,
core.String? fieldSelector,
core.bool? includeUninitialized,
core.String? labelSelector,
core.int? limit,
core.String? resourceVersion,
core.bool? watch,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'continue': ?continue_ == null ? null : [continue_],
'fieldSelector': ?fieldSelector == null ? null : [fieldSelector],
'includeUninitialized': ?includeUninitialized == null
? null
: ['${includeUninitialized}'],
'labelSelector': ?labelSelector == null ? null : [labelSelector],
'limit': ?limit == null ? null : ['${limit}'],
'resourceVersion': ?resourceVersion == null ? null : [resourceVersion],
'watch': ?watch == null ? null : ['${watch}'],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'apis/run.googleapis.com/v1/' +
core.Uri.encodeFull('$parent') +
'/tasks';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListTasksResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}