list method
Lists regions/{region}/jobs in a project.
Request parameters:
projectId
- Required. The ID of the Google Cloud Platform project that
the job belongs to.
region
- Required. The Dataproc region in which to handle the request.
clusterName
- Optional. If set, the returned jobs list includes only
jobs that were submitted to the named cluster.
filter
- Optional. A filter constraining the jobs to list. Filters are
case-sensitive and have the following syntax:field = value AND field =
value ...where field is status.state or labels.[KEY], and [KEY] is a
label key. value can be * to match all values. status.state can be either
ACTIVE or NON_ACTIVE. Only the logical AND operator is supported;
space-separated items are treated as having an implicit AND
operator.Example filter:status.state = ACTIVE AND labels.env = staging AND
labels.starred = *
jobStateMatcher
- Optional. Specifies enumerated categories of jobs to
list. (default = match ALL jobs).If filter is provided, jobStateMatcher
will be ignored.
Possible string values are:
- "ALL" : Match all jobs, regardless of state.
- "ACTIVE" : Only match jobs in non-terminal states: PENDING, RUNNING, or CANCEL_PENDING.
- "NON_ACTIVE" : Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
pageSize
- Optional. The number of results to return in each response.
pageToken
- Optional. The page token, returned by a previous call, to
request the next page of results.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListJobsResponse.
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<ListJobsResponse> list(
core.String projectId,
core.String region, {
core.String? clusterName,
core.String? filter,
core.String? jobStateMatcher,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (clusterName != null) 'clusterName': [clusterName],
if (filter != null) 'filter': [filter],
if (jobStateMatcher != null) 'jobStateMatcher': [jobStateMatcher],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/projects/' +
commons.escapeVariable('$projectId') +
'/regions/' +
commons.escapeVariable('$region') +
'/jobs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListJobsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}