google-cloud-scheduler-v1beta1 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/scheduler/v1beta1/bindings_override.rb +102 -0
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb +76 -28
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/client.rb +973 -0
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest/service_stub.rb +525 -0
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/rest.rb +54 -0
- data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb +7 -1
- data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb +4 -0
- data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb +24 -15
- data/lib/google/cloud/scheduler/v1beta1/job_pb.rb +2 -1
- data/lib/google/cloud/scheduler/v1beta1/rest.rb +38 -0
- data/lib/google/cloud/scheduler/v1beta1/target_pb.rb +0 -1
- data/lib/google/cloud/scheduler/v1beta1/version.rb +1 -1
- data/lib/google/cloud/scheduler/v1beta1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb +55 -17
- data/proto_docs/google/cloud/scheduler/v1beta1/job.rb +64 -34
- data/proto_docs/google/cloud/scheduler/v1beta1/target.rb +54 -34
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +35 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51b3fe6586de7a140411daaf1ee4639e8593175e1c76c1817e7b7553be80e37a
|
4
|
+
data.tar.gz: 38c759fb516a5ce01c2af36b1bd2b0bf0413db07080320b07c59eb1dc73ee02a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24b09d7c1c2a27564287ffe0047494971271ab143f91a6823e698b06982f38f22a4b46d9fd2b577f7adb9b98c22ff598b991f531ca081c55fa800afac3d34092
|
7
|
+
data.tar.gz: 8825f6c915f0e3ecada7abe627ce78d51c44a336dc42bd67905ca0ec13137e4ac8378a1f68478b7b268370eba896c6659e3a4e6878dfd8e41261ec83a7d07a32
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ruby Client for the Cloud Scheduler V1beta1 API
|
2
2
|
|
3
|
-
|
3
|
+
Creates and manages jobs run on a regular recurring schedule.
|
4
4
|
|
5
5
|
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.
|
6
6
|
|
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/config"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Scheduler
|
24
|
+
##
|
25
|
+
# @example Loading just the REST part of this package, including all its services, and instantiating a REST client
|
26
|
+
#
|
27
|
+
# require "google/cloud/scheduler/v1beta1/rest"
|
28
|
+
# client = ::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Rest::Client.new
|
29
|
+
#
|
30
|
+
module V1beta1
|
31
|
+
##
|
32
|
+
# @private
|
33
|
+
# Initialize the mixin bindings configuration
|
34
|
+
#
|
35
|
+
def self.configure
|
36
|
+
@configure ||= begin
|
37
|
+
namespace = ["Google", "Cloud", "Scheduler"]
|
38
|
+
parent_config = while namespace.any?
|
39
|
+
parent_name = namespace.join "::"
|
40
|
+
parent_const = const_get parent_name
|
41
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
42
|
+
namespace.pop
|
43
|
+
end
|
44
|
+
|
45
|
+
default_config = Configuration.new parent_config
|
46
|
+
default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
|
47
|
+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
|
48
|
+
uri_method: :get,
|
49
|
+
uri_template: "/v1beta1/{name}",
|
50
|
+
matches: [
|
51
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
|
52
|
+
],
|
53
|
+
body: nil
|
54
|
+
)
|
55
|
+
]
|
56
|
+
default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
|
57
|
+
|
58
|
+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
|
59
|
+
uri_method: :get,
|
60
|
+
uri_template: "/v1beta1/{name}/locations",
|
61
|
+
matches: [
|
62
|
+
["name", %r{^projects/[^/]+/?$}, false]
|
63
|
+
],
|
64
|
+
body: nil
|
65
|
+
)
|
66
|
+
]
|
67
|
+
default_config
|
68
|
+
end
|
69
|
+
yield @configure if block_given?
|
70
|
+
@configure
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# @private
|
75
|
+
# Configuration class for the google.cloud.scheduler.v1beta1 package.
|
76
|
+
#
|
77
|
+
# This class contains common configuration for all services
|
78
|
+
# of the google.cloud.scheduler.v1beta1 package.
|
79
|
+
#
|
80
|
+
# This configuration is for internal use of the client library classes,
|
81
|
+
# and it is not intended that the end-users will read or change it.
|
82
|
+
#
|
83
|
+
class Configuration
|
84
|
+
extend ::Gapic::Config
|
85
|
+
|
86
|
+
# @private
|
87
|
+
# Overrides for http bindings for the RPC of the mixins for this package.
|
88
|
+
# Services in this package should use these when creating clients for the mixin services.
|
89
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
90
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
91
|
+
|
92
|
+
# @private
|
93
|
+
def initialize parent_config = nil
|
94
|
+
@parent_config = parent_config unless parent_config.nil?
|
95
|
+
|
96
|
+
yield self if block_given?
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/scheduler/v1beta1/cloudscheduler_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -165,6 +166,12 @@ module Google
|
|
165
166
|
@quota_project_id = @config.quota_project
|
166
167
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
167
168
|
|
169
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
170
|
+
config.credentials = credentials
|
171
|
+
config.quota_project = @quota_project_id
|
172
|
+
config.endpoint = @config.endpoint
|
173
|
+
end
|
174
|
+
|
168
175
|
@cloud_scheduler_stub = ::Gapic::ServiceStub.new(
|
169
176
|
::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Stub,
|
170
177
|
credentials: credentials,
|
@@ -174,6 +181,13 @@ module Google
|
|
174
181
|
)
|
175
182
|
end
|
176
183
|
|
184
|
+
##
|
185
|
+
# Get the associated client for mix-in of the Locations.
|
186
|
+
#
|
187
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
188
|
+
#
|
189
|
+
attr_reader :location_client
|
190
|
+
|
177
191
|
# Service calls
|
178
192
|
|
179
193
|
##
|
@@ -189,7 +203,7 @@ module Google
|
|
189
203
|
# @param options [::Gapic::CallOptions, ::Hash]
|
190
204
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
191
205
|
#
|
192
|
-
# @overload list_jobs(parent: nil, page_size: nil, page_token: nil)
|
206
|
+
# @overload list_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, legacy_app_engine_cron: nil)
|
193
207
|
# Pass arguments to `list_jobs` via keyword arguments. Note that at
|
194
208
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
195
209
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -197,6 +211,15 @@ module Google
|
|
197
211
|
# @param parent [::String]
|
198
212
|
# Required. The location name. For example:
|
199
213
|
# `projects/PROJECT_ID/locations/LOCATION_ID`.
|
214
|
+
# @param filter [::String]
|
215
|
+
# `filter` can be used to specify a subset of jobs.
|
216
|
+
#
|
217
|
+
# If `filter` equals `target_config="HttpConfig"`, then the http
|
218
|
+
# target jobs are retrieved. If `filter` equals
|
219
|
+
# `target_config="PubSubConfig"`, then the Pub/Sub target jobs are
|
220
|
+
# retrieved. If `filter` equals `labels.foo=value1
|
221
|
+
# labels.foo=value2` then only jobs which are labeled with
|
222
|
+
# foo=value1 AND foo=value2 will be returned.
|
200
223
|
# @param page_size [::Integer]
|
201
224
|
# Requested page size.
|
202
225
|
#
|
@@ -208,10 +231,17 @@ module Google
|
|
208
231
|
# A token identifying a page of results the server will return. To
|
209
232
|
# request the first page results, page_token must be empty. To
|
210
233
|
# request the next page of results, page_token must be the value of
|
211
|
-
# {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token}
|
212
|
-
# the previous call to
|
213
|
-
#
|
214
|
-
#
|
234
|
+
# {::Google::Cloud::Scheduler::V1beta1::ListJobsResponse#next_page_token next_page_token}
|
235
|
+
# returned from the previous call to
|
236
|
+
# {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs ListJobs}. It is
|
237
|
+
# an error to switch the value of
|
238
|
+
# {::Google::Cloud::Scheduler::V1beta1::ListJobsRequest#filter filter} or
|
239
|
+
# [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while
|
240
|
+
# iterating through pages.
|
241
|
+
# @param legacy_app_engine_cron [::Boolean]
|
242
|
+
# This field is used to manage the legacy App Engine Cron jobs using the
|
243
|
+
# Cloud Scheduler API. If the field is set to true, the jobs in the __cron
|
244
|
+
# queue will be listed instead.
|
215
245
|
#
|
216
246
|
# @yield [response, operation] Access the result along with the RPC operation
|
217
247
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1beta1::Job>]
|
@@ -233,13 +263,11 @@ module Google
|
|
233
263
|
# # Call the list_jobs method.
|
234
264
|
# result = client.list_jobs request
|
235
265
|
#
|
236
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
237
|
-
# #
|
238
|
-
#
|
239
|
-
# # methods are also available for managing paging directly.
|
240
|
-
# result.each do |response|
|
266
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
267
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
268
|
+
# result.each do |item|
|
241
269
|
# # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job.
|
242
|
-
# p
|
270
|
+
# p item
|
243
271
|
# end
|
244
272
|
#
|
245
273
|
def list_jobs request, options = nil
|
@@ -393,7 +421,8 @@ module Google
|
|
393
421
|
# `projects/PROJECT_ID/locations/LOCATION_ID`.
|
394
422
|
# @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash]
|
395
423
|
# Required. The job to add. The user can optionally specify a name for the
|
396
|
-
# job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}.
|
424
|
+
# job in {::Google::Cloud::Scheduler::V1beta1::Job#name name}.
|
425
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job#name name} cannot be the same as an
|
397
426
|
# existing job. If a name is not specified then the system will
|
398
427
|
# generate a random unique name that will be returned
|
399
428
|
# ({::Google::Cloud::Scheduler::V1beta1::Job#name name}) in the response.
|
@@ -465,13 +494,14 @@ module Google
|
|
465
494
|
##
|
466
495
|
# Updates a job.
|
467
496
|
#
|
468
|
-
# If successful, the updated {::Google::Cloud::Scheduler::V1beta1::Job Job} is
|
469
|
-
# not exist, `NOT_FOUND` is returned.
|
497
|
+
# If successful, the updated {::Google::Cloud::Scheduler::V1beta1::Job Job} is
|
498
|
+
# returned. If the job does not exist, `NOT_FOUND` is returned.
|
470
499
|
#
|
471
500
|
# If UpdateJob does not successfully return, it is possible for the
|
472
|
-
# job to be in an
|
473
|
-
#
|
474
|
-
#
|
501
|
+
# job to be in an
|
502
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED}
|
503
|
+
# state. A job in this state may not be executed. If this happens, retry the
|
504
|
+
# UpdateJob request until a successful response is received.
|
475
505
|
#
|
476
506
|
# @overload update_job(request, options = nil)
|
477
507
|
# Pass arguments to `update_job` via a request object, either of type
|
@@ -489,7 +519,8 @@ module Google
|
|
489
519
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
490
520
|
#
|
491
521
|
# @param job [::Google::Cloud::Scheduler::V1beta1::Job, ::Hash]
|
492
|
-
# Required. The new job properties.
|
522
|
+
# Required. The new job properties.
|
523
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job#name name} must be specified.
|
493
524
|
#
|
494
525
|
# Output only fields cannot be modified using UpdateJob.
|
495
526
|
# Any value specified for an output only field will be ignored.
|
@@ -573,7 +604,7 @@ module Google
|
|
573
604
|
# @param options [::Gapic::CallOptions, ::Hash]
|
574
605
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
575
606
|
#
|
576
|
-
# @overload delete_job(name: nil)
|
607
|
+
# @overload delete_job(name: nil, legacy_app_engine_cron: nil)
|
577
608
|
# Pass arguments to `delete_job` via keyword arguments. Note that at
|
578
609
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
579
610
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -581,6 +612,10 @@ module Google
|
|
581
612
|
# @param name [::String]
|
582
613
|
# Required. The job name. For example:
|
583
614
|
# `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
|
615
|
+
# @param legacy_app_engine_cron [::Boolean]
|
616
|
+
# This field is used to manage the legacy App Engine Cron jobs using the
|
617
|
+
# Cloud Scheduler API. If the field is set to true, the job in the __cron
|
618
|
+
# queue with the corresponding name will be deleted instead.
|
584
619
|
#
|
585
620
|
# @yield [response, operation] Access the result along with the RPC operation
|
586
621
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -650,10 +685,14 @@ module Google
|
|
650
685
|
# Pauses a job.
|
651
686
|
#
|
652
687
|
# If a job is paused then the system will stop executing the job
|
653
|
-
# until it is re-enabled via
|
654
|
-
#
|
655
|
-
#
|
656
|
-
#
|
688
|
+
# until it is re-enabled via
|
689
|
+
# {::Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job ResumeJob}. The
|
690
|
+
# state of the job is stored in
|
691
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job#state state}; if paused it will be set
|
692
|
+
# to {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. A
|
693
|
+
# job must be in
|
694
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED} to be
|
695
|
+
# paused.
|
657
696
|
#
|
658
697
|
# @overload pause_job(request, options = nil)
|
659
698
|
# Pass arguments to `pause_job` via a request object, either of type
|
@@ -741,10 +780,15 @@ module Google
|
|
741
780
|
##
|
742
781
|
# Resume a job.
|
743
782
|
#
|
744
|
-
# This method reenables a job after it has been
|
745
|
-
#
|
746
|
-
#
|
747
|
-
# {::Google::Cloud::Scheduler::V1beta1::Job
|
783
|
+
# This method reenables a job after it has been
|
784
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED}. The
|
785
|
+
# state of a job is stored in
|
786
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job#state Job.state}; after calling this
|
787
|
+
# method it will be set to
|
788
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job::State::ENABLED Job.State.ENABLED}. A
|
789
|
+
# job must be in
|
790
|
+
# {::Google::Cloud::Scheduler::V1beta1::Job::State::PAUSED Job.State.PAUSED} to be
|
791
|
+
# resumed.
|
748
792
|
#
|
749
793
|
# @overload resume_job(request, options = nil)
|
750
794
|
# Pass arguments to `resume_job` via a request object, either of type
|
@@ -845,7 +889,7 @@ module Google
|
|
845
889
|
# @param options [::Gapic::CallOptions, ::Hash]
|
846
890
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
847
891
|
#
|
848
|
-
# @overload run_job(name: nil)
|
892
|
+
# @overload run_job(name: nil, legacy_app_engine_cron: nil)
|
849
893
|
# Pass arguments to `run_job` via keyword arguments. Note that at
|
850
894
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
851
895
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -853,6 +897,10 @@ module Google
|
|
853
897
|
# @param name [::String]
|
854
898
|
# Required. The job name. For example:
|
855
899
|
# `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
|
900
|
+
# @param legacy_app_engine_cron [::Boolean]
|
901
|
+
# This field is used to manage the legacy App Engine Cron jobs using the
|
902
|
+
# Cloud Scheduler API. If the field is set to true, the job in the __cron
|
903
|
+
# queue with the corresponding name will be forced to run instead.
|
856
904
|
#
|
857
905
|
# @yield [response, operation] Access the result along with the RPC operation
|
858
906
|
# @yieldparam response [::Google::Cloud::Scheduler::V1beta1::Job]
|