The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.
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
CloudSchedulerClient(CloudSchedulerClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
CloudSchedulerClient const &
|
CloudSchedulerClient(CloudSchedulerClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
CloudSchedulerClient &&
|
CloudSchedulerClient(std::shared_ptr< CloudSchedulerConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< CloudSchedulerConnection >
|
opts |
Options
|
Operators
operator=(CloudSchedulerClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
CloudSchedulerClient const &
|
Returns | |
---|---|
Type | Description |
CloudSchedulerClient & |
operator=(CloudSchedulerClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
CloudSchedulerClient &&
|
Returns | |
---|---|
Type | Description |
CloudSchedulerClient & |
Functions
ListJobs(std::string const &, Options)
Lists jobs.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The location name. For example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::scheduler::v1::Job > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListJobs(google::cloud::scheduler::v1::ListJobsRequest, Options)
Lists jobs.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::ListJobsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::scheduler::v1::Job > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetJob(std::string const &, Options)
Gets a job.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The job name. For example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetJob(google::cloud::scheduler::v1::GetJobRequest const &, Options)
Gets a job.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::GetJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateJob(std::string const &, google::cloud::scheduler::v1::Job const &, Options)
Creates a job.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The location name. For example: |
job |
google::cloud::scheduler::v1::Job const &
Required. The job to add. The user can optionally specify a name for the job in name. name cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned (name) in the response. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateJob(google::cloud::scheduler::v1::CreateJobRequest const &, Options)
Creates a job.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::CreateJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateJob(google::cloud::scheduler::v1::Job const &, google::protobuf::FieldMask const &, Options)
Updates a job.
If successful, the updated Job is returned. If the job does not exist, NOT_FOUND
is returned.
If UpdateJob does not successfully return, it is possible for the job to be in an Job.State.UPDATE_FAILED state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.
Parameters | |
---|---|
Name | Description |
job |
google::cloud::scheduler::v1::Job const &
Required. The new job properties. name must be specified. |
update_mask |
google::protobuf::FieldMask const &
A mask used to specify which fields of the job are being updated. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateJob(google::cloud::scheduler::v1::UpdateJobRequest const &, Options)
Updates a job.
If successful, the updated Job is returned. If the job does not exist, NOT_FOUND
is returned.
If UpdateJob does not successfully return, it is possible for the job to be in an Job.State.UPDATE_FAILED state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::UpdateJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteJob(std::string const &, Options)
Deletes a job.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The job name. For example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteJob(google::cloud::scheduler::v1::DeleteJobRequest const &, Options)
Deletes a job.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::DeleteJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
PauseJob(std::string const &, Options)
Pauses a job.
If a job is paused then the system will stop executing the job until it is re-enabled via ResumeJob. The state of the job is stored in state; if paused it will be set to Job.State.PAUSED. A job must be in Job.State.ENABLED to be paused.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The job name. For example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
PauseJob(google::cloud::scheduler::v1::PauseJobRequest const &, Options)
Pauses a job.
If a job is paused then the system will stop executing the job until it is re-enabled via ResumeJob. The state of the job is stored in state; if paused it will be set to Job.State.PAUSED. A job must be in Job.State.ENABLED to be paused.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::PauseJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ResumeJob(std::string const &, Options)
Resume a job.
This method reenables a job after it has been Job.State.PAUSED. The state of a job is stored in Job.state; after calling this method it will be set to Job.State.ENABLED. A job must be in Job.State.PAUSED to be resumed.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The job name. For example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ResumeJob(google::cloud::scheduler::v1::ResumeJobRequest const &, Options)
Resume a job.
This method reenables a job after it has been Job.State.PAUSED. The state of a job is stored in Job.state; after calling this method it will be set to Job.State.ENABLED. A job must be in Job.State.PAUSED to be resumed.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::ResumeJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
RunJob(std::string const &, Options)
Forces a job to run now.
When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The job name. For example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
RunJob(google::cloud::scheduler::v1::RunJobRequest const &, Options)
Forces a job to run now.
When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::scheduler::v1::RunJobRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::scheduler::v1::Job > |
the result of the RPC. The response message type (google.cloud.scheduler.v1.Job) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |