google-cloud-scheduler 2.6.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51bbfb2d430ed4fe9625b3cf3cb268ea7d9a66229bbbae1d55c3f490a58eeab7
4
- data.tar.gz: 86da4c35b5a31e484520a861fde5f755a9c2824950d226c2494d07c8b7651348
3
+ metadata.gz: 146e7b2e2ba3614b4c1b4de905b10e3ea675e36f06f500b4734b6d68d8ca081a
4
+ data.tar.gz: 6ed470bb638760e06a0bae4928e8031928e852e5b6e21948f69e2c92d2b483b0
5
5
  SHA512:
6
- metadata.gz: ce8d2f4e8e9f335969a65455bcc195a273c2477f65a3beb3befcb89f850c20a170f728f2905863253f2d19ebbe6d81332758933641cbdaaa89213fc536714265
7
- data.tar.gz: b847865fe52b303fb0e9063cafda293eb7e6aace0a56d7c006b59568184b14925e649ceff8908899e6e5c5a26247cfa5bb6a332760332d432cc2593fd9dcad9f
6
+ metadata.gz: 21d00a7319bb4ec0e4ebfb0c67c9c4754e3d2a42b9112128f539c49609f0422f7d21f66716e267d20c521b71201215cf2123df79a9458ab527b3f4e8f101c961
7
+ data.tar.gz: 97700ee580056c9814d2f38e2ee3b239a2df510156d46e559fa64772607f79f4c25176f64fd905bf69b23f471dd3842d52f634f0547b3401af99fc72fe59042c
data/.yardopts CHANGED
@@ -8,5 +8,4 @@
8
8
  -
9
9
  README.md
10
10
  AUTHENTICATION.md
11
- MIGRATING.md
12
11
  LICENSE.md
data/README.md CHANGED
@@ -16,8 +16,7 @@ for this library, google-cloud-scheduler, to see the convenience methods for
16
16
  constructing client objects. Reference documentation for the client objects
17
17
  themselves can be found in the client library documentation for the versioned
18
18
  client gems:
19
- [google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest),
20
- [google-cloud-scheduler-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1beta1/latest).
19
+ [google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest).
21
20
 
22
21
  See also the [Product Documentation](https://cloud.google.com/scheduler)
23
22
  for more usage information.
@@ -35,17 +34,39 @@ In order to use this library, you first need to go through the following steps:
35
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudscheduler.googleapis.com)
36
35
  1. {file:AUTHENTICATION.md Set up authentication.}
37
36
 
38
- ## Migrating from 1.x versions
39
-
40
- The 2.0 release of the google-cloud-scheduler client is a significant upgrade
41
- based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
42
- and includes substantial interface changes. Existing code written for earlier
43
- versions of this library will likely require updates to use this version.
44
- See the {file:MIGRATING.md MIGRATING.md} document for more information.
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-scheduler-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-scheduler-v1/latest).
45
66
 
46
67
  ## Supported Ruby Versions
47
68
 
48
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
49
70
 
50
71
  Google provides official support for Ruby versions that are actively supported
51
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Scheduler
23
- VERSION = "2.6.1"
23
+ VERSION = "3.0.0"
24
24
  end
25
25
  end
26
26
  end
@@ -58,6 +58,11 @@ module Google
58
58
  # You can also specify a different transport by passing `:rest` or `:grpc` in
59
59
  # the `transport` parameter.
60
60
  #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the CloudScheduler service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::Scheduler.cloud_scheduler_available?}.
65
+ #
61
66
  # ## About CloudScheduler
62
67
  #
63
68
  # The Cloud Scheduler API allows external entities to reliably
@@ -80,6 +85,37 @@ module Google
80
85
  service_module.const_get(:Client).new(&block)
81
86
  end
82
87
 
