Package com.google.cloud.scheduler.v1beta1 (2.18.0)

A client to Cloud Scheduler API

The interfaces provided are listed below, along with usage samples.

CloudSchedulerClient

Service Description: The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

Sample for CloudSchedulerClient:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
   JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
   Job response = cloudSchedulerClient.getJob(name);
 }
 

Classes

AppEngineHttpTarget

App Engine target. The job will be pushed to a job handler by means of an HTTP request via an http_method such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP response code in the range [200 - 299]. Error 503 is considered an App Engine system error instead of an application error. Requests returning error 503 will be retried regardless of retry configuration and not counted against retry counts. Any other response code, or a failure to receive a response before the deadline, constitutes a failed attempt.

Protobuf type google.cloud.scheduler.v1beta1.AppEngineHttpTarget

AppEngineHttpTarget.Builder

App Engine target. The job will be pushed to a job handler by means of an HTTP request via an http_method such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP response code in the range [200 - 299]. Error 503 is considered an App Engine system error instead of an application error. Requests returning error 503 will be retried regardless of retry configuration and not counted against retry counts. Any other response code, or a failure to receive a response before the deadline, constitutes a failed attempt.

Protobuf type google.cloud.scheduler.v1beta1.AppEngineHttpTarget

AppEngineRouting

App Engine Routing. For more information about services, versions, and instances see An Overview of App Engine, Microservices Architecture on Google App Engine, App Engine Standard request routing, and App Engine Flex request routing.

Protobuf type google.cloud.scheduler.v1beta1.AppEngineRouting

AppEngineRouting.Builder

App Engine Routing. For more information about services, versions, and instances see An Overview of App Engine, Microservices Architecture on Google App Engine, App Engine Standard request routing, and App Engine Flex request routing.

Protobuf type google.cloud.scheduler.v1beta1.AppEngineRouting

CloudSchedulerClient

Service Description: The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
   JobName name = JobName.of("[PROJECT]", "[LOCATION]", "[JOB]");
   Job response = cloudSchedulerClient.getJob(name);
 }
 

