list method

Future<ListExecutionsResponse> list(
  1. String parent, {
  2. String? filter,
  3. String? orderBy,
  4. int? pageSize,
  5. String? pageToken,
  6. String? view,
  7. String? $fields,
})

Returns a list of executions which belong to the workflow with the given name.

The method returns executions of all workflow revisions. Returned executions are ordered by their start time (newest first).

Request parameters:

parent - Required. Name of the workflow for which the executions should be listed. Format: projects/{project}/locations/{location}/workflows/{workflow} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/workflows/\[^/\]+$.

filter - Optional. Filters applied to the [Executions.ListExecutions] results. The following fields are supported for filtering: executionId, state, createTime, startTime, endTime, duration, workflowRevisionId, stepName, and label. For details, see AIP-160. For more information, see Filter executions. For example, if you are using the Google APIs Explorer: state="SUCCEEDED" or startTime>"2023-08-01" AND state="FAILED"

orderBy - Optional. Comma-separated list of fields that specify the ordering applied to the [Executions.ListExecutions] results. By default the ordering is based on descending createTime. The following fields are supported for ordering: executionId, state, createTime, startTime, endTime, duration, and workflowRevisionId. For details, see AIP-132.

pageSize - Maximum number of executions to return per call. Max supported value depends on the selected Execution view: it's 1000 for BASIC and 100 for FULL. The default value used if the field is not specified is 100, regardless of the selected view. Values greater than the max value will be coerced down to it.

pageToken - A page token, received from a previous ListExecutions call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListExecutions must match the call that provided the page token. Note that pagination is applied to dynamic data. The list of executions returned can change between page requests.

view - Optional. A view defining which fields should be filled in the returned executions. The API will default to the BASIC view. Possible string values are:

  • "EXECUTION_VIEW_UNSPECIFIED" : The default / unset value.
  • "BASIC" : Includes only basic metadata about the execution. The following fields are returned: name, start_time, end_time, duration, state, and workflow_revision_id.
  • "FULL" : Includes all data.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListExecutionsResponse.

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<ListExecutionsResponse> list(
  core.String parent, {
  core.String? filter,
  core.String? orderBy,
  core.int? pageSize,
  core.String? pageToken,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (filter != null) 'filter': [filter],
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/executions';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListExecutionsResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}