google-cloud-scheduler 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/scheduler.rb +3 -3
  4. data/lib/google/cloud/scheduler/v1.rb +139 -0
  5. data/lib/google/cloud/scheduler/v1/cloud_scheduler_client.rb +612 -0
  6. data/lib/google/cloud/scheduler/v1/cloud_scheduler_client_config.json +66 -0
  7. data/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb +62 -0
  8. data/lib/google/cloud/scheduler/v1/cloudscheduler_services_pb.rb +84 -0
  9. data/lib/google/cloud/scheduler/v1/credentials.rb +41 -0
  10. data/lib/google/cloud/scheduler/v1/doc/google/cloud/scheduler/v1/cloudscheduler.rb +142 -0
  11. data/lib/google/cloud/scheduler/v1/doc/google/cloud/scheduler/v1/job.rb +207 -0
  12. data/lib/google/cloud/scheduler/v1/doc/google/cloud/scheduler/v1/target.rb +286 -0
  13. data/lib/google/cloud/scheduler/v1/doc/google/protobuf/any.rb +130 -0
  14. data/lib/google/cloud/scheduler/v1/doc/google/protobuf/duration.rb +91 -0
  15. data/lib/google/cloud/scheduler/v1/doc/google/protobuf/empty.rb +29 -0
  16. data/lib/google/cloud/scheduler/v1/doc/google/protobuf/field_mask.rb +230 -0
  17. data/lib/google/cloud/scheduler/v1/doc/google/protobuf/timestamp.rb +109 -0
  18. data/lib/google/cloud/scheduler/v1/doc/google/rpc/status.rb +87 -0
  19. data/lib/google/cloud/scheduler/v1/helpers.rb +48 -0
  20. data/lib/google/cloud/scheduler/v1/job_pb.rb +56 -0
  21. data/lib/google/cloud/scheduler/v1/target_pb.rb +58 -0
  22. data/lib/google/cloud/scheduler/v1beta1.rb +1 -1
  23. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler_client.rb +28 -16
  24. data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb +23 -13
  25. data/lib/google/cloud/scheduler/v1beta1/credentials.rb +1 -1
  26. data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/cloudscheduler.rb +31 -18
  27. data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/job.rb +37 -25
  28. data/lib/google/cloud/scheduler/v1beta1/doc/google/cloud/scheduler/v1beta1/target.rb +62 -42
  29. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/any.rb +1 -1
  30. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/duration.rb +1 -1
  31. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/empty.rb +1 -1
  32. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/field_mask.rb +1 -1
  33. data/lib/google/cloud/scheduler/v1beta1/doc/google/protobuf/timestamp.rb +1 -1
  34. data/lib/google/cloud/scheduler/v1beta1/doc/google/rpc/status.rb +18 -15
  35. data/lib/google/cloud/scheduler/v1beta1/helpers.rb +7 -7
  36. metadata +23 -5
