google-cloud-scheduler-v1 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 600a316861acd382f1fae073595ead8194192bbf0a4ec31552640a66141f52eb
4
- data.tar.gz: 692f62f0f2f986eec79c659abc4663bbee64fe19683b293dc2c1f7e4ede346fd
3
+ metadata.gz: 4c3e45e9c290e0508855d56ca3e76cac9a45bbbb025aa6f241a0f41b59904566
4
+ data.tar.gz: 83cc76da5c28f9b3d44f8487337cc522e04370ca727a655460a22604f7c56f2b
5
5
  SHA512:
6
- metadata.gz: '094854a382b07bbb25f426bfcd50cf20519fdddde33d092c98b04aa76393f66db3368da4a80ad4dc603988694afad9f5e08601fd021587517879fd88f5ce66f2'
7
- data.tar.gz: 458d10dd00b9a5ea72d04d158fdb079e70d2788e078c9e85cac06894be6d89e11a98bcc83f0cd66e372a5c5c2d59907508492c131894f4a22cba23f11feafc0b
6
+ metadata.gz: 66a9ac037c5f90252d260dba904a969957e7f390fa07916ca870162c0f16b5b4c91fb9db8f3b0f3ab9ffa629b6ae352540ff11b95e90c6cddcba410bdbb722cf
7
+ data.tar.gz: e2cb065dc7fbed09158e4671767138e4a557c0d33a92e948c8b5cbc897a86a5651eb5da261874614514b9483da00e0488f5b7ccb6ea97bc6e4a9909d7fdd43a8
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 V1 API
2
2
 
3
- API Client library for the Cloud Scheduler V1 API
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/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
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/v1/rest"
28
+ # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Rest::Client.new
29
+ #
30
+ module V1
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: "/v1/{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: "/v1/{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.v1 package.
76
+ #
77
+ # This class contains common configuration for all services
78
+ # of the google.cloud.scheduler.v1 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/v1/cloudscheduler_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -159,6 +160,12 @@ module Google
159
160
  @quota_project_id = @config.quota_project
160
161
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
162
 
163
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
164
+ config.credentials = credentials
165
+ config.quota_project = @quota_project_id
166
+ config.endpoint = @config.endpoint
167
+ end
168
+
162
169
  @cloud_scheduler_stub = ::Gapic::ServiceStub.new(
163
170
  ::Google::Cloud::Scheduler::V1::CloudScheduler::Stub,
164
171
  credentials: credentials,
@@ -168,6 +175,13 @@ module Google
168
175
  )
169
176
  end
170
177
 
178
+ ##
179
+ # Get the associated client for mix-in of the Locations.
180
+ #
181
+ # @return [Google::Cloud::Location::Locations::Client]
182
+ #
183
+ attr_reader :location_client
184
+
171
185
  # Service calls
172
186
 
173
187
  ##
@@ -202,10 +216,13 @@ module Google
202
216
  # A token identifying a page of results the server will return. To
203
217
  # request the first page results, page_token must be empty. To
204
218
  # request the next page of results, page_token must be the value of
205
- # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token} returned from
206
- # the previous call to {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. It is an error to
207
- # switch the value of [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or
208
- # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while iterating through pages.
219
+ # {::Google::Cloud::Scheduler::V1::ListJobsResponse#next_page_token next_page_token}
220
+ # returned from the previous call to
221
+ # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs ListJobs}. It is an
222
+ # error to switch the value of
223
+ # [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or
224
+ # [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while
225
+ # iterating through pages.
209
226
  #
210
227
  # @yield [response, operation] Access the result along with the RPC operation
211
228
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Scheduler::V1::Job>]
@@ -227,13 +244,11 @@ module Google
227
244
  # # Call the list_jobs method.
228
245
  # result = client.list_jobs request
229
246
  #
230
- # # The returned object is of type Gapic::PagedEnumerable. You can
231
- # # iterate over all elements by calling #each, and the enumerable
232
- # # will lazily make API calls to fetch subsequent pages. Other
233
- # # methods are also available for managing paging directly.
234
- # result.each do |response|
247
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
248
+ # # over elements, and API calls will be issued to fetch pages as needed.
249
+ # result.each do |item|
235
250
  # # Each element is of type ::Google::Cloud::Scheduler::V1::Job.
