google-cloud-scheduler-v1 0.4.1 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +15 -33
- data/README.md +1 -1
- data/lib/google/cloud/scheduler/v1/cloud_scheduler/client.rb +223 -81
- data/lib/google/cloud/scheduler/v1/cloudscheduler_pb.rb +2 -2
- data/lib/google/cloud/scheduler/v1/job_pb.rb +2 -2
- data/lib/google/cloud/scheduler/v1/target_pb.rb +2 -2
- data/lib/google/cloud/scheduler/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/resource.rb +10 -71
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d621605aeef7b6822bfd01949acd069f7921b3492598b40c4b31d1a0bff079
|
4
|
+
data.tar.gz: ea61cd81c34c3e412f6b668536b4e865f21533cbd919c9daf0097457432f626e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30e0e370a54d8d202f3aaeb84faeb11234ca83d8bd5f666a1b66fd2ac52c96905e9b4f453c714bc56496bc6c99156581dcef6a084230786b39096bbe8fe17e4
|
7
|
+
data.tar.gz: 04f1d01cd1f4ecd233d63b26a4f07290a2b84c890099e6e00cab3ad6c97b027f3f9f3de071ed941a1935285d7c6aff818453baa25e3735bc9c9553907042699a
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-scheduler-v1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Scheduler::V1::CloudScheduler::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `SCHEDULER_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `SCHEDULER_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/scheduler/v1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/scheduler/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config|
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/scheduler/v1"
|
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/scheduler/v1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Scheduler::V1::ListJobsRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.list_jobs request
|
38
38
|
```
|
39
39
|
|
@@ -42,13 +42,12 @@ module Google
|
|
42
42
|
# See {::Google::Cloud::Scheduler::V1::CloudScheduler::Client::Configuration}
|
43
43
|
# for a description of the configuration fields.
|
44
44
|
#
|
45
|
-
#
|
45
|
+
# @example
|
46
46
|
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
# end
|
47
|
+
# # Modify the configuration for all CloudScheduler clients
|
48
|
+
# ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
52
51
|
#
|
53
52
|
# @yield [config] Configure the Client client.
|
54
53
|
# @yieldparam config [Client::Configuration]
|
@@ -68,18 +67,12 @@ module Google
|
|
68
67
|
|
69
68
|
default_config.rpcs.list_jobs.timeout = 600.0
|
70
69
|
default_config.rpcs.list_jobs.retry_policy = {
|
71
|
-
initial_delay: 0.1,
|
72
|
-
max_delay: 60.0,
|
73
|
-
multiplier: 1.3,
|
74
|
-
retry_codes: [4, 14]
|
70
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
75
71
|
}
|
76
72
|
|
77
73
|
default_config.rpcs.get_job.timeout = 600.0
|
78
74
|
default_config.rpcs.get_job.retry_policy = {
|
79
|
-
initial_delay: 0.1,
|
80
|
-
max_delay: 60.0,
|
81
|
-
multiplier: 1.3,
|
82
|
-
retry_codes: [4, 14]
|
75
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
83
76
|
}
|
84
77
|
|
85
78
|
default_config.rpcs.create_job.timeout = 600.0
|
@@ -88,10 +81,7 @@ module Google
|
|
88
81
|
|
89
82
|
default_config.rpcs.delete_job.timeout = 600.0
|
90
83
|
default_config.rpcs.delete_job.retry_policy = {
|
91
|
-
initial_delay: 0.1,
|
92
|
-
max_delay: 60.0,
|
93
|
-
multiplier: 1.3,
|
94
|
-
retry_codes: [4, 14]
|
84
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
95
85
|
}
|
96
86
|
|
97
87
|
default_config.rpcs.pause_job.timeout = 600.0
|
@@ -129,19 +119,15 @@ module Google
|
|
129
119
|
##
|
130
120
|
# Create a new CloudScheduler client object.
|
131
121
|
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
# To create a new CloudScheduler client with the default
|
135
|
-
# configuration:
|
136
|
-
#
|
137
|
-
# client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
122
|
+
# @example
|
138
123
|
#
|
139
|
-
#
|
140
|
-
#
|
124
|
+
# # Create a client using the default configuration
|
125
|
+
# client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
141
126
|
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
127
|
+
# # Create a client using a custom configuration
|
128
|
+
# client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config|
|
129
|
+
# config.timeout = 10.0
|
130
|
+
# end
|
145
131
|
#
|
146
132
|
# @yield [config] Configure the CloudScheduler client.
|
147
133
|
# @yieldparam config [Client::Configuration]
|
@@ -161,14 +147,13 @@ module Google
|
|
161
147
|
|
162
148
|
# Create credentials
|
163
149
|
credentials = @config.credentials
|
164
|
-
# Use self-signed JWT if the
|
150
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
165
151
|
# but only if the default endpoint does not have a region prefix.
|
166
|
-
enable_self_signed_jwt = @config.
|
167
|
-
@config.endpoint == Client.configure.endpoint &&
|
152
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
168
153
|
!@config.endpoint.split(".").first.include?("-")
|
169
154
|
credentials ||= Credentials.default scope: @config.scope,
|
170
155
|
enable_self_signed_jwt: enable_self_signed_jwt
|
171
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
156
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
172
157
|
credentials = Credentials.new credentials, scope: @config.scope
|
173
158
|
end
|
174
159
|
@quota_project_id = @config.quota_project
|
@@ -230,6 +215,27 @@ module Google
|
|
230
215
|
#
|
231
216
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
232
217
|
#
|
218
|
+
# @example Basic example
|
219
|
+
# require "google/cloud/scheduler/v1"
|
220
|
+
#
|
221
|
+
# # Create a client object. The client can be reused for multiple calls.
|
222
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
223
|
+
#
|
224
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
225
|
+
# request = Google::Cloud::Scheduler::V1::ListJobsRequest.new
|
226
|
+
#
|
227
|
+
# # Call the list_jobs method.
|
228
|
+
# result = client.list_jobs request
|
229
|
+
#
|
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|
|
235
|
+
# # Each element is of type ::Google::Cloud::Scheduler::V1::Job.
|
236
|
+
# p response
|
237
|
+
# end
|
238
|
+
#
|
233
239
|
def list_jobs request, options = nil
|
234
240
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
235
241
|
|
@@ -247,16 +253,20 @@ module Google
|
|
247
253
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
248
254
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
249
255
|
|
250
|
-
header_params = {
|
251
|
-
|
252
|
-
|
256
|
+
header_params = {}
|
257
|
+
if request.parent
|
258
|
+
header_params["parent"] = request.parent
|
259
|
+
end
|
260
|
+
|
253
261
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
254
262
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
255
263
|
|
256
264
|
options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
|
257
265
|
metadata: metadata,
|
258
266
|
retry_policy: @config.rpcs.list_jobs.retry_policy
|
259
|
-
|
267
|
+
|
268
|
+
options.apply_defaults timeout: @config.timeout,
|
269
|
+
metadata: @config.metadata,
|
260
270
|
retry_policy: @config.retry_policy
|
261
271
|
|
262
272
|
@cloud_scheduler_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
@@ -298,6 +308,21 @@ module Google
|
|
298
308
|
#
|
299
309
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
300
310
|
#
|
311
|
+
# @example Basic example
|
312
|
+
# require "google/cloud/scheduler/v1"
|
313
|
+
#
|
314
|
+
# # Create a client object. The client can be reused for multiple calls.
|
315
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
316
|
+
#
|
317
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
318
|
+
# request = Google::Cloud::Scheduler::V1::GetJobRequest.new
|
319
|
+
#
|
320
|
+
# # Call the get_job method.
|
321
|
+
# result = client.get_job request
|
322
|
+
#
|
323
|
+
# # The returned object is of type Google::Cloud::Scheduler::V1::Job.
|
324
|
+
# p result
|
325
|
+
#
|
301
326
|
def get_job request, options = nil
|
302
327
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
303
328
|
|
@@ -315,16 +340,20 @@ module Google
|
|
315
340
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
316
341
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
317
342
|
|
318
|
-
header_params = {
|
319
|
-
|
320
|
-
|
343
|
+
header_params = {}
|
344
|
+
if request.name
|
345
|
+
header_params["name"] = request.name
|
346
|
+
end
|
347
|
+
|
321
348
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
322
349
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
323
350
|
|
324
351
|
options.apply_defaults timeout: @config.rpcs.get_job.timeout,
|
325
352
|
metadata: metadata,
|
326
353
|
retry_policy: @config.rpcs.get_job.retry_policy
|
327
|
-
|
354
|
+
|
355
|
+
options.apply_defaults timeout: @config.timeout,
|
356
|
+
metadata: @config.metadata,
|
328
357
|
retry_policy: @config.retry_policy
|
329
358
|
|
330
359
|
@cloud_scheduler_stub.call_rpc :get_job, request, options: options do |response, operation|
|
@@ -371,6 +400,21 @@ module Google
|
|
371
400
|
#
|
372
401
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
373
402
|
#
|
403
|
+
# @example Basic example
|
404
|
+
# require "google/cloud/scheduler/v1"
|
405
|
+
#
|
406
|
+
# # Create a client object. The client can be reused for multiple calls.
|
407
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
408
|
+
#
|
409
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
410
|
+
# request = Google::Cloud::Scheduler::V1::CreateJobRequest.new
|
411
|
+
#
|
412
|
+
# # Call the create_job method.
|
413
|
+
# result = client.create_job request
|
414
|
+
#
|
415
|
+
# # The returned object is of type Google::Cloud::Scheduler::V1::Job.
|
416
|
+
# p result
|
417
|
+
#
|
374
418
|
def create_job request, options = nil
|
375
419
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
376
420
|
|
@@ -388,16 +432,20 @@ module Google
|
|
388
432
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
389
433
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
390
434
|
|
391
|
-
header_params = {
|
392
|
-
|
393
|
-
|
435
|
+
header_params = {}
|
436
|
+
if request.parent
|
437
|
+
header_params["parent"] = request.parent
|
438
|
+
end
|
439
|
+
|
394
440
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
395
441
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
396
442
|
|
397
443
|
options.apply_defaults timeout: @config.rpcs.create_job.timeout,
|
398
444
|
metadata: metadata,
|
399
445
|
retry_policy: @config.rpcs.create_job.retry_policy
|
400
|
-
|
446
|
+
|
447
|
+
options.apply_defaults timeout: @config.timeout,
|
448
|
+
metadata: @config.metadata,
|
401
449
|
retry_policy: @config.retry_policy
|
402
450
|
|
403
451
|
@cloud_scheduler_stub.call_rpc :create_job, request, options: options do |response, operation|
|
@@ -450,6 +498,21 @@ module Google
|
|
450
498
|
#
|
451
499
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
452
500
|
#
|
501
|
+
# @example Basic example
|
502
|
+
# require "google/cloud/scheduler/v1"
|
503
|
+
#
|
504
|
+
# # Create a client object. The client can be reused for multiple calls.
|
505
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
506
|
+
#
|
507
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
508
|
+
# request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new
|
509
|
+
#
|
510
|
+
# # Call the update_job method.
|
511
|
+
# result = client.update_job request
|
512
|
+
#
|
513
|
+
# # The returned object is of type Google::Cloud::Scheduler::V1::Job.
|
514
|
+
# p result
|
515
|
+
#
|
453
516
|
def update_job request, options = nil
|
454
517
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
455
518
|
|
@@ -467,16 +530,20 @@ module Google
|
|
467
530
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
468
531
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
469
532
|
|
470
|
-
header_params = {
|
471
|
-
|
472
|
-
|
533
|
+
header_params = {}
|
534
|
+
if request.job&.name
|
535
|
+
header_params["job.name"] = request.job.name
|
536
|
+
end
|
537
|
+
|
473
538
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
474
539
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
475
540
|
|
476
541
|
options.apply_defaults timeout: @config.rpcs.update_job.timeout,
|
477
542
|
metadata: metadata,
|
478
543
|
retry_policy: @config.rpcs.update_job.retry_policy
|
479
|
-
|
544
|
+
|
545
|
+
options.apply_defaults timeout: @config.timeout,
|
546
|
+
metadata: @config.metadata,
|
480
547
|
retry_policy: @config.retry_policy
|
481
548
|
|
482
549
|
@cloud_scheduler_stub.call_rpc :update_job, request, options: options do |response, operation|
|
@@ -517,6 +584,21 @@ module Google
|
|
517
584
|
#
|
518
585
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
519
586
|
#
|
587
|
+
# @example Basic example
|
588
|
+
# require "google/cloud/scheduler/v1"
|
589
|
+
#
|
590
|
+
# # Create a client object. The client can be reused for multiple calls.
|
591
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
592
|
+
#
|
593
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
594
|
+
# request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new
|
595
|
+
#
|
596
|
+
# # Call the delete_job method.
|
597
|
+
# result = client.delete_job request
|
598
|
+
#
|
599
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
600
|
+
# p result
|
601
|
+
#
|
520
602
|
def delete_job request, options = nil
|
521
603
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
522
604
|
|
@@ -534,16 +616,20 @@ module Google
|
|
534
616
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
535
617
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
536
618
|
|
537
|
-
header_params = {
|
538
|
-
|
539
|
-
|
619
|
+
header_params = {}
|
620
|
+
if request.name
|
621
|
+
header_params["name"] = request.name
|
622
|
+
end
|
623
|
+
|
540
624
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
541
625
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
542
626
|
|
543
627
|
options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
|
544
628
|
metadata: metadata,
|
545
629
|
retry_policy: @config.rpcs.delete_job.retry_policy
|
546
|
-
|
630
|
+
|
631
|
+
options.apply_defaults timeout: @config.timeout,
|
632
|
+
metadata: @config.metadata,
|
547
633
|
retry_policy: @config.retry_policy
|
548
634
|
|
549
635
|
@cloud_scheduler_stub.call_rpc :delete_job, request, options: options do |response, operation|
|
@@ -590,6 +676,21 @@ module Google
|
|
590
676
|
#
|
591
677
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
592
678
|
#
|
679
|
+
# @example Basic example
|
680
|
+
# require "google/cloud/scheduler/v1"
|
681
|
+
#
|
682
|
+
# # Create a client object. The client can be reused for multiple calls.
|
683
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
684
|
+
#
|
685
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
686
|
+
# request = Google::Cloud::Scheduler::V1::PauseJobRequest.new
|
687
|
+
#
|
688
|
+
# # Call the pause_job method.
|
689
|
+
# result = client.pause_job request
|
690
|
+
#
|
691
|
+
# # The returned object is of type Google::Cloud::Scheduler::V1::Job.
|
692
|
+
# p result
|
693
|
+
#
|
593
694
|
def pause_job request, options = nil
|
594
695
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
595
696
|
|
@@ -607,16 +708,20 @@ module Google
|
|
607
708
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
608
709
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
609
710
|
|
610
|
-
header_params = {
|
611
|
-
|
612
|
-
|
711
|
+
header_params = {}
|
712
|
+
if request.name
|
713
|
+
header_params["name"] = request.name
|
714
|
+
end
|
715
|
+
|
613
716
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
614
717
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
615
718
|
|
616
719
|
options.apply_defaults timeout: @config.rpcs.pause_job.timeout,
|
617
720
|
metadata: metadata,
|
618
721
|
retry_policy: @config.rpcs.pause_job.retry_policy
|
619
|
-
|
722
|
+
|
723
|
+
options.apply_defaults timeout: @config.timeout,
|
724
|
+
metadata: @config.metadata,
|
620
725
|
retry_policy: @config.retry_policy
|
621
726
|
|
622
727
|
@cloud_scheduler_stub.call_rpc :pause_job, request, options: options do |response, operation|
|
@@ -662,6 +767,21 @@ module Google
|
|
662
767
|
#
|
663
768
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
664
769
|
#
|
770
|
+
# @example Basic example
|
771
|
+
# require "google/cloud/scheduler/v1"
|
772
|
+
#
|
773
|
+
# # Create a client object. The client can be reused for multiple calls.
|
774
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
775
|
+
#
|
776
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
777
|
+
# request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new
|
778
|
+
#
|
779
|
+
# # Call the resume_job method.
|
780
|
+
# result = client.resume_job request
|
781
|
+
#
|
782
|
+
# # The returned object is of type Google::Cloud::Scheduler::V1::Job.
|
783
|
+
# p result
|
784
|
+
#
|
665
785
|
def resume_job request, options = nil
|
666
786
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
667
787
|
|
@@ -679,16 +799,20 @@ module Google
|
|
679
799
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
680
800
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
681
801
|
|
682
|
-
header_params = {
|
683
|
-
|
684
|
-
|
802
|
+
header_params = {}
|
803
|
+
if request.name
|
804
|
+
header_params["name"] = request.name
|
805
|
+
end
|
806
|
+
|
685
807
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
686
808
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
687
809
|
|
688
810
|
options.apply_defaults timeout: @config.rpcs.resume_job.timeout,
|
689
811
|
metadata: metadata,
|
690
812
|
retry_policy: @config.rpcs.resume_job.retry_policy
|
691
|
-
|
813
|
+
|
814
|
+
options.apply_defaults timeout: @config.timeout,
|
815
|
+
metadata: @config.metadata,
|
692
816
|
retry_policy: @config.retry_policy
|
693
817
|
|
694
818
|
@cloud_scheduler_stub.call_rpc :resume_job, request, options: options do |response, operation|
|
@@ -732,6 +856,21 @@ module Google
|
|
732
856
|
#
|
733
857
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
734
858
|
#
|
859
|
+
# @example Basic example
|
860
|
+
# require "google/cloud/scheduler/v1"
|
861
|
+
#
|
862
|
+
# # Create a client object. The client can be reused for multiple calls.
|
863
|
+
# client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new
|
864
|
+
#
|
865
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
866
|
+
# request = Google::Cloud::Scheduler::V1::RunJobRequest.new
|
867
|
+
#
|
868
|
+
# # Call the run_job method.
|
869
|
+
# result = client.run_job request
|
870
|
+
#
|
871
|
+
# # The returned object is of type Google::Cloud::Scheduler::V1::Job.
|
872
|
+
# p result
|
873
|
+
#
|
735
874
|
def run_job request, options = nil
|
736
875
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
737
876
|
|
@@ -749,16 +888,20 @@ module Google
|
|
749
888
|
gapic_version: ::Google::Cloud::Scheduler::V1::VERSION
|
750
889
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
751
890
|
|
752
|
-
header_params = {
|
753
|
-
|
754
|
-
|
891
|
+
header_params = {}
|
892
|
+
if request.name
|
893
|
+
header_params["name"] = request.name
|
894
|
+
end
|
895
|
+
|
755
896
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
756
897
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
757
898
|
|
758
899
|
options.apply_defaults timeout: @config.rpcs.run_job.timeout,
|
759
900
|
metadata: metadata,
|
760
901
|
retry_policy: @config.rpcs.run_job.retry_policy
|
761
|
-
|
902
|
+
|
903
|
+
options.apply_defaults timeout: @config.timeout,
|
904
|
+
metadata: @config.metadata,
|
762
905
|
retry_policy: @config.retry_policy
|
763
906
|
|
764
907
|
@cloud_scheduler_stub.call_rpc :run_job, request, options: options do |response, operation|
|
@@ -782,22 +925,21 @@ module Google
|
|
782
925
|
# Configuration can be applied globally to all clients, or to a single client
|
783
926
|
# on construction.
|
784
927
|
#
|
785
|
-
#
|
786
|
-
#
|
787
|
-
#
|
788
|
-
# to 20 seconds,
|
789
|
-
#
|
790
|
-
#
|
791
|
-
#
|
792
|
-
#
|
793
|
-
#
|
794
|
-
#
|
795
|
-
#
|
796
|
-
#
|
797
|
-
#
|
798
|
-
#
|
799
|
-
#
|
800
|
-
# end
|
928
|
+
# @example
|
929
|
+
#
|
930
|
+
# # Modify the global config, setting the timeout for
|
931
|
+
# # list_jobs to 20 seconds,
|
932
|
+
# # and all remaining timeouts to 10 seconds.
|
933
|
+
# ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.configure do |config|
|
934
|
+
# config.timeout = 10.0
|
935
|
+
# config.rpcs.list_jobs.timeout = 20.0
|
936
|
+
# end
|
937
|
+
#
|
938
|
+
# # Apply the above configuration only to a new client.
|
939
|
+
# client = ::Google::Cloud::Scheduler::V1::CloudScheduler::Client.new do |config|
|
940
|
+
# config.timeout = 10.0
|
941
|
+
# config.rpcs.list_jobs.timeout = 20.0
|
942
|
+
# end
|
801
943
|
#
|
802
944
|
# @!attribute [rw] endpoint
|
803
945
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1,8 +1,6 @@
|
|
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
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
|
|
10
8
|
require 'google/cloud/scheduler/v1/job_pb'
|
11
9
|
require 'google/protobuf/empty_pb'
|
12
10
|
require 'google/protobuf/field_mask_pb'
|
11
|
+
require 'google/protobuf'
|
12
|
+
|
13
13
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
14
|
add_file("google/cloud/scheduler/v1/cloudscheduler.proto", :syntax => :proto3) do
|
15
15
|
add_message "google.cloud.scheduler.v1.ListJobsRequest" do
|
@@ -1,14 +1,14 @@
|
|
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
|
-
|
6
4
|
require 'google/api/resource_pb'
|
7
5
|
require 'google/cloud/scheduler/v1/target_pb'
|
8
6
|
require 'google/protobuf/duration_pb'
|
9
7
|
require 'google/protobuf/timestamp_pb'
|
10
8
|
require 'google/rpc/status_pb'
|
11
9
|
require 'google/api/annotations_pb'
|
10
|
+
require 'google/protobuf'
|
11
|
+
|
12
12
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
13
13
|
add_file("google/cloud/scheduler/v1/job.proto", :syntax => :proto3) do
|
14
14
|
add_message "google.cloud.scheduler.v1.Job" 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/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/resource_pb'
|
7
5
|
require 'google/api/annotations_pb'
|
6
|
+
require 'google/protobuf'
|
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
|
@@ -57,9 +57,15 @@ module Google
|
|
57
57
|
|
58
58
|
# Denotes that a (repeated) field is an unordered list.
|
59
59
|
# This indicates that the service may provide the elements of the list
|
60
|
-
# in any arbitrary
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
61
|
# provided. Additionally, the list's order may or may not be stable.
|
62
62
|
UNORDERED_LIST = 6
|
63
|
+
|
64
|
+
# Denotes that this field returns a non-empty default value if not set.
|
65
|
+
# This indicates that if the user provides the empty value in a request,
|
66
|
+
# a non-empty value will be returned. The user will not be aware of what
|
67
|
+
# non-empty value to expect.
|
68
|
+
NON_EMPTY_DEFAULT = 7
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
@@ -33,11 +33,7 @@ module Google
|
|
33
33
|
# // For Kubernetes resources, the format is {api group}/{kind}.
|
34
34
|
# option (google.api.resource) = {
|
35
35
|
# type: "pubsub.googleapis.com/Topic"
|
36
|
-
#
|
37
|
-
# pattern: "projects/{project}/topics/{topic}"
|
38
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
39
|
-
# parent_name_extractor: "projects/{project}"
|
40
|
-
# }
|
36
|
+
# pattern: "projects/{project}/topics/{topic}"
|
41
37
|
# };
|
42
38
|
# }
|
43
39
|
#
|
@@ -45,10 +41,7 @@ module Google
|
|
45
41
|
#
|
46
42
|
# resources:
|
47
43
|
# - type: "pubsub.googleapis.com/Topic"
|
48
|
-
#
|
49
|
-
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
-
# parent_name_extractor: "projects/{project}"
|
44
|
+
# pattern: "projects/{project}/topics/{topic}"
|
52
45
|
#
|
53
46
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
47
|
# live under multiple parents.
|
@@ -58,26 +51,10 @@ module Google
|
|
58
51
|
# message LogEntry {
|
59
52
|
# option (google.api.resource) = {
|
60
53
|
# type: "logging.googleapis.com/LogEntry"
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# }
|
66
|
-
# name_descriptor: {
|
67
|
-
# pattern: "folders/{folder}/logs/{log}"
|
68
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
69
|
-
# parent_name_extractor: "folders/{folder}"
|
70
|
-
# }
|
71
|
-
# name_descriptor: {
|
72
|
-
# pattern: "organizations/{organization}/logs/{log}"
|
73
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
74
|
-
# parent_name_extractor: "organizations/{organization}"
|
75
|
-
# }
|
76
|
-
# name_descriptor: {
|
77
|
-
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
78
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
79
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
80
|
-
# }
|
54
|
+
# pattern: "projects/{project}/logs/{log}"
|
55
|
+
# pattern: "folders/{folder}/logs/{log}"
|
56
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
57
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
81
58
|
# };
|
82
59
|
# }
|
83
60
|
#
|
@@ -85,48 +62,10 @@ module Google
|
|
85
62
|
#
|
86
63
|
# resources:
|
87
64
|
# - type: 'logging.googleapis.com/LogEntry'
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# - pattern: "folders/{folder}/logs/{log}"
|
93
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
94
|
-
# parent_name_extractor: "folders/{folder}"
|
95
|
-
# - pattern: "organizations/{organization}/logs/{log}"
|
96
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
97
|
-
# parent_name_extractor: "organizations/{organization}"
|
98
|
-
# - pattern: "billingAccounts/{billing_account}/logs/{log}"
|
99
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
100
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
101
|
-
#
|
102
|
-
# For flexible resources, the resource name doesn't contain parent names, but
|
103
|
-
# the resource itself has parents for policy evaluation.
|
104
|
-
#
|
105
|
-
# Example:
|
106
|
-
#
|
107
|
-
# message Shelf {
|
108
|
-
# option (google.api.resource) = {
|
109
|
-
# type: "library.googleapis.com/Shelf"
|
110
|
-
# name_descriptor: {
|
111
|
-
# pattern: "shelves/{shelf}"
|
112
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
113
|
-
# }
|
114
|
-
# name_descriptor: {
|
115
|
-
# pattern: "shelves/{shelf}"
|
116
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
117
|
-
# }
|
118
|
-
# };
|
119
|
-
# }
|
120
|
-
#
|
121
|
-
# The ResourceDescriptor Yaml config will look like:
|
122
|
-
#
|
123
|
-
# resources:
|
124
|
-
# - type: 'library.googleapis.com/Shelf'
|
125
|
-
# name_descriptor:
|
126
|
-
# - pattern: "shelves/{shelf}"
|
127
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
128
|
-
# - pattern: "shelves/{shelf}"
|
129
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
65
|
+
# pattern: "projects/{project}/logs/{log}"
|
66
|
+
# pattern: "folders/{folder}/logs/{log}"
|
67
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
68
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
130
69
|
# @!attribute [rw] type
|
131
70
|
# @return [::String]
|
132
71
|
# The resource type. It must be in the format of
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-scheduler-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.7'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0'
|
217
217
|
requirements: []
|
218
|
-
rubygems_version: 3.
|
218
|
+
rubygems_version: 3.3.4
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: API Client library for the Cloud Scheduler V1 API
|