Show / Hide Table of Contents

Class JobsResource

The "jobs" collection of methods.

Inheritance
object
JobsResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Bigquery.v2
Assembly: Google.Apis.Bigquery.v2.dll
Syntax
public class JobsResource

Constructors

JobsResource(IClientService)

Constructs a new resource.

Declaration
public JobsResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Cancel(string, string)

Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs. # IAM Permissions Requires the bigquery.jobs.update permission on the job resource. If the user matches the creator of the job, the bigquery.jobs.create permission on the project is required instead.

Declaration
public virtual JobsResource.CancelRequest Cancel(string projectId, string jobId)
Parameters
Type Name Description
string projectId

Required. Project ID of the job to cancel

string jobId

Required. Job ID of the job to cancel

Returns
Type Description
JobsResource.CancelRequest

Delete(string, string)

Requests the deletion of the metadata of a job. This call returns when the job's metadata is deleted. # IAM Permissions Requires the bigquery.jobs.delete permission on the job resource.

Declaration
public virtual JobsResource.DeleteRequest Delete(string projectId, string jobId)
Parameters
Type Name Description
string projectId

Required. Project ID of the job for which metadata is to be deleted.

string jobId

Required. Job ID of the job for which metadata is to be deleted. If this is a parent job which has child jobs, the metadata from all child jobs will be deleted as well. Direct deletion of the metadata of child jobs is not allowed.

Returns
Type Description
JobsResource.DeleteRequest

Get(string, string)

Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role. # IAM Permissions Requires the bigquery.jobs.get permission on the job resource. If the user matches the creator of the job, the bigquery.jobs.create permission on the project is required instead.

Declaration
public virtual JobsResource.GetRequest Get(string projectId, string jobId)
Parameters
Type Name Description
string projectId

Required. Project ID of the requested job.

string jobId

Required. Job ID of the requested job.

Returns
Type Description
JobsResource.GetRequest

GetQueryResults(string, string)

RPC to get the results of a query job. # IAM Permissions Requires the following IAM permission(s) to use this method: - bigquery.jobs.get on the job. - bigquery.tables.getData on the destination table. If the user matches the creator of the job, the following IAM permission(s) are required instead: - bigquery.jobs.create on the project. - bigquery.tables.getData on the destination table.

Declaration
public virtual JobsResource.GetQueryResultsRequest GetQueryResults(string projectId, string jobId)
Parameters
Type Name Description
string projectId

Required. Project ID of the query job.

string jobId

Required. Job ID of the query job.

Returns
Type Description
JobsResource.GetQueryResultsRequest

Insert(Job, string)

Starts a new asynchronous job. This API has two different kinds of endpoint URIs, as this method supports a variety of use cases. * The Metadata URI is used for most interactions, as it accepts the job configuration directly. * The Upload URI is ONLY for the case when you're sending both a load job configuration and a data stream together. In this case, the Upload URI accepts the job configuration and the data as two distinct multipart MIME parts. # IAM Permissions Requires the bigquery.jobs.create permission on the project resource. Additional permissions are required depending on the job type: - Load, Export, and Copy jobs: Generally require data-level permissions such as bigquery.tables.export or access to external storage. - Query jobs: Permissions are dependent on the SQL statement. Complex queries (DDL, DCL) may require additional permissions to create reservations, modify IAM policies, or update project settings.

Declaration
public virtual JobsResource.InsertRequest Insert(Job body, string projectId)
Parameters
Type Name Description
Job body

The body of the request.

string projectId

Project ID of project that will be billed for the job.

Returns
Type Description
JobsResource.InsertRequest

Insert(Job, string, Stream, string)

Starts a new asynchronous job. This API has two different kinds of endpoint URIs, as this method supports a variety of use cases. * The Metadata URI is used for most interactions, as it accepts the job configuration directly. * The Upload URI is ONLY for the case when you're sending both a load job configuration and a data stream together. In this case, the Upload URI accepts the job configuration and the data as two distinct multipart MIME parts. # IAM Permissions Requires the bigquery.jobs.create permission on the project resource. Additional permissions are required depending on the job type: - Load, Export, and Copy jobs: Generally require data-level permissions such as bigquery.tables.export or access to external storage. - Query jobs: Permissions are dependent on the SQL statement. Complex queries (DDL, DCL) may require additional permissions to create reservations, modify IAM policies, or update project settings.

Declaration
public virtual JobsResource.InsertMediaUpload Insert(Job body, string projectId, Stream stream, string contentType)
Parameters
Type Name Description
Job body

The body of the request.

string projectId

Project ID of project that will be billed for the job.

Stream stream

The stream to upload. See remarks for further information.

string contentType

The content type of the stream to upload.

Returns
Type Description
JobsResource.InsertMediaUpload
Remarks

Considerations regarding stream:

  • If stream is seekable, then the stream position will be reset to 0 before reading commences. If stream is not seekable, then it will be read from its current position
  • Caller is responsible for maintaining the stream open until the upload is completed
  • Caller is responsible for closing the stream

List(string)

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.listAll permission can list all jobs with all metadata. - Users with the bigquery.jobs.list permission can list all jobs, but with redacted information for jobs they did not create.

Declaration
public virtual JobsResource.ListRequest List(string projectId)
Parameters
Type Name Description
string projectId

Project ID of the jobs to list.

Returns
Type Description
JobsResource.ListRequest

Query(QueryRequest, string)

Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. # IAM Permissions Requires the bigquery.jobs.create permission on the project resource. Data-level permissions are highly dependent on the SQL statement being executed. While standard queries require data access (such as bigquery.tables.getData), complex operations like DDL or DCL may require permissions to manage reservations, IAM policies, or project settings.

Declaration
public virtual JobsResource.QueryRequest Query(QueryRequest body, string projectId)
Parameters
Type Name Description
QueryRequest body

The body of the request.

string projectId

Required. Project ID of the query request.

Returns
Type Description
JobsResource.QueryRequest
In this article
Back to top Generated by DocFX