list method

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

Lists workloads in a Cloud Composer environment.

Workload is a unit that runs a single Composer component. This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Request parameters:

parent - Required. The environment name to get workloads for, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}" Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/environments/\[^/\]+$.

filter - Optional. The list filter. Currently only supports equality on the type field. The value of a field specified in the filter expression must be one ComposerWorkloadType enum option. It's possible to get multiple types using "OR" operator, e.g.: "type=SCHEDULER OR type=CELERY_WORKER". If not specified, all items are returned.

pageSize - Optional. The maximum number of environments to return.

pageToken - Optional. The next_page_token value returned from a previous List request, if any.

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

Completes with a ListWorkloadsResponse.

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

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

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