Note: close() needs to be called on the CloudSchedulerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of CloudSchedulerSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudSchedulerSettings cloudSchedulerSettings =
     CloudSchedulerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create(cloudSchedulerSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudSchedulerSettings cloudSchedulerSettings =
     CloudSchedulerSettings.newBuilder().setEndpoint(myEndpoint).build();
 CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create(cloudSchedulerSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudSchedulerSettings cloudSchedulerSettings =
     CloudSchedulerSettings.newHttpJsonBuilder().build();
 CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create(cloudSchedulerSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

CloudSchedulerClient.ListJobsFixedSizeCollection

CloudSchedulerClient.ListJobsPage

CloudSchedulerClient.ListJobsPagedResponse

CloudSchedulerClient.ListLocationsFixedSizeCollection

CloudSchedulerClient.ListLocationsPage

CloudSchedulerClient.ListLocationsPagedResponse

CloudSchedulerGrpc

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

CloudSchedulerGrpc.CloudSchedulerBlockingStub

A stub to allow clients to do synchronous rpc calls to service CloudScheduler.

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

CloudSchedulerGrpc.CloudSchedulerFutureStub

A stub to allow clients to do ListenableFuture-style rpc calls to service CloudScheduler.

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

CloudSchedulerGrpc.CloudSchedulerImplBase

Base class for the server implementation of the service CloudScheduler.

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

CloudSchedulerGrpc.CloudSchedulerStub

A stub to allow clients to do asynchronous rpc calls to service CloudScheduler.

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

CloudSchedulerSettings

Settings class to configure an instance of CloudSchedulerClient.

The default instance has everything set to sensible defaults:

  • The default service address (cloudscheduler.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getJob to 30 seconds:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 CloudSchedulerSettings.Builder cloudSchedulerSettingsBuilder =
     CloudSchedulerSettings.newBuilder();
 cloudSchedulerSettingsBuilder
     .getJobSettings()
     .setRetrySettings(
         cloudSchedulerSettingsBuilder
             .getJobSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 CloudSchedulerSettings cloudSchedulerSettings = cloudSchedulerSettingsBuilder.build();
 

CloudSchedulerSettings.Builder

Builder for CloudSchedulerSettings.

CreateJobRequest

Request message for CreateJob.

Protobuf type google.cloud.scheduler.v1beta1.CreateJobRequest

CreateJobRequest.Builder

Request message for CreateJob.

Protobuf type google.cloud.scheduler.v1beta1.CreateJobRequest

DeleteJobRequest

Request message for deleting a job using DeleteJob.

Protobuf type google.cloud.scheduler.v1beta1.DeleteJobRequest

DeleteJobRequest.Builder

Request message for deleting a job using DeleteJob.

Protobuf type google.cloud.scheduler.v1beta1.DeleteJobRequest

GetJobRequest

Request message for GetJob.

Protobuf type google.cloud.scheduler.v1beta1.GetJobRequest

GetJobRequest.Builder

Request message for GetJob.

Protobuf type google.cloud.scheduler.v1beta1.GetJobRequest

HttpTarget

Http target. The job will be pushed to the job handler by means of an HTTP request via an http_method such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP response code in the range [200 - 299]. A failure to receive a response constitutes a failed execution. For a redirected request, the response returned by the redirected request is considered.

Protobuf type google.cloud.scheduler.v1beta1.HttpTarget

HttpTarget.Builder

Http target. The job will be pushed to the job handler by means of an HTTP request via an http_method such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP response code in the range [200 - 299]. A failure to receive a response constitutes a failed execution. For a redirected request, the response returned by the redirected request is considered.

Protobuf type google.cloud.scheduler.v1beta1.HttpTarget

Job

Configuration for a job. The maximum allowed size for a job is 1MB.

Protobuf type google.cloud.scheduler.v1beta1.Job

Job.Builder

Configuration for a job. The maximum allowed size for a job is 1MB.

Protobuf type google.cloud.scheduler.v1beta1.Job

JobName

JobName.Builder

Builder for projects/{project}/locations/{location}/jobs/{job}.

JobProto

ListJobsRequest

Request message for listing jobs using ListJobs.

Protobuf type google.cloud.scheduler.v1beta1.ListJobsRequest

ListJobsRequest.Builder

Request message for listing jobs using ListJobs.

Protobuf type google.cloud.scheduler.v1beta1.ListJobsRequest

ListJobsResponse

Response message for listing jobs using ListJobs.

Protobuf type google.cloud.scheduler.v1beta1.ListJobsResponse

ListJobsResponse.Builder

Response message for listing jobs using ListJobs.

Protobuf type google.cloud.scheduler.v1beta1.ListJobsResponse

LocationName

LocationName.Builder

Builder for projects/{project}/locations/{location}.

OAuthToken

Contains information needed for generating an OAuth token. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.

Protobuf type google.cloud.scheduler.v1beta1.OAuthToken

OAuthToken.Builder

Contains information needed for generating an OAuth token. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.

Protobuf type google.cloud.scheduler.v1beta1.OAuthToken

OidcToken

Contains information needed for generating an OpenID Connect token. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.

Protobuf type google.cloud.scheduler.v1beta1.OidcToken

OidcToken.Builder

Contains information needed for generating an OpenID Connect token. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.

Protobuf type google.cloud.scheduler.v1beta1.OidcToken

PauseJobRequest

Request message for PauseJob.

Protobuf type google.cloud.scheduler.v1beta1.PauseJobRequest

PauseJobRequest.Builder

Request message for PauseJob.

Protobuf type google.cloud.scheduler.v1beta1.PauseJobRequest

ProjectName

ProjectName.Builder

Builder for ProjectName.

PubsubTarget

Pub/Sub target. The job will be delivered by publishing a message to the given Pub/Sub topic.

Protobuf type google.cloud.scheduler.v1beta1.PubsubTarget

PubsubTarget.Builder

Pub/Sub target. The job will be delivered by publishing a message to the given Pub/Sub topic.

Protobuf type google.cloud.scheduler.v1beta1.PubsubTarget

ResumeJobRequest

Request message for ResumeJob.

Protobuf type google.cloud.scheduler.v1beta1.ResumeJobRequest

ResumeJobRequest.Builder

Request message for ResumeJob.

Protobuf type google.cloud.scheduler.v1beta1.ResumeJobRequest

RetryConfig

Settings that determine the retry behavior. By default, if a job does not complete successfully (meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings in RetryConfig.

Protobuf type google.cloud.scheduler.v1beta1.RetryConfig

RetryConfig.Builder

Settings that determine the retry behavior. By default, if a job does not complete successfully (meaning that an acknowledgement is not received from the handler, then it will be retried with exponential backoff according to the settings in RetryConfig.

Protobuf type google.cloud.scheduler.v1beta1.RetryConfig

RunJobRequest

Request message for forcing a job to run now using RunJob.

Protobuf type google.cloud.scheduler.v1beta1.RunJobRequest

RunJobRequest.Builder

Request message for forcing a job to run now using RunJob.

Protobuf type google.cloud.scheduler.v1beta1.RunJobRequest

SchedulerProto

TargetProto

UpdateJobRequest

Request message for UpdateJob.

Protobuf type google.cloud.scheduler.v1beta1.UpdateJobRequest

UpdateJobRequest.Builder

Request message for UpdateJob.

Protobuf type google.cloud.scheduler.v1beta1.UpdateJobRequest

Interfaces

AppEngineHttpTargetOrBuilder

AppEngineRoutingOrBuilder

CloudSchedulerGrpc.AsyncService

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

CreateJobRequestOrBuilder

DeleteJobRequestOrBuilder

GetJobRequestOrBuilder

HttpTargetOrBuilder

JobOrBuilder

ListJobsRequestOrBuilder

ListJobsResponseOrBuilder

OAuthTokenOrBuilder

OidcTokenOrBuilder

PauseJobRequestOrBuilder

PubsubTargetOrBuilder

ResumeJobRequestOrBuilder

RetryConfigOrBuilder

RunJobRequestOrBuilder

UpdateJobRequestOrBuilder

Enums

HttpMethod

The HTTP method used to execute the job.

Protobuf enum google.cloud.scheduler.v1beta1.HttpMethod

HttpTarget.AuthorizationHeaderCase

Job.State

State of the job.

Protobuf enum google.cloud.scheduler.v1beta1.Job.State

Job.TargetCase