google-cloud-scheduler 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +9 -0
  3. data/LICENSE +201 -0
  4. data/README.md +68 -0
  5. data/lib/google/cloud/scheduler.rb +141 -0
  6. data/lib/google/cloud/scheduler/v1beta1.rb +139 -0
  7. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler_client.rb +609 -0
  8. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler_client_config.json +66 -0
  9. data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb +62 -0
  10. data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb +84 -0
  11. data/lib/google/cloud/scheduler/v1beta1/credentials.rb +41 -0
  12. data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/cloudscheduler.rb +142 -0
  13. data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/job.rb +199 -0
  14. data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/target.rb +280 -0
  15. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/any.rb +130 -0
  16. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/duration.rb +91 -0
  17. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/empty.rb +29 -0
  18. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/field_mask.rb +230 -0
  19. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/timestamp.rb +109 -0
  20. data/lib/google/cloud/scheduler/v1beta1/doc/google/rpc/status.rb +84 -0
  21. data/lib/google/cloud/scheduler/v1beta1/helpers.rb +48 -0
  22. data/lib/google/cloud/scheduler/v1beta1/job_pb.rb +56 -0
  23. data/lib/google/cloud/scheduler/v1beta1/target_pb.rb +58 -0
  24. metadata +149 -0
@@ -0,0 +1,66 @@
1
+ {
2
+ "interfaces": {
3
+ "google.cloud.scheduler.v1beta1.CloudScheduler": {
4
+ "retry_codes": {
5
+ "idempotent": [
6
+ "DEADLINE_EXCEEDED",
7
+ "UNAVAILABLE"
8
+ ],
9
+ "non_idempotent": []
10
+ },
11
+ "retry_params": {
12
+ "default": {
13
+ "initial_retry_delay_millis": 100,
14
+ "retry_delay_multiplier": 1.3,
15
+ "max_retry_delay_millis": 60000,
16
+ "initial_rpc_timeout_millis": 20000,
17
+ "rpc_timeout_multiplier": 1.0,
18
+ "max_rpc_timeout_millis": 20000,
19
+ "total_timeout_millis": 600000
20
+ }
21
+ },
22
+ "methods": {
23
+ "ListJobs": {
24
+ "timeout_millis": 10000,
25
+ "retry_codes_name": "idempotent",
26
+ "retry_params_name": "default"
27
+ },
28
+ "GetJob": {
29
+ "timeout_millis": 10000,
30
+ "retry_codes_name": "idempotent",
31
+ "retry_params_name": "default"
32
+ },
33
+ "CreateJob": {
34
+ "timeout_millis": 10000,
35
+ "retry_codes_name": "non_idempotent",
36
+ "retry_params_name": "default"
37
+ },
38
+ "UpdateJob": {
39
+ "timeout_millis": 10000,
40
+ "retry_codes_name": "non_idempotent",
41
+ "retry_params_name": "default"
42
+ },
43
+ "DeleteJob": {
44
+ "timeout_millis": 10000,
45
+ "retry_codes_name": "idempotent",
46
+ "retry_params_name": "default"
47
+ },
48
+ "PauseJob": {
49
+ "timeout_millis": 10000,
50
+ "retry_codes_name": "idempotent",
51
+ "retry_params_name": "default"
52
+ },
53
+ "ResumeJob": {
54
+ "timeout_millis": 10000,
55
+ "retry_codes_name": "idempotent",
56
+ "retry_params_name": "default"
57
+ },
58
+ "RunJob": {
59
+ "timeout_millis": 10000,
60
+ "retry_codes_name": "non_idempotent",
61
+ "retry_params_name": "default"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,62 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/scheduler/v1beta1/cloudscheduler.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/cloud/scheduler/v1beta1/job_pb'
9
+ require 'google/protobuf/empty_pb'
10
+ require 'google/protobuf/field_mask_pb'
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_message "google.cloud.scheduler.v1beta1.ListJobsRequest" do
13
+ optional :parent, :string, 1
14
+ optional :page_size, :int32, 5
15
+ optional :page_token, :string, 6
16
+ end
17
+ add_message "google.cloud.scheduler.v1beta1.ListJobsResponse" do
18
+ repeated :jobs, :message, 1, "google.cloud.scheduler.v1beta1.Job"
19
+ optional :next_page_token, :string, 2
20
+ end
21
+ add_message "google.cloud.scheduler.v1beta1.GetJobRequest" do
22
+ optional :name, :string, 1
23
+ end
24
+ add_message "google.cloud.scheduler.v1beta1.CreateJobRequest" do
25
+ optional :parent, :string, 1
26
+ optional :job, :message, 2, "google.cloud.scheduler.v1beta1.Job"
27
+ end
28
+ add_message "google.cloud.scheduler.v1beta1.UpdateJobRequest" do
29
+ optional :job, :message, 1, "google.cloud.scheduler.v1beta1.Job"
30
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
31
+ end
32
+ add_message "google.cloud.scheduler.v1beta1.DeleteJobRequest" do
33
+ optional :name, :string, 1
34
+ end
35
+ add_message "google.cloud.scheduler.v1beta1.PauseJobRequest" do
36
+ optional :name, :string, 1
37
+ end
38
+ add_message "google.cloud.scheduler.v1beta1.ResumeJobRequest" do
39
+ optional :name, :string, 1
40
+ end
41
+ add_message "google.cloud.scheduler.v1beta1.RunJobRequest" do
42
+ optional :name, :string, 1
43
+ end
44
+ end
45
+
46
+ module Google
47
+ module Cloud
48
+ module Scheduler
49
+ module V1beta1
50
+ ListJobsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsRequest").msgclass
51
+ ListJobsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsResponse").msgclass
52
+ GetJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.GetJobRequest").msgclass
53
+ CreateJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.CreateJobRequest").msgclass
54
+ UpdateJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.UpdateJobRequest").msgclass
55
+ DeleteJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.DeleteJobRequest").msgclass
56
+ PauseJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PauseJobRequest").msgclass
57
+ ResumeJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ResumeJobRequest").msgclass
58
+ RunJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RunJobRequest").msgclass
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,84 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/scheduler/v1beta1/cloudscheduler.proto for package 'google.cloud.scheduler.v1beta1'
3
+ # Original file comments:
4
+ # Copyright 2018 Google LLC.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ #
19
+
20
+
21
+ require 'grpc'
22
+ require 'google/cloud/scheduler/v1beta1/cloudscheduler_pb'
23
+
24
+ module Google
25
+ module Cloud
26
+ module Scheduler
27
+ module V1beta1
28
+ module CloudScheduler
29
+ # The Cloud Scheduler API allows external entities to reliably
30
+ # schedule asynchronous jobs.
31
+ class Service
32
+
33
+ include GRPC::GenericService
34
+
35
+ self.marshal_class_method = :encode
36
+ self.unmarshal_class_method = :decode
37
+ self.service_name = 'google.cloud.scheduler.v1beta1.CloudScheduler'
38
+
39
+ # Lists jobs.
40
+ rpc :ListJobs, ListJobsRequest, ListJobsResponse
41
+ # Gets a job.
42
+ rpc :GetJob, GetJobRequest, Job
43
+ # Creates a job.
44
+ rpc :CreateJob, CreateJobRequest, Job
45
+ # Updates a job.
46
+ #
47
+ # If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
48
+ # not exist, `NOT_FOUND` is returned.
49
+ #
50
+ # If UpdateJob does not successfully return, it is possible for the
51
+ # job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
52
+ # not be executed. If this happens, retry the UpdateJob request
53
+ # until a successful response is received.
54
+ rpc :UpdateJob, UpdateJobRequest, Job
55
+ # Deletes a job.
56
+ rpc :DeleteJob, DeleteJobRequest, Google::Protobuf::Empty
57
+ # Pauses a job.
58
+ #
59
+ # If a job is paused then the system will stop executing the job
60
+ # until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
61
+ # state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
62
+ # 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]
63
+ # to be paused.
64
+ rpc :PauseJob, PauseJobRequest, Job
65
+ # Resume a job.
66
+ #
67
+ # This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
68
+ # state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
69
+ # will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
70
+ # [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
71
+ rpc :ResumeJob, ResumeJobRequest, Job
72
+ # Forces a job to run now.
73
+ #
74
+ # When this method is called, Cloud Scheduler will dispatch the job, even
75
+ # if the job is already running.
76
+ rpc :RunJob, RunJobRequest, Job
77
+ end
78
+
79
+ Stub = Service.rpc_stub_class
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,41 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ require "googleauth"
17
+
18
+ module Google
19
+ module Cloud
20
+ module Scheduler
21
+ module V1beta1
22
+ class Credentials < Google::Auth::Credentials
23
+ SCOPE = [
24
+ "https://www.googleapis.com/auth/cloud-platform"
25
+ ].freeze
26
+ PATH_ENV_VARS = %w(CLOUDSCHEDULER_CREDENTIALS
27
+ CLOUDSCHEDULER_KEYFILE
28
+ GOOGLE_CLOUD_CREDENTIALS
29
+ GOOGLE_CLOUD_KEYFILE
30
+ GCLOUD_KEYFILE)
31
+ JSON_ENV_VARS = %w(CLOUDSCHEDULER_CREDENTIALS_JSON
32
+ CLOUDSCHEDULER_KEYFILE_JSON
33
+ GOOGLE_CLOUD_CREDENTIALS_JSON
34
+ GOOGLE_CLOUD_KEYFILE_JSON
35
+ GCLOUD_KEYFILE_JSON)
36
+ DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,142 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Cloud
18
+ module Scheduler
19
+ module V1beta1
20
+ # Request message for listing jobs using {Google::Cloud::Scheduler::V1beta1::CloudScheduler::ListJobs ListJobs}.
21
+ # @!attribute [rw] parent
22
+ # @return [String]
23
+ # Required.
24
+ #
25
+ # The location name. For example:
26
+ # `projects/PROJECT_ID/locations/LOCATION_ID`.
27
+ # @!attribute [rw] page_size
28
+ # @return [Integer]
29
+ # Requested page size.
30
+ #
31
+ # The maximum page size is 500. If unspecified, the page size will
32
+ # be the maximum. Fewer jobs than requested might be returned,
33
+ # even if more jobs exist; use next_page_token to determine if more
34
+ # jobs exist.
35
+ # @!attribute [rw] page_token
36
+ # @return [String]
37
+ # A token identifying a page of results the server will return. To
38
+ # request the first page results, page_token must be empty. To
39
+ # request the next page of results, page_token must be the value of
40
+ # {Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token} returned from
41
+ # the previous call to {Google::Cloud::Scheduler::V1beta1::CloudScheduler::ListJobs ListJobs}. It is an error to
42
+ # switch the value of {Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or
43
+ # {Google::Cloud::Scheduler::V1beta1::ListJobsRequest#order_by order_by} while iterating through pages.
44
+ class ListJobsRequest; end
45
+
46
+ # Response message for listing jobs using {Google::Cloud::Scheduler::V1beta1::CloudScheduler::ListJobs ListJobs}.
47
+ # @!attribute [rw] jobs
48
+ # @return [Array<Google::Cloud::Scheduler::V1beta1::Job>]
49
+ # The list of jobs.
50
+ # @!attribute [rw] next_page_token
51
+ # @return [String]
52
+ # A token to retrieve next page of results. Pass this value in the
53
+ # {Google::Cloud::Scheduler::V1beta1::ListJobsRequest#page_token page_token} field in the subsequent call to
54
+ # {Google::Cloud::Scheduler::V1beta1::CloudScheduler::ListJobs ListJobs} to retrieve the next page of results.
55
+ # If this is empty it indicates that there are no more results
56
+ # through which to paginate.
57
+ #
58
+ # The page token is valid for only 2 hours.
59
+ class ListJobsResponse; end
60
+
61
+ # Request message for {Google::Cloud::Scheduler::V1beta1::CloudScheduler::GetJob GetJob}.
62
+ # @!attribute [rw] name
63
+ # @return [String]
64
+ # Required.
65
+ #
66
+ # The job name. For example:
67
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
68
+ class GetJobRequest; end
69
+
70
+ # Request message for {Google::Cloud::Scheduler::V1beta1::CloudScheduler::CreateJob CreateJob}.
71
+ # @!attribute [rw] parent
72
+ # @return [String]
73
+ # Required.
74
+ #
75
+ # The location name. For example:
76
+ # `projects/PROJECT_ID/locations/LOCATION_ID`.
77
+ # @!attribute [rw] job
78
+ # @return [Google::Cloud::Scheduler::V1beta1::Job]
79
+ # Required.
80
+ #
81
+ # The job to add. The user can optionally specify a name for the
82
+ # job in {Google::Cloud::Scheduler::V1beta1::Job#name name}. {Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an
83
+ # existing job. If a name is not specified then the system will
84
+ # generate a random unique name that will be returned
85
+ # ({Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response.
86
+ class CreateJobRequest; end
87
+
88
+ # Request message for {Google::Cloud::Scheduler::V1beta1::CloudScheduler::UpdateJob UpdateJob}.
89
+ # @!attribute [rw] job
90
+ # @return [Google::Cloud::Scheduler::V1beta1::Job]
91
+ # Required.
92
+ #
93
+ # The new job properties. {Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified.
94
+ #
95
+ # Output only fields cannot be modified using UpdateJob.
96
+ # Any value specified for an output only field will be ignored.
97
+ # @!attribute [rw] update_mask
98
+ # @return [Google::Protobuf::FieldMask]
99
+ # A mask used to specify which fields of the job are being updated.
100
+ class UpdateJobRequest; end
101
+
102
+ # Request message for deleting a job using
103
+ # {Google::Cloud::Scheduler::V1beta1::CloudScheduler::DeleteJob DeleteJob}.
104
+ # @!attribute [rw] name
105
+ # @return [String]
106
+ # Required.
107
+ #
108
+ # The job name. For example:
109
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
110
+ class DeleteJobRequest; end
111
+
112
+ # Request message for {Google::Cloud::Scheduler::V1beta1::CloudScheduler::PauseJob PauseJob}.
113
+ # @!attribute [rw] name
114
+ # @return [String]
115
+ # Required.
116
+ #
117
+ # The job name. For example:
118
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
119
+ class PauseJobRequest; end
120
+
121
+ # Request message for {Google::Cloud::Scheduler::V1beta1::CloudScheduler::ResumeJob ResumeJob}.
122
+ # @!attribute [rw] name
123
+ # @return [String]
124
+ # Required.
125
+ #
126
+ # The job name. For example:
127
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
128
+ class ResumeJobRequest; end
129
+
130
+ # Request message for forcing a job to run now using
131
+ # {Google::Cloud::Scheduler::V1beta1::CloudScheduler::RunJob RunJob}.
132
+ # @!attribute [rw] name
133
+ # @return [String]
134
+ # Required.
135
+ #
136
+ # The job name. For example:
137
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
138
+ class RunJobRequest; end
139
+ end
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,199 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Cloud
18
+ module Scheduler
19
+ module V1beta1
20
+ # Configuration for a job.
21
+ # The maximum allowed size for a job is 100KB.
22
+ # @!attribute [rw] name
23
+ # @return [String]
24
+ # The job name. For example:
25
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
26
+ #
27
+ # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
28
+ # hyphens (-), colons (:), or periods (.).
29
+ # For more information, see
30
+ # [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
31
+ # * `LOCATION_ID` is the canonical ID for the job's location.
32
+ # The list of available locations can be obtained by calling
33
+ # {Google::Cloud::Location::Locations::ListLocations ListLocations}.
34
+ # For more information, see https://cloud.google.com/about/locations/.
35
+ # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
36
+ # hyphens (-), or underscores (_). The maximum length is 500 characters.
37
+ # @!attribute [rw] description
38
+ # @return [String]
39
+ # A human-readable description for the job. This string must not contain
40
+ # more than 500 characters.
41
+ # @!attribute [rw] pubsub_target
42
+ # @return [Google::Cloud::Scheduler::V1beta1::PubsubTarget]
43
+ # Pub/Sub target.
44
+ # @!attribute [rw] app_engine_http_target
45
+ # @return [Google::Cloud::Scheduler::V1beta1::AppEngineHttpTarget]
46
+ # App Engine HTTP target.
47
+ # @!attribute [rw] http_target
48
+ # @return [Google::Cloud::Scheduler::V1beta1::HttpTarget]
49
+ # HTTP target.
50
+ # @!attribute [rw] schedule
51
+ # @return [String]
52
+ # Required.
53
+ #
54
+ # Describes the schedule on which the job will be executed.
55
+ #
56
+ # As a general rule, execution `n + 1` of a job will not begin
57
+ # until execution `n` has finished. Cloud Scheduler will never
58
+ # allow two simultaneously outstanding executions. For example,
59
+ # this implies that if the `n+1`th execution is scheduled to run at
60
+ # 16:00 but the `n`th execution takes until 16:15, the `n+1`th
61
+ # execution will not start until `16:15`.
62
+ # A scheduled start time will be delayed if the previous
63
+ # execution has not ended when its scheduled time occurs.
64
+ #
65
+ # If {Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} > 0 and a job attempt fails,
66
+ # the job will be tried a total of {Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count}
67
+ # times, with exponential backoff, until the next scheduled start
68
+ # time.
69
+ #
70
+ # The schedule can be either of the following types:
71
+ #
72
+ # * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
73
+ # * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
74
+ # @!attribute [rw] time_zone
75
+ # @return [String]
76
+ # Specifies the time zone to be used in interpreting
77
+ # {Google::Cloud::Scheduler::V1beta1::Job#schedule schedule}. The value of this field must be a time
78
+ # zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
79
+ #
80
+ # Note that some time zones include a provision for
81
+ # daylight savings time. The rules for daylight saving time are
82
+ # determined by the chosen tz. For UTC use the string "utc". If a
83
+ # time zone is not specified, the default will be in UTC (also known
84
+ # as GMT).
85
+ # @!attribute [rw] user_update_time
86
+ # @return [Google::Protobuf::Timestamp]
87
+ # Output only. The creation time of the job.
88
+ # @!attribute [rw] state
89
+ # @return [Google::Cloud::Scheduler::V1beta1::Job::State]
90
+ # Output only. State of the job.
91
+ # @!attribute [rw] status
92
+ # @return [Google::Rpc::Status]
93
+ # Output only. The response from the target for the last attempted execution.
94
+ # @!attribute [rw] schedule_time
95
+ # @return [Google::Protobuf::Timestamp]
96
+ # Output only. The next time the job is scheduled. Note that this may be a
97
+ # retry of a previously failed attempt or the next execution time
98
+ # according to the schedule.
99
+ # @!attribute [rw] last_attempt_time
100
+ # @return [Google::Protobuf::Timestamp]
101
+ # Output only. The time the last job attempt started.
102
+ # @!attribute [rw] retry_config
103
+ # @return [Google::Cloud::Scheduler::V1beta1::RetryConfig]
104
+ # Settings that determine the retry behavior.
105
+ class Job
106
+ # State of the job.
107
+ module State
108
+ # Unspecified state.
109
+ STATE_UNSPECIFIED = 0
110
+
111
+ # The job is executing normally.
112
+ ENABLED = 1
113
+
114
+ # The job is paused by the user. It will not execute. A user can
115
+ # intentionally pause the job using
116
+ # {Google::Cloud::Scheduler::V1beta1::PauseJobRequest PauseJobRequest}.
117
+ PAUSED = 2
118
+
119
+ # The job is disabled by the system due to error. The user
120
+ # cannot directly set a job to be disabled.
121
+ DISABLED = 3
122
+
123
+ # The job state resulting from a failed {Google::Cloud::Scheduler::V1beta1::CloudScheduler::UpdateJob CloudScheduler::UpdateJob}
124
+ # operation. To recover a job from this state, retry
125
+ # {Google::Cloud::Scheduler::V1beta1::CloudScheduler::UpdateJob CloudScheduler::UpdateJob} until a successful response is received.
126
+ UPDATE_FAILED = 4
127
+ end
128
+ end
129
+
130
+ # Settings that determine the retry behavior.
131
+ #
132
+ # By default, if a job does not complete successfully (meaning that
133
+ # an acknowledgement is not received from the handler, then it will be retried
134
+ # with exponential backoff according to the settings in {Google::Cloud::Scheduler::V1beta1::RetryConfig RetryConfig}.
135
+ # @!attribute [rw] retry_count
136
+ # @return [Integer]
137
+ # The number of attempts that the system will make to run a job using the
138
+ # exponential backoff procedure described by
139
+ # {Google::Cloud::Scheduler::V1beta1::RetryConfig#max_doublings max_doublings}.
140
+ #
141
+ # The default value of retry_count is zero.
142
+ #
143
+ # If retry_count is zero, a job attempt will *not* be retried if
144
+ # it fails. Instead the Cloud Scheduler system will wait for the
145
+ # next scheduled execution time.
146
+ #
147
+ # If retry_count is set to a non-zero number then Cloud Scheduler
148
+ # will retry failed attempts, using exponential backoff,
149
+ # retry_count times, or until the next scheduled execution time,
150
+ # whichever comes first.
151
+ #
152
+ # Values greater than 5 and negative values are not allowed.
153
+ # @!attribute [rw] max_retry_duration
154
+ # @return [Google::Protobuf::Duration]
155
+ # The time limit for retrying a failed job, measured from time when an
156
+ # execution was first attempted. If specified with
157
+ # {Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count}, the job will be retried until both limits are
158
+ # reached.
159
+ #
160
+ # The default value for max_retry_duration is zero, which means retry
161
+ # duration is unlimited.
162
+ # @!attribute [rw] min_backoff_duration
163
+ # @return [Google::Protobuf::Duration]
164
+ # The minimum amount of time to wait before retrying a job after
165
+ # it fails.
166
+ #
167
+ # The default value of this field is 5 seconds.
168
+ # @!attribute [rw] max_backoff_duration
169
+ # @return [Google::Protobuf::Duration]
170
+ # The maximum amount of time to wait before retrying a job after
171
+ # it fails.
172
+ #
173
+ # The default value of this field is 1 hour.
174
+ # @!attribute [rw] max_doublings
175
+ # @return [Integer]
176
+ # The time between retries will double `max_doublings` times.
177
+ #
178
+ # A job's retry interval starts at
179
+ # {Google::Cloud::Scheduler::V1beta1::RetryConfig#min_backoff_duration min_backoff_duration}, then doubles
180
+ # `max_doublings` times, then increases linearly, and finally
181
+ # retries retries at intervals of
182
+ # {Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} up to
183
+ # {Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} times.
184
+ #
185
+ # For example, if {Google::Cloud::Scheduler::V1beta1::RetryConfig#min_backoff_duration min_backoff_duration} is
186
+ # 10s, {Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} is 300s, and
187
+ # `max_doublings` is 3, then the a job will first be retried in 10s. The
188
+ # retry interval will double three times, and then increase linearly by
189
+ # 2^3 * 10s. Finally, the job will retry at intervals of
190
+ # {Google::Cloud::Scheduler::V1beta1::RetryConfig#max_backoff_duration max_backoff_duration} until the job has
191
+ # been attempted {Google::Cloud::Scheduler::V1beta1::RetryConfig#retry_count retry_count} times. Thus, the
192
+ # requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
193
+ #
194
+ # The default value of this field is 5.
195
+ class RetryConfig; end
196
+ end
197
+ end
198
+ end
199
+ end