Class JobsClient (2.22.0)

Cloud Run Job Control Plane API.

Equality

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.

Constructors

JobsClient(JobsClient const &)

Copy and move support

Parameter
NameDescription
JobsClient const &

JobsClient(JobsClient &&)

Copy and move support

Parameter
NameDescription
JobsClient &&

JobsClient(std::shared_ptr< JobsConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< JobsConnection >
opts Options

Operators

operator=(JobsClient const &)

Copy and move support

Parameter
NameDescription
JobsClient const &
Returns
TypeDescription
JobsClient &

operator=(JobsClient &&)

Copy and move support

Parameter
NameDescription
JobsClient &&
Returns
TypeDescription
JobsClient &

Functions

CreateJob(std::string const &, google::cloud::run::v2::Job const &, std::string const &, Options)

Creates a Job.

Parameters
NameDescription
parent std::string const &

Required. The location and project in which this Job should be created. Format: projects/{project}/locations/{location}, where {project} can be project id or number.

job google::cloud::run::v2::Job const &

Required. The Job instance to create.

job_id std::string const &

Required. The unique identifier for the Job. The name of the job becomes {parent}/jobs/{job_id}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::run::v2::Job > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Job proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateJob(google::cloud::run::v2::CreateJobRequest const &, Options)

Creates a Job.

Parameters
NameDescription
request google::cloud::run::v2::CreateJobRequest const &

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.run.v2.CreateJobRequest. 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
TypeDescription
future< StatusOr< google::cloud::run::v2::Job > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Job proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetJob(std::string const &, Options)

Gets information about a Job.

Parameters
NameDescription
name std::string const &

Required. The full name of the Job. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::run::v2::Job >

the result of the RPC. The response message type (google.cloud.run.v2.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetJob(google::cloud::run::v2::GetJobRequest const &, Options)

Gets information about a Job.

Parameters
NameDescription
request google::cloud::run::v2::GetJobRequest const &

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.run.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.

Returns
TypeDescription
StatusOr< google::cloud::run::v2::Job >

the result of the RPC. The response message type (google.cloud.run.v2.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListJobs(std::string const &, Options)

Lists Jobs.

Parameters
NameDescription
parent std::string const &

Required. The location and project to list resources on. Format: projects/{project}/locations/{location}, where {project} can be project id or number.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::run::v2::Job >

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.run.v2.Job, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListJobs(google::cloud::run::v2::ListJobsRequest, Options)

Lists Jobs.

Parameters
NameDescription
request google::cloud::run::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.run.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.

Returns
TypeDescription
StreamRange< google::cloud::run::v2::Job >

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.run.v2.Job, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

UpdateJob(google::cloud::run::v2::Job const &, Options)

Updates a Job.

Parameters
NameDescription
job google::cloud::run::v2::Job const &

Required. The Job to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::run::v2::Job > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Job proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateJob(google::cloud::run::v2::UpdateJobRequest const &, Options)

Updates a Job.

Parameters
NameDescription
request google::cloud::run::v2::UpdateJobRequest const &

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.run.v2.UpdateJobRequest. 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
TypeDescription
future< StatusOr< google::cloud::run::v2::Job > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Job proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteJob(std::string const &, Options)

Deletes a Job.

Parameters
NameDescription
name std::string const &

Required. The full name of the Job. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::run::v2::Job > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Job proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteJob(google::cloud::run::v2::DeleteJobRequest const &, Options)

Deletes a Job.

Parameters
NameDescription
request google::cloud::run::v2::DeleteJobRequest const &

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.run.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
TypeDescription
future< StatusOr< google::cloud::run::v2::Job > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Job proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RunJob(std::string const &, Options)

Triggers creation of a new Execution of this Job.

Parameters
NameDescription
name std::string const &

Required. The full name of the Job. Format: projects/{project}/locations/{location}/jobs/{job}, where {project} can be project id or number.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::run::v2::Execution > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Execution proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RunJob(google::cloud::run::v2::RunJobRequest const &, Options)

Triggers creation of a new Execution of this Job.

Parameters
NameDescription
request google::cloud::run::v2::RunJobRequest const &

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.run.v2.RunJobRequest. 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
TypeDescription
future< StatusOr< google::cloud::run::v2::Execution > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.run.v2.Execution proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)

Gets the IAM Access Control policy currently in effect for the given Job.

This result does not include any inherited policies.

Parameters
NameDescription
request google::iam::v1::GetIamPolicyRequest const &

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.iam.v1.GetIamPolicyRequest. 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
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)

Sets the IAM Access control policy for the specified Job.

Overwrites any existing policy.

Parameters
NameDescription
request google::iam::v1::SetIamPolicyRequest const &

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.iam.v1.SetIamPolicyRequest. 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
TypeDescription
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)

Returns permissions that a caller has on the specified Project.

There are no permissions required for making this API call.

Parameters
NameDescription
request google::iam::v1::TestIamPermissionsRequest const &

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.iam.v1.TestIamPermissionsRequest. 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
TypeDescription
StatusOr< google::iam::v1::TestIamPermissionsResponse >

the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.