google-cloud-scheduler-v1 0.4.5 → 0.6.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: 89d621605aeef7b6822bfd01949acd069f7921b3492598b40c4b31d1a0bff079
4
- data.tar.gz: ea61cd81c34c3e412f6b668536b4e865f21533cbd919c9daf0097457432f626e
3
+ metadata.gz: 44a906b54e0e36764993fcac04af6dd2a9c2eb63fc50c3b3199f9134b541741a
4
+ data.tar.gz: cbae72abe1596ceb929b9f722f4e209ce0656d1ef8c05838e4380d4a895d3803
5
5
  SHA512:
6
- metadata.gz: a30e0e370a54d8d202f3aaeb84faeb11234ca83d8bd5f666a1b66fd2ac52c96905e9b4f453c714bc56496bc6c99156581dcef6a084230786b39096bbe8fe17e4
7
- data.tar.gz: 04f1d01cd1f4ecd233d63b26a4f07290a2b84c890099e6e00cab3ad6c97b027f3f9f3de071ed941a1935285d7c6aff818453baa25e3735bc9c9553907042699a
6
+ metadata.gz: 658f3ac3c788acbbfb338eec570c23a6f3cda149c2410ef30b4612c698d35250265c41a56924d343e7f3038cc90d9403f36ed73e3ccd2c0982f33fd6c5a76b25
7
+ data.tar.gz: 98bc35f2055aae27fe7914b6c9650d3d32799f797596e29f1532ecbf3c18b68271648081a98d70d298dc74ce9c9dc15df7de2a3f3ad2079f918e9eee53b1d2e0
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
 
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields
37
37
  response = client.list_jobs request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-scheduler-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/scheduler)
@@ -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.
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -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
@@ -34,7 +34,7 @@ module Google
34
34
  # The Cloud Scheduler API allows external entities to reliably
35
35
  # schedule asynchronous jobs.
36
36
  #
37
- # To load this service and instantiate a client:
37
+ # @example Load this service and instantiate a gRPC client
38
38
  #
39
39
  # require "google/cloud/scheduler/v1/cloud_scheduler"
40
40
  # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
@@ -1,6 +1,8 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/scheduler/v1/cloudscheduler.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/annotations_pb'
5
7
  require 'google/api/client_pb'
6
8
  require 'google/api/field_behavior_pb'
@@ -8,7 +10,6 @@ require 'google/api/resource_pb'
8
10
  require 'google/cloud/scheduler/v1/job_pb'
9
11
  require 'google/protobuf/empty_pb'
10
12
  require 'google/protobuf/field_mask_pb'
11
- require 'google/protobuf'
12
13
 
13
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
14
15
  add_file("google/cloud/scheduler/v1/cloudscheduler.proto", :syntax => :proto3) do
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/scheduler/v1/cloudscheduler.proto for package 'google.cloud.scheduler.v1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2022 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
  require 'grpc'
21
20
  require 'google/cloud/scheduler/v1/cloudscheduler_pb'
@@ -43,30 +42,37 @@ module Google
43
42
  rpc :CreateJob, ::Google::Cloud::Scheduler::V1::CreateJobRequest, ::Google::Cloud::Scheduler::V1::Job
44
43
  # Updates a job.
45
44
  #
46
- # If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does
47
- # not exist, `NOT_FOUND` is returned.
45
+ # If successful, the updated [Job][google.cloud.scheduler.v1.Job] is
46
+ # returned. If the job does not exist, `NOT_FOUND` is returned.
48
47
  #
49
48
  # If UpdateJob does not successfully return, it is possible for the
50
- # job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may
51
- # not be executed. If this happens, retry the UpdateJob request
52
- # until a successful response is received.
49
+ # job to be in an
50
+ # [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED]
51
+ # state. A job in this state may not be executed. If this happens, retry the
52
+ # UpdateJob request until a successful response is received.
53
53
  rpc :UpdateJob, ::Google::Cloud::Scheduler::V1::UpdateJobRequest, ::Google::Cloud::Scheduler::V1::Job
54
54
  # Deletes a job.
55
55
  rpc :DeleteJob, ::Google::Cloud::Scheduler::V1::DeleteJobRequest, ::Google::Protobuf::Empty
56
56
  # Pauses a job.
57
57
  #
58
58
  # If a job is paused then the system will stop executing the job
59
- # until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The
60
- # state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it
61
- # 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]
62
- # to be paused.
59
+ # until it is re-enabled via
60
+ # [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state
61
+ # of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if
62
+ # paused it will be set to
63
+ # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must
64
+ # be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to
65
+ # be paused.
63
66
  rpc :PauseJob, ::Google::Cloud::Scheduler::V1::PauseJobRequest, ::Google::Cloud::Scheduler::V1::Job
64
67
  # Resume a job.
65
68
  #
66
- # This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The
67
- # state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it
68
- # will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in
69
- # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.
69
+ # This method reenables a job after it has been
70
+ # [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state
71
+ # of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state];
72
+ # after calling this method it will be set to
73
+ # [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job
74
+ # must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]
75
+ # to be resumed.
70
76
  rpc :ResumeJob, ::Google::Cloud::Scheduler::V1::ResumeJobRequest, ::Google::Cloud::Scheduler::V1::Job
71
77
  # Forces a job to run now.
72
78
  #
@@ -1,13 +1,13 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/scheduler/v1/job.proto
3
3
 
4
+ require 'google/protobuf'
5
+
4
6
  require 'google/api/resource_pb'
5
7
  require 'google/cloud/scheduler/v1/target_pb'
6
8
  require 'google/protobuf/duration_pb'
7
9
  require 'google/protobuf/timestamp_pb'
8
10
  require 'google/rpc/status_pb'
9
- require 'google/api/annotations_pb'
10
- require 'google/protobuf'
11
11
 
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/scheduler/v1/job.proto", :syntax => :proto3) do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/scheduler/v1/target.proto
3
3
 
4
- require 'google/api/resource_pb'
5
- require 'google/api/annotations_pb'
6
4
  require 'google/protobuf'
7
5
 
6
+ require 'google/api/resource_pb'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/cloud/scheduler/v1/target.proto", :syntax => :proto3) do
10
10
  add_message "google.cloud.scheduler.v1.HttpTarget" do
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Scheduler
23
23
  module V1
24
- VERSION = "0.4.5"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -23,7 +23,9 @@ module Google
23
23
  module Cloud
24
24
  module Scheduler
25
25
  ##
26
- # To load this package, including all its services, and instantiate a client:
26
+ # API client module.
27
+ #
28
+ # @example Load this package, including all its services, and instantiate a gRPC client
27
29
  #
28
30
  # require "google/cloud/scheduler/v1"
29
31
  # client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new