list method
Lists all jobs that you started in the specified project.
Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
Request parameters:
projectId
- Project ID of the jobs to list
allUsers
- Whether to display jobs owned by all users in the project.
Default false
maxCreationTime
- Max value for job creation time, in milliseconds since
the POSIX epoch. If set, only jobs created before or at this timestamp are
returned
maxResults
- Maximum number of results to return
minCreationTime
- Min value for job creation time, in milliseconds since
the POSIX epoch. If set, only jobs created after or at this timestamp are
returned
pageToken
- Page token, returned by a previous call, to request the next
page of results
parentJobId
- If set, retrieves only jobs whose parent is this job.
Otherwise, retrieves only jobs which have no parent
projection
- Restrict information returned to a set of selected fields
Possible string values are:
- "full" : Includes all job data
- "minimal" : Does not include the job configuration
stateFilter
- Filter for job state
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a JobList.
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<JobList> list(
core.String projectId, {
core.bool? allUsers,
core.String? maxCreationTime,
core.int? maxResults,
core.String? minCreationTime,
core.String? pageToken,
core.String? parentJobId,
core.String? projection,
core.List<core.String>? stateFilter,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (allUsers != null) 'allUsers': ['${allUsers}'],
if (maxCreationTime != null) 'maxCreationTime': [maxCreationTime],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (minCreationTime != null) 'minCreationTime': [minCreationTime],
if (pageToken != null) 'pageToken': [pageToken],
if (parentJobId != null) 'parentJobId': [parentJobId],
if (projection != null) 'projection': [projection],
if (stateFilter != null) 'stateFilter': stateFilter,
if ($fields != null) 'fields': [$fields],
};
final url_ = 'projects/' + commons.escapeVariable('$projectId') + '/jobs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return JobList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}