236
- # p response
251
+ # p item
237
252
  # end
238
253
  #
239
254
  def list_jobs request, options = nil
@@ -387,7 +402,8 @@ module Google
387
402
  # `projects/PROJECT_ID/locations/LOCATION_ID`.
388
403
  # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash]
389
404
  # Required. The job to add. The user can optionally specify a name for the
390
- # job in {::Google::Cloud::Scheduler::V1::Job#name name}. {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an
405
+ # job in {::Google::Cloud::Scheduler::V1::Job#name name}.
406
+ # {::Google::Cloud::Scheduler::V1::Job#name name} cannot be the same as an
391
407
  # existing job. If a name is not specified then the system will
392
408
  # generate a random unique name that will be returned
393
409
  # ({::Google::Cloud::Scheduler::V1::Job#name name}) in the response.
@@ -459,13 +475,14 @@ module Google
459
475
  ##
460
476
  # Updates a job.
461
477
  #
462
- # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is returned. If the job does
463
- # not exist, `NOT_FOUND` is returned.
478
+ # If successful, the updated {::Google::Cloud::Scheduler::V1::Job Job} is
479
+ # returned. If the job does not exist, `NOT_FOUND` is returned.
464
480
  #
465
481
  # If UpdateJob does not successfully return, it is possible for the
466
- # job to be in an {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED} state. A job in this state may
467
- # not be executed. If this happens, retry the UpdateJob request
468
- # until a successful response is received.
482
+ # job to be in an
483
+ # {::Google::Cloud::Scheduler::V1::Job::State::UPDATE_FAILED Job.State.UPDATE_FAILED}
484
+ # state. A job in this state may not be executed. If this happens, retry the
485
+ # UpdateJob request until a successful response is received.
469
486
  #
470
487
  # @overload update_job(request, options = nil)
471
488
  # Pass arguments to `update_job` via a request object, either of type
@@ -483,7 +500,8 @@ module Google
483
500
  # the default parameter values, pass an empty Hash as a request object (see above).
484
501
  #
485
502
  # @param job [::Google::Cloud::Scheduler::V1::Job, ::Hash]
486
- # Required. The new job properties. {::Google::Cloud::Scheduler::V1::Job#name name} must be specified.
503
+ # Required. The new job properties.
504
+ # {::Google::Cloud::Scheduler::V1::Job#name name} must be specified.
487
505
  #
488
506
  # Output only fields cannot be modified using UpdateJob.
489
507
  # Any value specified for an output only field will be ignored.
@@ -644,10 +662,13 @@ module Google
644
662
  # Pauses a job.
645
663
  #
646
664
  # If a job is paused then the system will stop executing the job
647
- # until it is re-enabled via {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. The
648
- # state of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if paused it
649
- # will be set to {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}
650
- # to be paused.
665
+ # until it is re-enabled via
666
+ # {::Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job ResumeJob}. The state
667
+ # of the job is stored in {::Google::Cloud::Scheduler::V1::Job#state state}; if
668
+ # paused it will be set to
669
+ # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. A job must
670
+ # be in {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED} to
671
+ # be paused.
651
672
  #
652
673
  # @overload pause_job(request, options = nil)
653
674
  # Pass arguments to `pause_job` via a request object, either of type
@@ -735,10 +756,13 @@ module Google
735
756
  ##
736
757
  # Resume a job.
737
758
  #
738
- # This method reenables a job after it has been {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The
739
- # state of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state}; after calling this method it
740
- # will be set to {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job must be in
741
- # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED} to be resumed.
759
+ # This method reenables a job after it has been
760
+ # {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}. The state
761
+ # of a job is stored in {::Google::Cloud::Scheduler::V1::Job#state Job.state};
762
+ # after calling this method it will be set to
763
+ # {::Google::Cloud::Scheduler::V1::Job::State::ENABLED Job.State.ENABLED}. A job
764
+ # must be in {::Google::Cloud::Scheduler::V1::Job::State::PAUSED Job.State.PAUSED}
765
+ # to be resumed.
742
766
  #
743
767
  # @overload resume_job(request, options = nil)
744
768
  # Pass arguments to `resume_job` via a request object, either of type