@@ -0,0 +1,66 @@
1
+ {
2
+ "interfaces": {
3
+ "google.cloud.scheduler.v1.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": 30000,
25
+ "retry_codes_name": "idempotent",
26
+ "retry_params_name": "default"
27
+ },
28
+ "GetJob": {
29
+ "timeout_millis": 30000,
30
+ "retry_codes_name": "idempotent",
31
+ "retry_params_name": "default"
32
+ },
33
+ "CreateJob": {
34
+ "timeout_millis": 30000,
35
+ "retry_codes_name": "non_idempotent",
36
+ "retry_params_name": "default"
37
+ },
38
+ "UpdateJob": {
39
+ "timeout_millis": 30000,
40
+ "retry_codes_name": "non_idempotent",
41
+ "retry_params_name": "default"
42
+ },
43
+ "DeleteJob": {
44
+ "timeout_millis": 30000,
45
+ "retry_codes_name": "idempotent",
46
+ "retry_params_name": "default"
47
+ },
48
+ "PauseJob": {
49
+ "timeout_millis": 30000,
50
+ "retry_codes_name": "non_idempotent",
51
+ "retry_params_name": "default"
52
+ },
53
+ "ResumeJob": {
54
+ "timeout_millis": 30000,
55
+ "retry_codes_name": "non_idempotent",
56
+ "retry_params_name": "default"
57
+ },
58
+ "RunJob": {
59
+ "timeout_millis": 30000,
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/v1/cloudscheduler.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/annotations_pb'
8
+ require 'google/cloud/scheduler/v1/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.v1.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.v1.ListJobsResponse" do
18
+ repeated :jobs, :message, 1, "google.cloud.scheduler.v1.Job"
19
+ optional :next_page_token, :string, 2
20
+ end
21
+ add_message "google.cloud.scheduler.v1.GetJobRequest" do
22
+ optional :name, :string, 1
23
+ end
24
+ add_message "google.cloud.scheduler.v1.CreateJobRequest" do
25
+ optional :parent, :string, 1
26
+ optional :job, :message, 2, "google.cloud.scheduler.v1.Job"
27
+ end
28
+ add_message "google.cloud.scheduler.v1.UpdateJobRequest" do
29
+ optional :job, :message, 1, "google.cloud.scheduler.v1.Job"
30
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
31
+ end
32
+ add_message "google.cloud.scheduler.v1.DeleteJobRequest" do
33
+ optional :name, :string, 1
34
+ end
35
+ add_message "google.cloud.scheduler.v1.PauseJobRequest" do
36
+ optional :name, :string, 1
37
+ end
38
+ add_message "google.cloud.scheduler.v1.ResumeJobRequest" do
39
+ optional :name, :string, 1
40
+ end
41
+ add_message "google.cloud.scheduler.v1.RunJobRequest" do
42
+ optional :name, :string, 1
43
+ end
44
+ end
45
+
46
+ module Google
47
+ module Cloud
48
+ module Scheduler
49
+ module V1
50
+ ListJobsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsRequest").msgclass
51
+ ListJobsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ListJobsResponse").msgclass
52
+ GetJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.GetJobRequest").msgclass
53
+ CreateJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.CreateJobRequest").msgclass
54
+ UpdateJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.UpdateJobRequest").msgclass
55
+ DeleteJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.DeleteJobRequest").msgclass
56
+ PauseJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.PauseJobRequest").msgclass
57
+ ResumeJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.ResumeJobRequest").msgclass
58
+ RunJobRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1.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/v1/cloudscheduler.proto for package 'google.cloud.scheduler.v1'
3
+ # Original file comments:
4
+ # Copyright 2019 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/v1/cloudscheduler_pb'
23
+
24
+ module Google
25
+ module Cloud
26
+ module Scheduler
27
+ module V1
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.v1.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.v1.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.v1.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.v1.CloudScheduler.ResumeJob]. The
61
+ # state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it
62
+ # will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.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.v1.Job.State.PAUSED]. The
68
+ # state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it
69
+ # will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in
70
+ # [Job.State.PAUSED][google.cloud.scheduler.v1.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 2019 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 V1
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 2019 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 V1
20
+ # Request message for listing jobs using {Google::Cloud::Scheduler::V1::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::V1::ListJobsResponse#next_page_token next_page_token} returned from
41
+ # the previous call to {Google::Cloud::Scheduler::V1::CloudScheduler::ListJobs ListJobs}. It is an error to
42
+ # switch the value of {Google::Cloud::Scheduler::V1::ListJobsRequest#filter filter} or
43
+ # {Google::Cloud::Scheduler::V1::ListJobsRequest#order_by order_by} while iterating through pages.
44
+ class ListJobsRequest; end
45
+
46
+ # Response message for listing jobs using {Google::Cloud::Scheduler::V1::CloudScheduler::ListJobs ListJobs}.
47
+ # @!attribute [rw] jobs
48
+ # @return [Array<Google::Cloud::Scheduler::V1::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::V1::ListJobsRequest#page_token page_token} field in the subsequent call to
54
+ # {Google::Cloud::Scheduler::V1::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::V1::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::V1::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::V1::Job]
79
+ # Required.
80
+ #
81
+ # The job to add. The user can optionally specify a name for the
82
+ # job in {Google::Cloud::Scheduler::V1::Job#name name}. {Google::Cloud::Scheduler::V1::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::V1::Job#name name}) in the response.
86
+ class CreateJobRequest; end
87
+
88
+ # Request message for {Google::Cloud::Scheduler::V1::CloudScheduler::UpdateJob UpdateJob}.
89
+ # @!attribute [rw] job
90
+ # @return [Google::Cloud::Scheduler::V1::Job]
91
+ # Required.
92
+ #
93
+ # The new job properties. {Google::Cloud::Scheduler::V1::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::V1::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::V1::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::V1::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::V1::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,207 @@
1
+ # Copyright 2019 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 V1
20
+ # Configuration for a job.
21
+ # The maximum allowed size for a job is 100KB.
22
+ # @!attribute [rw] name
23
+ # @return [String]
24
+ # Optionally caller-specified in {Google::Cloud::Scheduler::V1::CloudScheduler::CreateJob CreateJob}, after
25
+ # which it becomes output only.
26
+ #
27
+ # The job name. For example:
28
+ # `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
29
+ #
30
+ # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
31
+ # hyphens (-), colons (:), or periods (.).
32
+ # For more information, see
33
+ # [Identifying
34
+ # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
35
+ # * `LOCATION_ID` is the canonical ID for the job's location.
36
+ # The list of available locations can be obtained by calling
37
+ # {Google::Cloud::Location::Locations::ListLocations ListLocations}.
38
+ # For more information, see https://cloud.google.com/about/locations/.
39
+ # * `JOB_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
40
+ # hyphens (-), or underscores (_). The maximum length is 500 characters.
41
+ # @!attribute [rw] description
42
+ # @return [String]
43
+ # Optionally caller-specified in {Google::Cloud::Scheduler::V1::CloudScheduler::CreateJob CreateJob} or
44
+ # {Google::Cloud::Scheduler::V1::CloudScheduler::UpdateJob UpdateJob}.
45
+ #
46
+ # A human-readable description for the job. This string must not contain
47
+ # more than 500 characters.
48
+ # @!attribute [rw] pubsub_target
49
+ # @return [Google::Cloud::Scheduler::V1::PubsubTarget]
50
+ # Pub/Sub target.
51
+ # @!attribute [rw] app_engine_http_target
52
+ # @return [Google::Cloud::Scheduler::V1::AppEngineHttpTarget]
53
+ # App Engine HTTP target.
54
+ # @!attribute [rw] http_target
55
+ # @return [Google::Cloud::Scheduler::V1::HttpTarget]
56
+ # HTTP target.
57
+ # @!attribute [rw] schedule
58
+ # @return [String]
59
+ # Required, except when used with {Google::Cloud::Scheduler::V1::CloudScheduler::UpdateJob UpdateJob}.
60
+ #
61
+ # Describes the schedule on which the job will be executed.
62
+ #
63
+ # The schedule can be either of the following types:
64
+ #
65
+ # * [Crontab](http://en.wikipedia.org/wiki/Cron#Overview)
66
+ # * English-like
67
+ # [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules)
68
+ #
69
+ # As a general rule, execution `n + 1` of a job will not begin
70
+ # until execution `n` has finished. Cloud Scheduler will never
71
+ # allow two simultaneously outstanding executions. For example,
72
+ # this implies that if the `n+1`th execution is scheduled to run at
73
+ # 16:00 but the `n`th execution takes until 16:15, the `n+1`th
74
+ # execution will not start until `16:15`.
75
+ # A scheduled start time will be delayed if the previous
76
+ # execution has not ended when its scheduled time occurs.
77
+ #
78
+ # If {Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} > 0 and a job attempt fails,
79
+ # the job will be tried a total of {Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count}
80
+ # times, with exponential backoff, until the next scheduled start
81
+ # time.
82
+ # @!attribute [rw] time_zone
83
+ # @return [String]
84
+ # Specifies the time zone to be used in interpreting
85
+ # {Google::Cloud::Scheduler::V1::Job#schedule schedule}. The value of this field must be a time
86
+ # zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database).
87
+ #
88
+ # Note that some time zones include a provision for
89
+ # daylight savings time. The rules for daylight saving time are
90
+ # determined by the chosen tz. For UTC use the string "utc". If a
91
+ # time zone is not specified, the default will be in UTC (also known
92
+ # as GMT).
93
+ # @!attribute [rw] user_update_time
94
+ # @return [Google::Protobuf::Timestamp]
95
+ # Output only. The creation time of the job.
96
+ # @!attribute [rw] state
97
+ # @return [Google::Cloud::Scheduler::V1::Job::State]
98
+ # Output only. State of the job.
99
+ # @!attribute [rw] status
100
+ # @return [Google::Rpc::Status]
101
+ # Output only. The response from the target for the last attempted execution.
102
+ # @!attribute [rw] schedule_time
103
+ # @return [Google::Protobuf::Timestamp]
104
+ # Output only. The next time the job is scheduled. Note that this may be a
105
+ # retry of a previously failed attempt or the next execution time
106
+ # according to the schedule.
107
+ # @!attribute [rw] last_attempt_time
108
+ # @return [Google::Protobuf::Timestamp]
109
+ # Output only. The time the last job attempt started.
110
+ # @!attribute [rw] retry_config
111
+ # @return [Google::Cloud::Scheduler::V1::RetryConfig]
112
+ # Settings that determine the retry behavior.
113
+ class Job
114
+ # State of the job.
115
+ module State
116
+ # Unspecified state.
117
+ STATE_UNSPECIFIED = 0
118
+
119
+ # The job is executing normally.
120
+ ENABLED = 1
121
+
122
+ # The job is paused by the user. It will not execute. A user can
123
+ # intentionally pause the job using
124
+ # {Google::Cloud::Scheduler::V1::PauseJobRequest PauseJobRequest}.
125
+ PAUSED = 2
126
+
127
+ # The job is disabled by the system due to error. The user
128
+ # cannot directly set a job to be disabled.
129
+ DISABLED = 3
130
+
131
+ # The job state resulting from a failed {Google::Cloud::Scheduler::V1::CloudScheduler::UpdateJob CloudScheduler::UpdateJob}
132
+ # operation. To recover a job from this state, retry
133
+ # {Google::Cloud::Scheduler::V1::CloudScheduler::UpdateJob CloudScheduler::UpdateJob} until a successful response is received.
134
+ UPDATE_FAILED = 4
135
+ end
136
+ end
137
+
138
+ # Settings that determine the retry behavior.
139
+ #
140
+ # By default, if a job does not complete successfully (meaning that
141
+ # an acknowledgement is not received from the handler, then it will be retried
142
+ # with exponential backoff according to the settings in {Google::Cloud::Scheduler::V1::RetryConfig RetryConfig}.
143
+ # @!attribute [rw] retry_count
144
+ # @return [Integer]
145
+ # The number of attempts that the system will make to run a job using the
146
+ # exponential backoff procedure described by
147
+ # {Google::Cloud::Scheduler::V1::RetryConfig#max_doublings max_doublings}.
148
+ #
149
+ # The default value of retry_count is zero.
150
+ #
151
+ # If retry_count is zero, a job attempt will *not* be retried if
152
+ # it fails. Instead the Cloud Scheduler system will wait for the
153
+ # next scheduled execution time.
154
+ #
155
+ # If retry_count is set to a non-zero number then Cloud Scheduler
156
+ # will retry failed attempts, using exponential backoff,
157
+ # retry_count times, or until the next scheduled execution time,
158
+ # whichever comes first.
159
+ #
160
+ # Values greater than 5 and negative values are not allowed.
161
+ # @!attribute [rw] max_retry_duration
162
+ # @return [Google::Protobuf::Duration]
163
+ # The time limit for retrying a failed job, measured from time when an
164
+ # execution was first attempted. If specified with
165
+ # {Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count}, the job will be retried until both
166
+ # limits are reached.
167
+ #
168
+ # The default value for max_retry_duration is zero, which means retry
169
+ # duration is unlimited.
170
+ # @!attribute [rw] min_backoff_duration
171
+ # @return [Google::Protobuf::Duration]
172
+ # The minimum amount of time to wait before retrying a job after
173
+ # it fails.
174
+ #
175
+ # The default value of this field is 5 seconds.
176
+ # @!attribute [rw] max_backoff_duration
177
+ # @return [Google::Protobuf::Duration]
178
+ # The maximum amount of time to wait before retrying a job after
179
+ # it fails.
180
+ #
181
+ # The default value of this field is 1 hour.
182
+ # @!attribute [rw] max_doublings
183
+ # @return [Integer]
184
+ # The time between retries will double `max_doublings` times.
185
+ #
186
+ # A job's retry interval starts at
187
+ # {Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration}, then doubles
188
+ # `max_doublings` times, then increases linearly, and finally
189
+ # retries retries at intervals of
190
+ # {Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} up to
191
+ # {Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times.
192
+ #
193
+ # For example, if {Google::Cloud::Scheduler::V1::RetryConfig#min_backoff_duration min_backoff_duration} is
194
+ # 10s, {Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} is 300s, and
195
+ # `max_doublings` is 3, then the a job will first be retried in 10s. The
196
+ # retry interval will double three times, and then increase linearly by
197
+ # 2^3 * 10s. Finally, the job will retry at intervals of
198
+ # {Google::Cloud::Scheduler::V1::RetryConfig#max_backoff_duration max_backoff_duration} until the job has
199
+ # been attempted {Google::Cloud::Scheduler::V1::RetryConfig#retry_count retry_count} times. Thus, the
200
+ # requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, ....
201
+ #
202
+ # The default value of this field is 5.
203
+ class RetryConfig; end
204
+ end
205
+ end
206
+ end
207
+ end