diff --git a/google/cloud/scheduler/v1/BUILD.bazel b/google/cloud/scheduler/v1/BUILD.bazel index 439bfd37ff51c..94135264ba514 100644 --- a/google/cloud/scheduler/v1/BUILD.bazel +++ b/google/cloud/scheduler/v1/BUILD.bazel @@ -1,4 +1,13 @@ # This file was automatically generated by BuildFileGenerator +# https://github.com/googleapis/rules_gapic/tree/master/bazel + +# Most of the manual changes to this file will be overwritten. +# It's **only** allowed to change the following rule attribute values: +# - names of *_gapic_assembly_* rules +# - certain parameters of *_gapic_library rules, including but not limited to: +# * extra_protoc_parameters +# * extra_protoc_file_parameters +# The complete list of preserved parameters can be found in the source code. # This is an API workspace, having public visibility by default makes perfect sense. package(default_visibility = ["//visibility:public"]) @@ -63,14 +72,17 @@ java_grpc_library( java_gapic_library( name = "scheduler_java_gapic", srcs = [":scheduler_proto_with_info"], + gapic_yaml = None, grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, + service_yaml = "cloudscheduler_v1.yaml", test_deps = [ ":scheduler_java_grpc", ], transport = "grpc+rest", deps = [ ":scheduler_java_proto", + "//google/api:api_java_proto", ], ) @@ -123,11 +135,13 @@ go_gapic_library( srcs = [":scheduler_proto_with_info"], grpc_service_config = "cloudscheduler_grpc_service_config.json", importpath = "cloud.google.com/go/scheduler/apiv1;scheduler", + metadata = True, rest_numeric_enums = True, service_yaml = "cloudscheduler_v1.yaml", transport = "grpc+rest", deps = [ ":scheduler_go_proto", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", ], ) @@ -143,6 +157,7 @@ go_gapic_assembly_pkg( name = "gapi-cloud-scheduler-v1-go", deps = [ ":scheduler_go_gapic", + ":scheduler_go_gapic_srcjar-metadata.srcjar", ":scheduler_go_gapic_srcjar-test.srcjar", ":scheduler_go_proto", ], @@ -163,7 +178,10 @@ py_gapic_library( srcs = [":scheduler_proto"], grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, + service_yaml = "cloudscheduler_v1.yaml", transport = "grpc", + deps = [ + ], ) py_test( @@ -211,6 +229,7 @@ php_gapic_library( srcs = [":scheduler_proto_with_info"], grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, + service_yaml = "cloudscheduler_v1.yaml", transport = "grpc+rest", deps = [ ":scheduler_php_grpc", @@ -285,16 +304,17 @@ ruby_cloud_gapic_library( name = "scheduler_ruby_gapic", srcs = [":scheduler_proto_with_info"], extra_protoc_parameters = [ - "ruby-cloud-gem-name=google-cloud-scheduler-v1", - "ruby-cloud-env-prefix=SCHEDULER", - "ruby-cloud-product-url=https://cloud.google.com/scheduler", "ruby-cloud-api-id=cloudscheduler.googleapis.com", "ruby-cloud-api-shortname=cloudscheduler", + "ruby-cloud-env-prefix=SCHEDULER", + "ruby-cloud-gem-name=google-cloud-scheduler-v1", + "ruby-cloud-product-url=https://cloud.google.com/scheduler", ], grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, ruby_cloud_description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place.", ruby_cloud_title = "Cloud Scheduler V1", + service_yaml = "cloudscheduler_v1.yaml", deps = [ ":scheduler_ruby_grpc", ":scheduler_ruby_proto", diff --git a/google/cloud/scheduler/v1beta1/BUILD.bazel b/google/cloud/scheduler/v1beta1/BUILD.bazel index 88493c0655c01..9cec308d45bc4 100644 --- a/google/cloud/scheduler/v1beta1/BUILD.bazel +++ b/google/cloud/scheduler/v1beta1/BUILD.bazel @@ -1,4 +1,13 @@ # This file was automatically generated by BuildFileGenerator +# https://github.com/googleapis/rules_gapic/tree/master/bazel + +# Most of the manual changes to this file will be overwritten. +# It's **only** allowed to change the following rule attribute values: +# - names of *_gapic_assembly_* rules +# - certain parameters of *_gapic_library rules, including but not limited to: +# * extra_protoc_parameters +# * extra_protoc_file_parameters +# The complete list of preserved parameters can be found in the source code. # This is an API workspace, having public visibility by default makes perfect sense. package(default_visibility = ["//visibility:public"]) @@ -34,6 +43,7 @@ proto_library_with_info( deps = [ ":scheduler_proto", "//google/cloud:common_resources_proto", + "//google/cloud/location:location_proto", ], ) @@ -63,14 +73,19 @@ java_grpc_library( java_gapic_library( name = "scheduler_java_gapic", srcs = [":scheduler_proto_with_info"], + gapic_yaml = None, grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, + service_yaml = "cloudscheduler_v1beta1.yaml", test_deps = [ ":scheduler_java_grpc", + "//google/cloud/location:location_java_grpc", ], transport = "grpc+rest", deps = [ ":scheduler_java_proto", + "//google/api:api_java_proto", + "//google/cloud/location:location_java_proto", ], ) @@ -123,11 +138,14 @@ go_gapic_library( srcs = [":scheduler_proto_with_info"], grpc_service_config = "cloudscheduler_grpc_service_config.json", importpath = "cloud.google.com/go/scheduler/apiv1beta1;scheduler", + metadata = True, rest_numeric_enums = True, service_yaml = "cloudscheduler_v1beta1.yaml", transport = "grpc+rest", deps = [ ":scheduler_go_proto", + "//google/cloud/location:location_go_proto", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", ], ) @@ -143,6 +161,7 @@ go_gapic_assembly_pkg( name = "gapi-cloud-scheduler-v1beta1-go", deps = [ ":scheduler_go_gapic", + ":scheduler_go_gapic_srcjar-metadata.srcjar", ":scheduler_go_gapic_srcjar-test.srcjar", ":scheduler_go_proto", ], @@ -163,7 +182,10 @@ py_gapic_library( srcs = [":scheduler_proto"], grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, + service_yaml = "cloudscheduler_v1beta1.yaml", transport = "grpc", + deps = [ + ], ) py_test( @@ -211,6 +233,7 @@ php_gapic_library( srcs = [":scheduler_proto_with_info"], grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, + service_yaml = "cloudscheduler_v1beta1.yaml", transport = "grpc+rest", deps = [ ":scheduler_php_grpc", @@ -285,16 +308,17 @@ ruby_cloud_gapic_library( name = "scheduler_ruby_gapic", srcs = [":scheduler_proto_with_info"], extra_protoc_parameters = [ - "ruby-cloud-gem-name=google-cloud-scheduler-v1beta1", - "ruby-cloud-env-prefix=SCHEDULER", - "ruby-cloud-product-url=https://cloud.google.com/scheduler", "ruby-cloud-api-id=cloudscheduler.googleapis.com", "ruby-cloud-api-shortname=cloudscheduler", + "ruby-cloud-env-prefix=SCHEDULER", + "ruby-cloud-gem-name=google-cloud-scheduler-v1beta1", + "ruby-cloud-product-url=https://cloud.google.com/scheduler", ], grpc_service_config = "cloudscheduler_grpc_service_config.json", rest_numeric_enums = True, ruby_cloud_description = "Cloud Scheduler is a fully managed enterprise-grade cron job scheduler. It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure to reduce manual toil and intervention. Cloud Scheduler even acts as a single pane of glass, allowing you to manage all your automation tasks from one place.", ruby_cloud_title = "Cloud Scheduler V1beta1", + service_yaml = "cloudscheduler_v1beta1.yaml", deps = [ ":scheduler_ruby_grpc", ":scheduler_ruby_proto", @@ -359,4 +383,20 @@ csharp_gapic_assembly_pkg( ############################################################################## # C++ ############################################################################## -# Put your C++ rules here +load( + "@com_google_googleapis_imports//:imports.bzl", + "cc_grpc_library", + "cc_proto_library", +) + +cc_proto_library( + name = "scheduler_cc_proto", + deps = [":scheduler_proto"], +) + +cc_grpc_library( + name = "scheduler_cc_grpc", + srcs = [":scheduler_proto"], + grpc_only = True, + deps = [":scheduler_cc_proto"], +) diff --git a/google/cloud/scheduler/v1beta1/cloudscheduler.proto b/google/cloud/scheduler/v1beta1/cloudscheduler.proto index 4f86b7a56218d..f9a2da03ff22f 100644 --- a/google/cloud/scheduler/v1beta1/cloudscheduler.proto +++ b/google/cloud/scheduler/v1beta1/cloudscheduler.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -35,7 +34,8 @@ option objc_class_prefix = "SCHEDULER"; // schedule asynchronous jobs. service CloudScheduler { option (google.api.default_host) = "cloudscheduler.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Lists jobs. rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { @@ -64,13 +64,14 @@ service CloudScheduler { // Updates a job. // - // If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does - // not exist, `NOT_FOUND` is returned. + // If successful, the updated [Job][google.cloud.scheduler.v1beta1.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][google.cloud.scheduler.v1beta1.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. + // job to be in an + // [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.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. rpc UpdateJob(UpdateJobRequest) returns (Job) { option (google.api.http) = { patch: "/v1beta1/{job.name=projects/*/locations/*/jobs/*}" @@ -90,10 +91,14 @@ service CloudScheduler { // Pauses a job. // // If a job is paused then the system will stop executing the job - // until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The - // state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it - // will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] - // to be paused. + // until it is re-enabled via + // [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The + // state of the job is stored in + // [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set + // to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A + // job must be in + // [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be + // paused. rpc PauseJob(PauseJobRequest) returns (Job) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/jobs/*}:pause" @@ -104,10 +109,15 @@ service CloudScheduler { // Resume a job. // - // This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The - // state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it - // will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in - // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed. + // This method reenables a job after it has been + // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The + // state of a job is stored in + // [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this + // method it will be set to + // [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A + // job must be in + // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be + // resumed. rpc ResumeJob(ResumeJobRequest) returns (Job) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/jobs/*}:resume" @@ -129,7 +139,8 @@ service CloudScheduler { } } -// Request message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. +// Request message for listing jobs using +// [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. message ListJobsRequest { // Required. The location name. For example: // `projects/PROJECT_ID/locations/LOCATION_ID`. @@ -140,6 +151,16 @@ message ListJobsRequest { } ]; + // `filter` can be used to specify a subset of jobs. + // + // If `filter` equals `target_config="HttpConfig"`, then the http + // target jobs are retrieved. If `filter` equals + // `target_config="PubSubConfig"`, then the Pub/Sub target jobs are + // retrieved. If `filter` equals `labels.foo=value1 + // labels.foo=value2` then only jobs which are labeled with + // foo=value1 AND foo=value2 will be returned. + string filter = 4; + // Requested page size. // // The maximum page size is 500. If unspecified, the page size will @@ -151,29 +172,40 @@ message ListJobsRequest { // A token identifying a page of results the server will return. To // request the first page results, page_token must be empty. To // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from - // the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to - // switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or - // [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages. + // [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] + // returned from the previous call to + // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is + // an error to switch the value of + // [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or + // [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while + // iterating through pages. string page_token = 6; + + // This field is used to manage the legacy App Engine Cron jobs using the + // Cloud Scheduler API. If the field is set to true, the jobs in the __cron + // queue will be listed instead. + bool legacy_app_engine_cron = 7; } -// Response message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. +// Response message for listing jobs using +// [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. message ListJobsResponse { // The list of jobs. repeated Job jobs = 1; // A token to retrieve next page of results. Pass this value in the - // [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to - // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results. - // If this is empty it indicates that there are no more results - // through which to paginate. + // [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] + // field in the subsequent call to + // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to + // retrieve the next page of results. If this is empty it indicates that there + // are no more results through which to paginate. // // The page token is valid for only 2 hours. string next_page_token = 2; } -// Request message for [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob]. +// Request message for +// [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob]. message GetJobRequest { // Required. The job name. For example: // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. @@ -185,7 +217,8 @@ message GetJobRequest { ]; } -// Request message for [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob]. +// Request message for +// [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob]. message CreateJobRequest { // Required. The location name. For example: // `projects/PROJECT_ID/locations/LOCATION_ID`. @@ -197,16 +230,19 @@ message CreateJobRequest { ]; // Required. The job to add. The user can optionally specify a name for the - // job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an + // job in [name][google.cloud.scheduler.v1beta1.Job.name]. + // [name][google.cloud.scheduler.v1beta1.Job.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][google.cloud.scheduler.v1beta1.Job.name]) in the response. Job job = 2 [(google.api.field_behavior) = REQUIRED]; } -// Request message for [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]. +// Request message for +// [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]. message UpdateJobRequest { - // Required. The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified. + // Required. The new job properties. + // [name][google.cloud.scheduler.v1beta1.Job.name] must be specified. // // Output only fields cannot be modified using UpdateJob. // Any value specified for an output only field will be ignored. @@ -227,9 +263,15 @@ message DeleteJobRequest { type: "cloudscheduler.googleapis.com/Job" } ]; + + // This field is used to manage the legacy App Engine Cron jobs using the + // Cloud Scheduler API. If the field is set to true, the job in the __cron + // queue with the corresponding name will be deleted instead. + bool legacy_app_engine_cron = 2; } -// Request message for [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob]. +// Request message for +// [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob]. message PauseJobRequest { // Required. The job name. For example: // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. @@ -241,7 +283,8 @@ message PauseJobRequest { ]; } -// Request message for [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. +// Request message for +// [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. message ResumeJobRequest { // Required. The job name. For example: // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. @@ -264,4 +307,9 @@ message RunJobRequest { type: "cloudscheduler.googleapis.com/Job" } ]; + + // This field is used to manage the legacy App Engine Cron jobs using the + // Cloud Scheduler API. If the field is set to true, the job in the __cron + // queue with the corresponding name will be forced to run instead. + bool legacy_app_engine_cron = 2; } diff --git a/google/cloud/scheduler/v1beta1/cloudscheduler_v1beta1.yaml b/google/cloud/scheduler/v1beta1/cloudscheduler_v1beta1.yaml index 8b9fdadca552e..32864821a7003 100644 --- a/google/cloud/scheduler/v1beta1/cloudscheduler_v1beta1.yaml +++ b/google/cloud/scheduler/v1beta1/cloudscheduler_v1beta1.yaml @@ -4,18 +4,44 @@ name: cloudscheduler.googleapis.com title: Cloud Scheduler API apis: +- name: google.cloud.location.Locations - name: google.cloud.scheduler.v1beta1.CloudScheduler documentation: summary: Creates and manages jobs run on a regular recurring schedule. + rules: + - selector: google.cloud.location.Locations.GetLocation + description: Gets information about a location. + + - selector: google.cloud.location.Locations.ListLocations + description: Lists information about the supported locations for this service. backend: rules: + - selector: google.cloud.location.Locations.GetLocation + deadline: 30.0 + - selector: google.cloud.location.Locations.ListLocations + deadline: 30.0 - selector: 'google.cloud.scheduler.v1beta1.CloudScheduler.*' deadline: 30.0 +http: + rules: + - selector: google.cloud.location.Locations.GetLocation + get: '/v1beta1/{name=projects/*/locations/*}' + - selector: google.cloud.location.Locations.ListLocations + get: '/v1beta1/{name=projects/*}/locations' + authentication: rules: + - selector: google.cloud.location.Locations.GetLocation + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform + - selector: google.cloud.location.Locations.ListLocations + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform - selector: 'google.cloud.scheduler.v1beta1.CloudScheduler.*' oauth: canonical_scopes: |- diff --git a/google/cloud/scheduler/v1beta1/job.proto b/google/cloud/scheduler/v1beta1/job.proto index 4e8e3777fc82c..2353beecac834 100644 --- a/google/cloud/scheduler/v1beta1/job.proto +++ b/google/cloud/scheduler/v1beta1/job.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,12 +11,12 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.scheduler.v1beta1; +import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/scheduler/v1beta1/target.proto"; import "google/protobuf/duration.proto"; @@ -29,7 +29,7 @@ option java_outer_classname = "JobProto"; option java_package = "com.google.cloud.scheduler.v1beta1"; // Configuration for a job. -// The maximum allowed size for a job is 100KB. +// The maximum allowed size for a job is 1MB. message Job { option (google.api.resource) = { type: "cloudscheduler.googleapis.com/Job" @@ -53,13 +53,16 @@ message Job { // cannot directly set a job to be disabled. DISABLED = 3; - // The job state resulting from a failed [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] + // The job state resulting from a failed + // [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] // operation. To recover a job from this state, retry - // [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] until a successful response is received. + // [CloudScheduler.UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob] + // until a successful response is received. UPDATE_FAILED = 4; } - // Optionally caller-specified in [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob], after + // Optionally caller-specified in + // [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob], after // which it becomes output only. // // The job name. For example: @@ -78,7 +81,8 @@ message Job { // hyphens (-), or underscores (_). The maximum length is 500 characters. string name = 1; - // Optionally caller-specified in [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob] or + // Optionally caller-specified in + // [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob] or // [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]. // // A human-readable description for the job. This string must not contain @@ -99,13 +103,14 @@ message Job { HttpTarget http_target = 6; } - // Required, except when used with [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]. + // Required, except when used with + // [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob]. // // Describes the schedule on which the job will be executed. // // The schedule can be either of the following types: // - // * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview) + // * [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) // * English-like // [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) // @@ -118,15 +123,17 @@ message Job { // A scheduled start time will be delayed if the previous // execution has not ended when its scheduled time occurs. // - // If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > 0 and a job attempt fails, - // the job will be tried a total of [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] + // If [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] > + // 0 and a job attempt fails, the job will be tried a total of + // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] // times, with exponential backoff, until the next scheduled start // time. string schedule = 20; // Specifies the time zone to be used in interpreting - // [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this field must be a time - // zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database). + // [schedule][google.cloud.scheduler.v1beta1.Job.schedule]. The value of this + // field must be a time zone name from the [tz + // database](http://en.wikipedia.org/wiki/Tz_database). // // Note that some time zones include a provision for // daylight savings time. The rules for daylight saving time are @@ -161,20 +168,38 @@ message Job { // execution logs. Cloud Scheduler will retry the job according // to the [RetryConfig][google.cloud.scheduler.v1beta1.RetryConfig]. // - // The allowed duration for this deadline is: + // The default and the allowed values depend on the type of target: + // + // * For [HTTP targets][google.cloud.scheduler.v1beta1.Job.http_target], the + // default is 3 minutes. The deadline must be in the interval [15 seconds, 30 + // minutes]. // - // * For [HTTP targets][google.cloud.scheduler.v1beta1.Job.http_target], between 15 seconds and 30 minutes. - // * For [App Engine HTTP targets][google.cloud.scheduler.v1beta1.Job.app_engine_http_target], between 15 - // seconds and 24 hours. - // * For [PubSub targets][google.cloud.scheduler.v1beta1.Job.pubsub_target], this field is ignored. + // * For [App Engine HTTP + // targets][google.cloud.scheduler.v1beta1.Job.app_engine_http_target], 0 + // indicates that the request has the default deadline. The default deadline + // depends on the scaling type of the service: 10 minutes for standard apps + // with automatic scaling, 24 hours for standard apps with manual and basic + // scaling, and 60 minutes for flex apps. If the request deadline is set, it + // must be in the interval [15 seconds, 24 hours 15 seconds]. + // + // * For [Pub/Sub targets][google.cloud.scheduler.v1beta1.Job.pubsub_target], + // this field is ignored. google.protobuf.Duration attempt_deadline = 22; + + // Immutable. This field is used to manage the legacy App Engine Cron jobs + // using the Cloud Scheduler API. If the field is set to true, the job will be + // considered a legacy job. Note that App Engine Cron jobs have fewer + // features than Cloud Scheduler jobs, e.g., are only limited to App Engine + // targets. + bool legacy_app_engine_cron = 23 [(google.api.field_behavior) = IMMUTABLE]; } // 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][google.cloud.scheduler.v1beta1.RetryConfig]. +// with exponential backoff according to the settings in +// [RetryConfig][google.cloud.scheduler.v1beta1.RetryConfig]. message RetryConfig { // The number of attempts that the system will make to run a job using the // exponential backoff procedure described by @@ -196,8 +221,8 @@ message RetryConfig { // The time limit for retrying a failed job, measured from time when an // execution was first attempted. If specified with - // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the job will be retried until both - // limits are reached. + // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count], the + // job will be retried until both limits are reached. // // The default value for max_retry_duration is zero, which means retry // duration is unlimited. @@ -218,20 +243,25 @@ message RetryConfig { // The time between retries will double `max_doublings` times. // // A job's retry interval starts at - // [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], then doubles - // `max_doublings` times, then increases linearly, and finally - // retries retries at intervals of - // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] up to - // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. - // - // For example, if [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] is - // 10s, [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] is 300s, and - // `max_doublings` is 3, then the a job will first be retried in 10s. The - // retry interval will double three times, and then increase linearly by - // 2^3 * 10s. Finally, the job will retry at intervals of - // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] until the job has - // been attempted [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] times. Thus, the - // requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... + // [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration], + // then doubles `max_doublings` times, then increases linearly, and finally + // retries at intervals of + // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] + // up to [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] + // times. + // + // For example, if + // [min_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.min_backoff_duration] + // is 10s, + // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] + // is 300s, and `max_doublings` is 3, then the a job will first be retried in + // 10s. The retry interval will double three times, and then increase linearly + // by 2^3 * 10s. Finally, the job will retry at intervals of + // [max_backoff_duration][google.cloud.scheduler.v1beta1.RetryConfig.max_backoff_duration] + // until the job has been attempted + // [retry_count][google.cloud.scheduler.v1beta1.RetryConfig.retry_count] + // times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, + // 300s, 300s, .... // // The default value of this field is 5. int32 max_doublings = 5; diff --git a/google/cloud/scheduler/v1beta1/target.proto b/google/cloud/scheduler/v1beta1/target.proto index 7f5214f593e61..f98f210dc40ce 100644 --- a/google/cloud/scheduler/v1beta1/target.proto +++ b/google/cloud/scheduler/v1beta1/target.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; @@ -23,10 +22,15 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/scheduler/v1bet option java_multiple_files = true; option java_outer_classname = "TargetProto"; option java_package = "com.google.cloud.scheduler.v1beta1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; // Http target. The job will be pushed to the job handler by means of -// an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.HttpTarget.http_method] such as HTTP -// POST, HTTP GET, etc. The job is acknowledged by means of an HTTP +// an HTTP request via an +// [http_method][google.cloud.scheduler.v1beta1.HttpTarget.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. @@ -55,6 +59,11 @@ message HttpTarget { // * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. // * `X-Google-*`: Google internal use only. // * `X-AppEngine-*`: Google internal use only. + // * `X-CloudScheduler`: This header will be set to true. + // * `X-CloudScheduler-JobName`: This header will contain the job name. + // * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + // the unix-cron format, this header will contain the job schedule time in + // RFC3339 UTC "Zulu" format. // // The total size of headers must be less than 80KB. map headers = 3; @@ -66,7 +75,8 @@ message HttpTarget { // The mode for generating an `Authorization` header for HTTP requests. // - // If specified, all `Authorization` headers in the [HttpTarget.headers][google.cloud.scheduler.v1beta1.HttpTarget.headers] + // If specified, all `Authorization` headers in the + // [HttpTarget.headers][google.cloud.scheduler.v1beta1.HttpTarget.headers] // field will be overridden. oneof authorization_header { // If specified, an @@ -91,14 +101,14 @@ message HttpTarget { } // App Engine target. The job will be pushed to a job handler by means -// of an HTTP request via an [http_method][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.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. +// of an HTTP request via an +// [http_method][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.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. message AppEngineHttpTarget { // The HTTP method to use for the request. PATCH and OPTIONS are not // permitted. @@ -128,9 +138,14 @@ message AppEngineHttpTarget { // `"AppEngine-Google; (+http://code.google.com/appengine)"` to the // modified `User-Agent`. // * `X-CloudScheduler`: This header will be set to true. + // * `X-CloudScheduler-JobName`: This header will contain the job name. + // * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in + // the unix-cron format, this header will contain the job schedule time in + // RFC3339 UTC "Zulu" format. // - // If the job has an [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud Scheduler sets - // the following headers: + // If the job has an + // [body][google.cloud.scheduler.v1beta1.AppEngineHttpTarget.body], Cloud + // Scheduler sets the following headers: // // * `Content-Type`: By default, the `Content-Type` header is set to // `"application/octet-stream"`. The default can be overridden by explictly @@ -153,7 +168,8 @@ message AppEngineHttpTarget { // // HTTP request body. A request body is allowed only if the HTTP method is // POST or PUT. It will result in invalid argument error to set a body on a - // job with an incompatible [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod]. + // job with an incompatible + // [HttpMethod][google.cloud.scheduler.v1beta1.HttpMethod]. bytes body = 5; } @@ -162,14 +178,14 @@ message AppEngineHttpTarget { message PubsubTarget { // Required. The name of the Cloud Pub/Sub topic to which messages will // be published when a job is delivered. The topic name must be in the - // same format as required by PubSub's + // same format as required by Pub/Sub's // [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), // for example `projects/PROJECT_ID/topics/TOPIC_ID`. // // The topic must be in the same project as the Cloud Scheduler job. - string topic_name = 1 [(google.api.resource_reference) = { - type: "pubsub.googleapis.com/Topic" - }]; + string topic_name = 1 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; // The message payload for PubsubMessage. // @@ -215,7 +231,7 @@ message AppEngineRouting { // // Requests can only be sent to a specific instance if // [manual scaling is used in App Engine - // Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + // Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). // App Engine Flex does not support instances. For more information, see // [App Engine Standard request // routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) @@ -244,43 +260,51 @@ message AppEngineRouting { // example .appspot.com, which is associated with the // job's project ID. // - // * `service =` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // * `service =` + // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] // - // * `version =` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + // * `version =` + // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] // // * `version_dot_service =` - // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +` - // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' + // +` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] // - // * `instance =` [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] + // * `instance =` + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] // // * `instance_dot_service =` - // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +` - // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ + // '.' +` [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] // // * `instance_dot_version =` - // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +` - // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ + // '.' +` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] // // * `instance_dot_version_dot_service =` - // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ '.' +` - // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] `+ '.' +` + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] `+ + // '.' +` [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] + // `+ '.' +` // [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] // // - // If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is empty, then the job will be sent - // to the service which is the default service when the job is attempted. + // If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service] is + // empty, then the job will be sent to the service which is the default + // service when the job is attempted. // - // If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is empty, then the job will be sent - // to the version which is the default version when the job is attempted. + // If [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version] is + // empty, then the job will be sent to the version which is the default + // version when the job is attempted. // - // If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is empty, then the job will be - // sent to an instance which is available when the job is attempted. + // If [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is + // empty, then the job will be sent to an instance which is available when the + // job is attempted. // // If [service][google.cloud.scheduler.v1beta1.AppEngineRouting.service], // [version][google.cloud.scheduler.v1beta1.AppEngineRouting.version], or - // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is invalid, then the job will be sent - // to the default version of the default service when the job is attempted. + // [instance][google.cloud.scheduler.v1beta1.AppEngineRouting.instance] is + // invalid, then the job will be sent to the default version of the default + // service when the job is attempted. string host = 4; } @@ -345,11 +369,3 @@ message OidcToken { // specified in target will be used. string audience = 2; } - -// The Pub/Sub Topic resource definition is in google/cloud/pubsub/v1/, -// but we do not import that proto directly; therefore, we redefine the -// pattern here. -option (google.api.resource_definition) = { - type: "pubsub.googleapis.com/Topic" - pattern: "projects/{project}/topics/{topic}" -}; diff --git a/google/cloud/v1beta1/cloudscheduler_grpc_service_config.json b/google/cloud/v1beta1/cloudscheduler_grpc_service_config.json new file mode 100644 index 0000000000000..547377650c007 --- /dev/null +++ b/google/cloud/v1beta1/cloudscheduler_grpc_service_config.json @@ -0,0 +1,55 @@ +{ + "methodConfig": [ + { + "name": [ + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "ListJobs" + }, + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "GetJob" + }, + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "DeleteJob" + }, + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "PauseJob" + }, + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "ResumeJob" + } + ], + "timeout": "600s", + "retryPolicy": { + "initialBackoff": "0.100s", + "maxBackoff": "60s", + "backoffMultiplier": 1.3, + "retryableStatusCodes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + } + }, + { + "name": [ + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "CreateJob" + }, + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "UpdateJob" + }, + { + "service": "google.cloud.scheduler.v1beta1.CloudScheduler", + "method": "RunJob" + } + ], + "timeout": "600s" + } + ] +}