88
+ ##
89
+ # Determines whether the CloudScheduler service is supported by the current client.
90
+ # If true, you can retrieve a client object by calling {Google::Cloud::Scheduler.cloud_scheduler}.
91
+ # If false, that method will raise an exception. This could happen if the given
92
+ # API version does not exist or does not support the CloudScheduler service,
93
+ # or if the versioned client gem needs an update to support the CloudScheduler service.
94
+ #
95
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
96
+ # Defaults to `:v1`.
97
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
98
+ # @return [boolean] Whether the service is available.
99
+ #
100
+ def self.cloud_scheduler_available? version: :v1, transport: :grpc
101
+ require "google/cloud/scheduler/#{version.to_s.downcase}"
102
+ package_name = Google::Cloud::Scheduler
103
+ .constants
104
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
105
+ .first
106
+ return false unless package_name
107
+ service_module = Google::Cloud::Scheduler.const_get package_name
108
+ return false unless service_module.const_defined? :CloudScheduler
109
+ service_module = service_module.const_get :CloudScheduler
110
+ if transport == :rest
111
+ return false unless service_module.const_defined? :Rest
112
+ service_module = service_module.const_get :Rest
113
+ end
114
+ service_module.const_defined? :Client
115
+ rescue ::LoadError
116
+ false
117
+ end
118
+
83
119
  ##
84
120
  # Configure the google-cloud-scheduler library.
85
121
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
10
+ date: 2025-02-13 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -28,42 +27,16 @@ dependencies:
28
27
  name: google-cloud-scheduler-v1
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0.10'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: 2.a
37
- type: :runtime
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: '0.10'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: 2.a
47
- - !ruby/object:Gem::Dependency
48
- name: google-cloud-scheduler-v1beta1
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '0.10'
54
- - - "<"
30
+ - - "~>"
55
31
  - !ruby/object:Gem::Version
56
- version: 2.a
32
+ version: '1.2'
57
33
  type: :runtime
58
34
  prerelease: false
59
35
  version_requirements: !ruby/object:Gem::Requirement
60
36
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0.10'
64
- - - "<"
37
+ - - "~>"
65
38
  - !ruby/object:Gem::Version
66
- version: 2.a
39
+ version: '1.2'
67
40
  description: Cloud Scheduler is a fully managed enterprise-grade cron job scheduler.
68
41
  It allows you to schedule virtually any job, including batch, big data jobs, cloud
69
42
  infrastructure operations, and more. You can automate everything, including retries
@@ -78,7 +51,6 @@ files:
78
51
  - ".yardopts"
79
52
  - AUTHENTICATION.md
80
53
  - LICENSE.md
81
- - MIGRATING.md
82
54
  - README.md
83
55
  - lib/google-cloud-scheduler.rb
84
56
  - lib/google/cloud/scheduler.rb
@@ -87,7 +59,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
87
59
  licenses:
88
60
  - Apache-2.0
89
61
  metadata: {}
90
- post_install_message:
91
62
  rdoc_options: []
92
63
  require_paths:
93
64
  - lib
@@ -95,15 +66,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
66
  requirements:
96
67
  - - ">="
97
68
  - !ruby/object:Gem::Version
98
- version: '2.7'
69
+ version: '3.0'
99
70
  required_rubygems_version: !ruby/object:Gem::Requirement
100
71
  requirements:
101
72
  - - ">="
102
73
  - !ruby/object:Gem::Version
103
74
  version: '0'
104
75
  requirements: []
105
- rubygems_version: 3.5.6
106
- signing_key:
76
+ rubygems_version: 3.6.3
107
77
  specification_version: 4
108
78
  summary: API Client library for the Cloud Scheduler API
109
79
  test_files: []
