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. # IAM Permissions Requires no specific IAM permission(s) to use this method. Users are able to list the jobs they created. Additional access is granted based on the following permissions:
- Users with the
bigquery.jobs.listAllpermission can list all jobs with all metadata. - Users with thebigquery.jobs.listpermission can list all jobs, but with redacted information for jobs they did not create.
Request parameters:
projectId - Project ID of the jobs to list.
Value must have pattern ^\[^/\]+$.
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 - The maximum number of results to return in a single
response page. Leverage the page tokens to iterate through the entire
collection.
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, show only child jobs of the specified parent.
Otherwise, show all top-level jobs.
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>>{
'allUsers': ?allUsers == null ? null : ['${allUsers}'],
'maxCreationTime': ?maxCreationTime == null ? null : [maxCreationTime],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'minCreationTime': ?minCreationTime == null ? null : [minCreationTime],
'pageToken': ?pageToken == null ? null : [pageToken],
'parentJobId': ?parentJobId == null ? null : [parentJobId],
'projection': ?projection == null ? null : [projection],
'stateFilter': ?stateFilter,
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'projects/' + core.Uri.encodeFull('$projectId') + '/jobs';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return JobList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}