Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
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.
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.CancelJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
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.
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.GetJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
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.
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.InsertJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.DeleteJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
Returns
Type
Description
Status
a Status object. If the request failed, the status contains the details of the failure.
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.
Parameters
Name
Description
request
google::cloud::bigquery::v2::ListJobsRequest
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.ListJobsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.bigquery.v2.ListFormatJob, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.GetQueryResultsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.bigquery.v2.PostQueryRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
opts
Options
Optional. Override the class-level options, such as retry and backoff policies.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eJobServiceClient\u003c/code\u003e is \u003ccode\u003e2.37.0-rc\u003c/code\u003e, with multiple previous versions available, including the current version \u003ccode\u003e2.35.0\u003c/code\u003e which is the documented version on this page.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eJobServiceClient\u003c/code\u003e instances created via copy-construction or copy-assignment always compare equal and share the same underlying resources, making these operations efficient, whereas new instances are expensive because they establish new connections.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides methods to manage BigQuery jobs, such as \u003ccode\u003eCancelJob\u003c/code\u003e, \u003ccode\u003eGetJob\u003c/code\u003e, \u003ccode\u003eInsertJob\u003c/code\u003e, \u003ccode\u003eDeleteJob\u003c/code\u003e, \u003ccode\u003eListJobs\u003c/code\u003e, \u003ccode\u003eGetQueryResults\u003c/code\u003e, and \u003ccode\u003eQuery\u003c/code\u003e, each with specific request and response types.\u003c/p\u003e\n"],["\u003cp\u003eConcurrent access to different instances of \u003ccode\u003eJobServiceClient\u003c/code\u003e is safe, but operating on the same instance from multiple threads is not guaranteed to work, so copying the object may be safer for multi-threaded use.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eListJobs\u003c/code\u003e function returns a \u003ccode\u003eStreamRange\u003c/code\u003e to iterate over the results, handling potential failures during iteration and providing access to a list of jobs.\u003c/p\u003e\n"]]],[],null,["# Class JobServiceClient (2.35.0)\n\nVersion 2.35.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/bigquerycontrol/latest/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.41.0](/cpp/docs/reference/bigquerycontrol/2.41.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.40.0](/cpp/docs/reference/bigquerycontrol/2.40.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.39.0](/cpp/docs/reference/bigquerycontrol/2.39.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.38.0](/cpp/docs/reference/bigquerycontrol/2.38.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.37.0](/cpp/docs/reference/bigquerycontrol/2.37.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.36.0](/cpp/docs/reference/bigquerycontrol/2.36.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.35.0](/cpp/docs/reference/bigquerycontrol/2.35.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.34.0](/cpp/docs/reference/bigquerycontrol/2.34.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.33.0](/cpp/docs/reference/bigquerycontrol/2.33.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.32.0](/cpp/docs/reference/bigquerycontrol/2.32.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.31.0](/cpp/docs/reference/bigquerycontrol/2.31.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.30.0](/cpp/docs/reference/bigquerycontrol/2.30.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.29.0](/cpp/docs/reference/bigquerycontrol/2.29.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.28.0](/cpp/docs/reference/bigquerycontrol/2.28.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient)\n- [2.27.0](/cpp/docs/reference/bigquerycontrol/2.27.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient) \n[JobServiceClient](/cpp/docs/reference/bigquerycontrol/2.35.0/classgoogle_1_1cloud_1_1bigquerycontrol__v2_1_1JobServiceClient). \n\n###### Equality\n\nInstances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal `std::shared_ptr\u003c*Connection\u003e` objects compare equal. Objects that compare equal share the same underlying resources.\n\n###### Performance\n\nCreating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.\n\n###### Thread Safety\n\nConcurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.\n\nConstructors\n------------\n\n### JobServiceClient(JobServiceClient const \\&)\n\nCopy and move support\n\n### JobServiceClient(JobServiceClient \\&\\&)\n\nCopy and move support\n\n### JobServiceClient(std::shared_ptr\\\u003c JobServiceConnection \\\u003e, Options)\n\nOperators\n---------\n\n### operator=(JobServiceClient const \\&)\n\nCopy and move support\n\n### operator=(JobServiceClient \\&\\&)\n\nCopy and move support\n\nFunctions\n---------\n\n### CancelJob(google::cloud::bigquery::v2::CancelJobRequest const \\&, Options)\n\nRequests that a job be cancelled. \nThis 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.\n\n### GetJob(google::cloud::bigquery::v2::GetJobRequest const \\&, Options)\n\nReturns information about a specific job. \nJob 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.\n\n### InsertJob(google::cloud::bigquery::v2::InsertJobRequest const \\&, Options)\n\nStarts a new asynchronous job. \nThis API has two different kinds of endpoint URIs, as this method supports a variety of use cases.\n\n- The *Metadata* URI is used for most interactions, as it accepts the job configuration directly.\n- 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.\n\n### DeleteJob(google::cloud::bigquery::v2::DeleteJobRequest const \\&, Options)\n\nRequests the deletion of the metadata of a job. \nThis call returns when the job's metadata is deleted.\n\n### ListJobs(google::cloud::bigquery::v2::ListJobsRequest, Options)\n\nLists all jobs that you started in the specified project. \nJob 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.\n\n### GetQueryResults(google::cloud::bigquery::v2::GetQueryResultsRequest const \\&, Options)\n\nRPC to get the results of a query job.\n\n### Query(google::cloud::bigquery::v2::PostQueryRequest const \\&, Options)\n\nRuns a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout."]]