data/MIGRATING.md DELETED
@@ -1,321 +0,0 @@
1
- ## Migrating to google-cloud-scheduler 2.0
2
-
3
- The 2.0 release of the google-cloud-scheduler client is a significant upgrade
4
- based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
5
- and includes substantial interface changes. Existing code written for earlier
6
- versions of this library will likely require updates to use this version.
7
- This document describes the changes that have been made, and what you need to
8
- do to update your usage.
9
-
10
- To summarize:
11
-
12
- * The library has been broken out into three libraries. The new gems
13
- `google-cloud-scheduler-v1` and `google-cloud-scheduler-v1beta1` contain the
14
- actual client classes for versions V1 and V1beta1 of the Cloud Scheduler
15
- service, and the gem `google-cloud-scheduler` now simply provides a
16
- convenience wrapper. See [Library Structure](#library-structure) for more
17
- info.
18
- * The library uses a new configuration mechanism giving you closer control
19
- over endpoint address, network timeouts, and retry. See
20
- [Client Configuration](#client-configuration) for more info. Furthermore,
21
- when creating a client object, you can customize its configuration in a
22
- block rather than passing arguments to the constructor. See
23
- [Creating Clients](#creating-clients) for more info.
24
- * Previously, positional arguments were used to indicate required arguments.
25
- Now, all method arguments are keyword arguments, with documentation that
26
- specifies whether they are required or optional. Additionally, you can pass
27
- a proto request object instead of separate arguments. See
28
- [Passing Arguments](#passing-arguments) for more info.
29
- * Previously, some client classes included helper methods for constructing
30
- resource paths. These methods now take keyword rather than positional
31
- arguments, and are also available in a separate paths module. See
32
- [Resource Path Helpers](#resource-path-helpers) for more info.
33
- * Previously, clients reported RPC errors by raising instances of
34
- `Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
35
- `Google::Cloud::Error` and its subclasses. See
36
- [Handling Errors](#handling-errors) for more info.
37
- * Some classes have moved into different namespaces. See
38
- [Class Namespaces](#class-namespaces) for more info.
39
-
40
- ### Library Structure
41
-
42
- Older 1.x releases of the `google-cloud-scheduler` gem were all-in-one gems that
43
- included potentially multiple clients for multiple versions of the Cloud
44
- Scheduler service. The `Google::Cloud::Scheduler.new` factory method would
45
- return you an instance of a `Google::Cloud::Scheduler::V1::CloudSchedulerClient`
46
- object for the V1 version of the service, or a
47
- `Google::Cloud::Scheduler::V1beta1::CloudSchedulerClient` object for the
48
- V1beta1 version of the service. All these classes were defined in the same gem.
49
-
50
- With the 2.0 release, the `google-cloud-scheduler` gem still provides factory
51
- methods for obtaining clients. (The method signatures will have changed. See
52
- [Creating Clients](#creating-clients) for details.) However, the actual client
53
- classes have been moved into separate gems, one per service version. The
54
- `Google::Cloud::Scheduler::V1::CloudScheduler::Client` class, along with its
55
- helpers and data types, is now part of the `google-cloud-scheduler-v1` gem.
56
- Similarly, the `Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client`
57
- class is part of the `google-cloud-scheduler-v1beta1` gem.
58
-
59
- For normal usage, you can continue to install the `google-cloud-scheduler` gem
60
- (which will bring in the versioned client gems as dependencies) and continue to
61
- use factory methods to create clients. However, you may alternatively choose to
62
- install only one of the versioned gems. For example, if you know you will use only
63
- `V1` of the service, you can install `google-cloud-scheduler-v1` by itself, and
64
- construct instances of the
65
- `Google::Cloud::Scheduler::V1::CloudScheduler::Client` client class directly.
66
-
67
- ### Client Configuration
68
-
69
- In older releases, if you wanted to customize performance parameters or
70
- low-level behavior of the client (such as credentials, timeouts, or
71
- instrumentation), you would pass a variety of keyword arguments to the client
72
- constructor. It was also extremely difficult to customize the default settings.
73
-
74
- With the 2.0 release, a configuration interface provides control over these
75
- parameters, including defaults for all instances of a client, and settings for
76
- each specific client instance. For example, to set default credentials and
77
- timeout for all Cloud Scheduler V1 clients:
78
-
79
- ```
80
- Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config|
81
- config.credentials = "/path/to/credentials.json"
82
- config.timeout = 10.0
83
- end
84
- ```
85
-
86
- Individual RPCs can also be configured independently. For example, to set the
87
- timeout for the `list_jobs` call:
88
-
89
- ```
90
- Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config|
91
- config.rpcs.list_jobs.timeout = 20.0
92
- end
93
- ```
94
-
95
- Defaults for certain configurations can be set for all Scheduler versions
96
- globally:
97
-
98
- ```
99
- Google::Cloud::Scheduler.configure do |config|
100
- config.credentials = "/path/to/credentials.json"
101
- config.timeout = 10.0
102
- end
103
- ```
104
-
105
- Finally, you can override the configuration for each client instance. See the
106
- next section on [Creating Clients](#creating-clients) for details.
107
-
108
- ### Creating Clients
109
-
110
- In older releases, to create a client object, you would use the
111
- `Google::Cloud::Scheduler.new` class method. Keyword arguments were available to
112
- select a service version and to configure parameters such as credentials and
113
- timeouts.
114
-
115
- With the 2.0 release, use the `Google::Cloud::Scheduler.cloud_scheduler` class
116
- method to create a client object. You may select a service version using the
117
- `:version` keyword argument. However, other configuration parameters should be
118
- set in a configuration block when you create the client.
119
-
120
- Old:
121
- ```
122
- client = Google::Cloud::Scheduler.new credentials: "/path/to/credentials.json"
123
- ```
124
-
125
- New:
126
- ```
127
- client = Google::Cloud::Scheduler.cloud_scheduler do |config|
128
- config.credentials = "/path/to/credentials.json"
129
- end
130
- ```
131
-
132
- The configuration block is optional. If you do not provide it, or you do not
133
- set some configuration parameters, then the default configuration is used. See
134
- [Client Configuration](#client-configuration).
135
-
136
- ### Passing Arguments
137
-
138
- In older releases, required arguments would be passed as positional method
139
- arguments, while most optional arguments would be passed as keyword arguments.
140
-
141
- With the 2.0 release, all RPC arguments are passed as keyword arguments,
142
- regardless of whether they are required or optional. For example:
143
-
144
- Old:
145
- ```
146
- client = Google::Cloud::Scheduler.new
147
-
148
- parent = "projects/my-project/locations/-"
149
-
150
- # Parent is a positional argument, while page_size is a keyword argument.
151
- response = client.list_jobs parent, page_size: 10
152
- ```
153
-
154
- New:
155
- ```
156
- client = Google::Cloud::Scheduler.cloud_scheduler
157
-
158
- parent = "projects/my-project/locations/-"
159
-
160
- # Both parent and page_size are keyword arguments.
161
- response = client.list_jobs parent: parent, page_size: 10
162
- ```
163
-
164
- In the 2.0 release, it is also possible to pass a request object, either
165
- as a hash or as a protocol buffer.
166
-
167
- New:
168
- ```
169
- client = Google::Cloud::Scheduler.cloud_scheduler
170
-
171
- request = Google::Cloud::Scheduler::V1::ListJobsRequest.new(
172
- parent: "projects/my-project/locations/-",
173
- page_size: 10
174
- )
175
-
176
- # Pass a request object as a positional argument:
177
- response = client.list_jobs request
178
- ```
179
-
180
- Finally, in older releases, to provide call options, you would pass a
181
- `Google::Gax::CallOptions` object with the `:options` keyword argument. In the
182
- 2.0 release, pass call options using a _second set_ of keyword arguments.
183
-
184
- Old:
185
- ```
186
- client = Google::Cloud::Scheduler.new
187
-
188
- parent = "projects/my-project/locations/-"
189
-
190
- options = Google::Gax::CallOptions.new timeout: 10.0
191
-
192
- response = client.list_jobs parent, page_size: 10, options: options
193
- ```
194
-
195
- New:
196
- ```
197
- client = Google::Cloud::Scheduler.cloud_scheduler
198
-
199
- parent = "projects/my-project/locations/-"
200
-
201
- # Use a hash to wrap the normal call arguments (or pass a request object), and
202
- # then add further keyword arguments for the call options.
203
- response = client.list_jobs(
204
- { parent: parent, page_size: 10 },
205
- timeout: 10.0
206
- )
207
- ```
208
-
209
- ### Resource Path Helpers
210
-
211
- The client library includes helper methods for generating the resource path
212
- strings passed to many calls. These helpers have changed in two ways:
213
-
214
- * In older releases, they are both _class_ methods and _instance_ methods on
215
- the client class. In the 2.0 release, they are _instance methods only_.
216
- However, they are also available on a separate paths module that you can
217
- include elsewhere for convenience.
218
- * In older releases, arguments to a resource path helper are passed as
219
- _positional_ arguments. In the 2.0 release, they are passed as named _keyword_
220
- arguments.
221
-
222
- Following is an example involving using a resource path helper.
223
-
224
- Old:
225
- ```
226
- client = Google::Cloud::Scheduler.new
227
-
228
- # Call the helper using positional arguments.
229
- parent = client.location_path "my-project", "-"
230
-
231
- response = client.list_jobs parent
232
- ```
233
-
234
- New:
235
- ```
236
- client = Google::Cloud::Scheduler.cloud_scheduler
237
-
238
- # Call the helper using keyword arguments
239
- parent = client.location_path project: "my-project", location: "-"
240
-
241
- response = client.list_jobs parent: parent
242
- ```
243
-
244
- In the 2.0 client, you can also use the paths module as a convenience module.
245
-
246
- New:
247
- ```
248
- # Bring the path helper methods into the current class
249
- include Google::Cloud::Scheduler::V1::CloudScheduler::Paths
250
-
251
- def foo
252
- client = Google::Cloud::Scheduler.cloud_scheduler
253
-
254
- # Call the included helper method
255
- parent = location_path project: "my-project", location: "-"
256
-
257
- response = client.list_jobs parent: parent
258
-
259
- # Do something with response...
260
- end
261
- ```
262
-
263
- ### Handling Errors
264
-
265
- The client reports standard
266
- [gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
267
- by raising exceptions. In older releases, these exceptions were located in the
268
- `Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
269
- exception class, defined in the `google-gax` gem. However, these classes were
270
- different from the standard exceptions (subclasses of `Google::Cloud::Error`)
271
- thrown by other client libraries such as `google-cloud-storage`.
272
-
273
- The 2.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
274
- for consistency across all the Google Cloud client libraries. In general, these
275
- exceptions have the same name as their counterparts from older releases, but
276
- are located in the `Google::Cloud` namespace rather than the `Google::Gax`
277
- namespace.
278
-
279
- Old:
280
- ```
281
- client = Google::Cloud::Scheduler.new
282
-
283
- parent = "projects/my-project/locations/-"
284
-
285
- begin
286
- response = client.list_jobs parent, page_size: 10
287
- rescue Google::Gax::Error => e
288
- # Handle exceptions that subclass Google::Gax::Error
289
- end
290
- ```
291
-
292
- New:
293
- ```
294
- client = Google::Cloud::Scheduler.cloud_scheduler
295
-
296
- parent = "projects/my-project/locations/-"
297
-
298
- begin
299
- response = client.list_jobs parent: parent, page_size: 10
300
- rescue Google::Cloud::Error => e
301
- # Handle exceptions that subclass Google::Cloud::Error
302
- end
303
- ```
304
-
305
- ### Class Namespaces
306
-
307
- In older releases, the client object was of class
308
- `Google::Cloud::Scheduler::V1::CloudSchedulerClient`.
309
- In the 2.0 release, the client object is of class
310
- `Google::Cloud::Scheduler::V1::CloudScheduler::Client`.
311
- Note that most users will use the `Google::Cloud::Scheduler.cloud_scheduler`
312
- factory method to create instances of the client object, so you may not need to
313
- reference the actual class directly.
314
- See [Creating Clients](#creating-clients).
315
-
316
- In older releases, the credentials object was of class
317
- `Google::Cloud::Scheduler::V1::Credentials`.
318
- In the 2.0 release, the credentials object is of class
319
- `Google::Cloud::Scheduler::V1::CloudScheduler::Credentials`.
320
- Again, most users will not need to reference this class directly.
321
- See [Client Configuration](#client-configuration).