google-cloud-dataproc-v1beta2 0.5.0 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/LICENSE.md +188 -190
- data/README.md +3 -3
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/client.rb +55 -61
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/paths.rb +1 -1
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller/client.rb +76 -89
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller/operations.rb +39 -30
- data/lib/google/cloud/dataproc/v1beta2/clusters_services_pb.rb +4 -4
- data/lib/google/cloud/dataproc/v1beta2/job_controller/client.rb +80 -94
- data/lib/google/cloud/dataproc/v1beta2/job_controller/operations.rb +39 -30
- data/lib/google/cloud/dataproc/v1beta2/jobs_services_pb.rb +2 -2
- data/lib/google/cloud/dataproc/v1beta2/version.rb +1 -1
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/client.rb +68 -82
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/operations.rb +39 -30
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb +1 -1
- data/lib/google/cloud/dataproc/v1beta2/workflow_templates_services_pb.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- metadata +16 -10
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -169,7 +169,9 @@ module Google
|
|
169
169
|
options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
|
170
170
|
metadata: metadata,
|
171
171
|
retry_policy: @config.rpcs.list_operations.retry_policy
|
172
|
-
|
172
|
+
|
173
|
+
options.apply_defaults timeout: @config.timeout,
|
174
|
+
metadata: @config.metadata,
|
173
175
|
retry_policy: @config.retry_policy
|
174
176
|
|
175
177
|
@operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
|
@@ -239,7 +241,9 @@ module Google
|
|
239
241
|
options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
|
240
242
|
metadata: metadata,
|
241
243
|
retry_policy: @config.rpcs.get_operation.retry_policy
|
242
|
-
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
243
247
|
retry_policy: @config.retry_policy
|
244
248
|
|
245
249
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
@@ -309,7 +313,9 @@ module Google
|
|
309
313
|
options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
|
310
314
|
metadata: metadata,
|
311
315
|
retry_policy: @config.rpcs.delete_operation.retry_policy
|
312
|
-
|
316
|
+
|
317
|
+
options.apply_defaults timeout: @config.timeout,
|
318
|
+
metadata: @config.metadata,
|
313
319
|
retry_policy: @config.retry_policy
|
314
320
|
|
315
321
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
@@ -384,7 +390,9 @@ module Google
|
|
384
390
|
options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
|
385
391
|
metadata: metadata,
|
386
392
|
retry_policy: @config.rpcs.cancel_operation.retry_policy
|
387
|
-
|
393
|
+
|
394
|
+
options.apply_defaults timeout: @config.timeout,
|
395
|
+
metadata: @config.metadata,
|
388
396
|
retry_policy: @config.retry_policy
|
389
397
|
|
390
398
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
@@ -396,9 +404,9 @@ module Google
|
|
396
404
|
end
|
397
405
|
|
398
406
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
407
|
+
# Waits until the specified long-running operation is done or reaches at most
|
408
|
+
# a specified timeout, returning the latest state. If the operation is
|
409
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
410
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
411
|
# timeout is used. If the server does not support this method, it returns
|
404
412
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -456,7 +464,9 @@ module Google
|
|
456
464
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
465
|
metadata: metadata,
|
458
466
|
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
-
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.timeout,
|
469
|
+
metadata: @config.metadata,
|
460
470
|
retry_policy: @config.retry_policy
|
461
471
|
|
462
472
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
@@ -481,22 +491,21 @@ module Google
|
|
481
491
|
# Configuration can be applied globally to all clients, or to a single client
|
482
492
|
# on construction.
|
483
493
|
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
# To modify the global config, setting the timeout for list_operations
|
487
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
488
|
-
#
|
489
|
-
# ::Google::Longrunning::Operations::Client.configure do |config|
|
490
|
-
# config.timeout = 10.0
|
491
|
-
# config.rpcs.list_operations.timeout = 20.0
|
492
|
-
# end
|
494
|
+
# @example
|
493
495
|
#
|
494
|
-
#
|
496
|
+
# # Modify the global config, setting the timeout for
|
497
|
+
# # list_operations to 20 seconds,
|
498
|
+
# # and all remaining timeouts to 10 seconds.
|
499
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
500
|
+
# config.timeout = 10.0
|
501
|
+
# config.rpcs.list_operations.timeout = 20.0
|
502
|
+
# end
|
495
503
|
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
#
|
504
|
+
# # Apply the above configuration only to a new client.
|
505
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
506
|
+
# config.timeout = 10.0
|
507
|
+
# config.rpcs.list_operations.timeout = 20.0
|
508
|
+
# end
|
500
509
|
#
|
501
510
|
# @!attribute [rw] endpoint
|
502
511
|
# The hostname or hostname:port of the service endpoint.
|
@@ -560,7 +569,7 @@ module Google
|
|
560
569
|
config_attr :scope, nil, ::String, ::Array, nil
|
561
570
|
config_attr :lib_name, nil, ::String, nil
|
562
571
|
config_attr :lib_version, nil, ::String, nil
|
563
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
572
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
564
573
|
config_attr :interceptors, nil, ::Array, nil
|
565
574
|
config_attr :timeout, nil, ::Numeric, nil
|
566
575
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -581,7 +590,7 @@ module Google
|
|
581
590
|
def rpcs
|
582
591
|
@rpcs ||= begin
|
583
592
|
parent_rpcs = nil
|
584
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
593
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
585
594
|
Rpcs.new parent_rpcs
|
586
595
|
end
|
587
596
|
end
|
@@ -632,15 +641,15 @@ module Google
|
|
632
641
|
|
633
642
|
# @private
|
634
643
|
def initialize parent_rpcs = nil
|
635
|
-
list_operations_config = parent_rpcs
|
644
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
636
645
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
637
|
-
get_operation_config = parent_rpcs
|
646
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
638
647
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
639
|
-
delete_operation_config = parent_rpcs
|
648
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
640
649
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
641
|
-
cancel_operation_config = parent_rpcs
|
650
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
642
651
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
-
wait_operation_config = parent_rpcs
|
652
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
653
|
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
645
654
|
|
646
655
|
yield self if block_given?
|
@@ -36,15 +36,15 @@ module Google
|
|
36
36
|
|
37
37
|
# Creates a cluster in a project. The returned
|
38
38
|
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
39
|
-
#
|
39
|
+
# ClusterOperationMetadata.
|
40
40
|
rpc :CreateCluster, ::Google::Cloud::Dataproc::V1beta2::CreateClusterRequest, ::Google::Longrunning::Operation
|
41
41
|
# Updates a cluster in a project. The returned
|
42
42
|
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
43
|
-
#
|
43
|
+
# ClusterOperationMetadata.
|
44
44
|
rpc :UpdateCluster, ::Google::Cloud::Dataproc::V1beta2::UpdateClusterRequest, ::Google::Longrunning::Operation
|
45
45
|
# Deletes a cluster in a project. The returned
|
46
46
|
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
47
|
-
#
|
47
|
+
# ClusterOperationMetadata.
|
48
48
|
rpc :DeleteCluster, ::Google::Cloud::Dataproc::V1beta2::DeleteClusterRequest, ::Google::Longrunning::Operation
|
49
49
|
# Gets the resource representation for a cluster in a project.
|
50
50
|
rpc :GetCluster, ::Google::Cloud::Dataproc::V1beta2::GetClusterRequest, ::Google::Cloud::Dataproc::V1beta2::Cluster
|
@@ -52,7 +52,7 @@ module Google
|
|
52
52
|
rpc :ListClusters, ::Google::Cloud::Dataproc::V1beta2::ListClustersRequest, ::Google::Cloud::Dataproc::V1beta2::ListClustersResponse
|
53
53
|
# Gets cluster diagnostic information. The returned
|
54
54
|
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
55
|
-
#
|
55
|
+
# ClusterOperationMetadata.
|
56
56
|
# After the operation completes,
|
57
57
|
# [Operation.response][google.longrunning.Operation.response]
|
58
58
|
# contains
|
@@ -39,13 +39,12 @@ module Google
|
|
39
39
|
# See {::Google::Cloud::Dataproc::V1beta2::JobController::Client::Configuration}
|
40
40
|
# for a description of the configuration fields.
|
41
41
|
#
|
42
|
-
#
|
42
|
+
# @example
|
43
43
|
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
# end
|
44
|
+
# # Modify the configuration for all JobController clients
|
45
|
+
# ::Google::Cloud::Dataproc::V1beta2::JobController::Client.configure do |config|
|
46
|
+
# config.timeout = 10.0
|
47
|
+
# end
|
49
48
|
#
|
50
49
|
# @yield [config] Configure the Client client.
|
51
50
|
# @yieldparam config [Client::Configuration]
|
@@ -58,65 +57,44 @@ module Google
|
|
58
57
|
parent_config = while namespace.any?
|
59
58
|
parent_name = namespace.join "::"
|
60
59
|
parent_const = const_get parent_name
|
61
|
-
break parent_const.configure if parent_const
|
60
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
62
61
|
namespace.pop
|
63
62
|
end
|
64
63
|
default_config = Client::Configuration.new parent_config
|
65
64
|
|
66
65
|
default_config.rpcs.submit_job.timeout = 900.0
|
67
66
|
default_config.rpcs.submit_job.retry_policy = {
|
68
|
-
initial_delay: 0.1,
|
69
|
-
max_delay: 60.0,
|
70
|
-
multiplier: 1.3,
|
71
|
-
retry_codes: [14]
|
67
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
72
68
|
}
|
73
69
|
|
74
70
|
default_config.rpcs.submit_job_as_operation.timeout = 900.0
|
75
71
|
default_config.rpcs.submit_job_as_operation.retry_policy = {
|
76
|
-
initial_delay: 0.1,
|
77
|
-
max_delay: 60.0,
|
78
|
-
multiplier: 1.3,
|
79
|
-
retry_codes: [14]
|
72
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
80
73
|
}
|
81
74
|
|
82
75
|
default_config.rpcs.get_job.timeout = 900.0
|
83
76
|
default_config.rpcs.get_job.retry_policy = {
|
84
|
-
initial_delay: 0.1,
|
85
|
-
max_delay: 60.0,
|
86
|
-
multiplier: 1.3,
|
87
|
-
retry_codes: [4, 13, 14]
|
77
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
88
78
|
}
|
89
79
|
|
90
80
|
default_config.rpcs.list_jobs.timeout = 900.0
|
91
81
|
default_config.rpcs.list_jobs.retry_policy = {
|
92
|
-
initial_delay: 0.1,
|
93
|
-
max_delay: 60.0,
|
94
|
-
multiplier: 1.3,
|
95
|
-
retry_codes: [4, 13, 14]
|
82
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
96
83
|
}
|
97
84
|
|
98
85
|
default_config.rpcs.update_job.timeout = 900.0
|
99
86
|
default_config.rpcs.update_job.retry_policy = {
|
100
|
-
initial_delay: 0.1,
|
101
|
-
max_delay: 60.0,
|
102
|
-
multiplier: 1.3,
|
103
|
-
retry_codes: [14]
|
87
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
104
88
|
}
|
105
89
|
|
106
90
|
default_config.rpcs.cancel_job.timeout = 900.0
|
107
91
|
default_config.rpcs.cancel_job.retry_policy = {
|
108
|
-
initial_delay: 0.1,
|
109
|
-
max_delay: 60.0,
|
110
|
-
multiplier: 1.3,
|
111
|
-
retry_codes: [4, 13, 14]
|
92
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14]
|
112
93
|
}
|
113
94
|
|
114
95
|
default_config.rpcs.delete_job.timeout = 900.0
|
115
96
|
default_config.rpcs.delete_job.retry_policy = {
|
116
|
-
initial_delay: 0.1,
|
117
|
-
max_delay: 60.0,
|
118
|
-
multiplier: 1.3,
|
119
|
-
retry_codes: [14]
|
97
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
120
98
|
}
|
121
99
|
|
122
100
|
default_config
|
@@ -148,19 +126,15 @@ module Google
|
|
148
126
|
##
|
149
127
|
# Create a new JobController client object.
|
150
128
|
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
# To create a new JobController client with the default
|
154
|
-
# configuration:
|
155
|
-
#
|
156
|
-
# client = ::Google::Cloud::Dataproc::V1beta2::JobController::Client.new
|
129
|
+
# @example
|
157
130
|
#
|
158
|
-
#
|
159
|
-
#
|
131
|
+
# # Create a client using the default configuration
|
132
|
+
# client = ::Google::Cloud::Dataproc::V1beta2::JobController::Client.new
|
160
133
|
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
134
|
+
# # Create a client using a custom configuration
|
135
|
+
# client = ::Google::Cloud::Dataproc::V1beta2::JobController::Client.new do |config|
|
136
|
+
# config.timeout = 10.0
|
137
|
+
# end
|
164
138
|
#
|
165
139
|
# @yield [config] Configure the JobController client.
|
166
140
|
# @yieldparam config [Client::Configuration]
|
@@ -180,14 +154,13 @@ module Google
|
|
180
154
|
|
181
155
|
# Create credentials
|
182
156
|
credentials = @config.credentials
|
183
|
-
# Use self-signed JWT if the
|
157
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
184
158
|
# but only if the default endpoint does not have a region prefix.
|
185
|
-
enable_self_signed_jwt = @config.
|
186
|
-
@config.endpoint == Client.configure.endpoint &&
|
159
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
187
160
|
!@config.endpoint.split(".").first.include?("-")
|
188
|
-
credentials ||= Credentials.default scope:
|
161
|
+
credentials ||= Credentials.default scope: @config.scope,
|
189
162
|
enable_self_signed_jwt: enable_self_signed_jwt
|
190
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
163
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
191
164
|
credentials = Credentials.new credentials, scope: @config.scope
|
192
165
|
end
|
193
166
|
@quota_project_id = @config.quota_project
|
@@ -281,7 +254,7 @@ module Google
|
|
281
254
|
|
282
255
|
header_params = {
|
283
256
|
"project_id" => request.project_id,
|
284
|
-
"region"
|
257
|
+
"region" => request.region
|
285
258
|
}
|
286
259
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
287
260
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -289,7 +262,9 @@ module Google
|
|
289
262
|
options.apply_defaults timeout: @config.rpcs.submit_job.timeout,
|
290
263
|
metadata: metadata,
|
291
264
|
retry_policy: @config.rpcs.submit_job.retry_policy
|
292
|
-
|
265
|
+
|
266
|
+
options.apply_defaults timeout: @config.timeout,
|
267
|
+
metadata: @config.metadata,
|
293
268
|
retry_policy: @config.retry_policy
|
294
269
|
|
295
270
|
@job_controller_stub.call_rpc :submit_job, request, options: options do |response, operation|
|
@@ -365,7 +340,7 @@ module Google
|
|
365
340
|
|
366
341
|
header_params = {
|
367
342
|
"project_id" => request.project_id,
|
368
|
-
"region"
|
343
|
+
"region" => request.region
|
369
344
|
}
|
370
345
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
371
346
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -373,7 +348,9 @@ module Google
|
|
373
348
|
options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout,
|
374
349
|
metadata: metadata,
|
375
350
|
retry_policy: @config.rpcs.submit_job_as_operation.retry_policy
|
376
|
-
|
351
|
+
|
352
|
+
options.apply_defaults timeout: @config.timeout,
|
353
|
+
metadata: @config.metadata,
|
377
354
|
retry_policy: @config.retry_policy
|
378
355
|
|
379
356
|
@job_controller_stub.call_rpc :submit_job_as_operation, request, options: options do |response, operation|
|
@@ -438,8 +415,8 @@ module Google
|
|
438
415
|
|
439
416
|
header_params = {
|
440
417
|
"project_id" => request.project_id,
|
441
|
-
"region"
|
442
|
-
"job_id"
|
418
|
+
"region" => request.region,
|
419
|
+
"job_id" => request.job_id
|
443
420
|
}
|
444
421
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
445
422
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -447,7 +424,9 @@ module Google
|
|
447
424
|
options.apply_defaults timeout: @config.rpcs.get_job.timeout,
|
448
425
|
metadata: metadata,
|
449
426
|
retry_policy: @config.rpcs.get_job.retry_policy
|
450
|
-
|
427
|
+
|
428
|
+
options.apply_defaults timeout: @config.timeout,
|
429
|
+
metadata: @config.metadata,
|
451
430
|
retry_policy: @config.retry_policy
|
452
431
|
|
453
432
|
@job_controller_stub.call_rpc :get_job, request, options: options do |response, operation|
|
@@ -537,7 +516,7 @@ module Google
|
|
537
516
|
|
538
517
|
header_params = {
|
539
518
|
"project_id" => request.project_id,
|
540
|
-
"region"
|
519
|
+
"region" => request.region
|
541
520
|
}
|
542
521
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
543
522
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -545,7 +524,9 @@ module Google
|
|
545
524
|
options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
|
546
525
|
metadata: metadata,
|
547
526
|
retry_policy: @config.rpcs.list_jobs.retry_policy
|
548
|
-
|
527
|
+
|
528
|
+
options.apply_defaults timeout: @config.timeout,
|
529
|
+
metadata: @config.metadata,
|
549
530
|
retry_policy: @config.retry_policy
|
550
531
|
|
551
532
|
@job_controller_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
@@ -619,8 +600,8 @@ module Google
|
|
619
600
|
|
620
601
|
header_params = {
|
621
602
|
"project_id" => request.project_id,
|
622
|
-
"region"
|
623
|
-
"job_id"
|
603
|
+
"region" => request.region,
|
604
|
+
"job_id" => request.job_id
|
624
605
|
}
|
625
606
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
626
607
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -628,7 +609,9 @@ module Google
|
|
628
609
|
options.apply_defaults timeout: @config.rpcs.update_job.timeout,
|
629
610
|
metadata: metadata,
|
630
611
|
retry_policy: @config.rpcs.update_job.retry_policy
|
631
|
-
|
612
|
+
|
613
|
+
options.apply_defaults timeout: @config.timeout,
|
614
|
+
metadata: @config.metadata,
|
632
615
|
retry_policy: @config.retry_policy
|
633
616
|
|
634
617
|
@job_controller_stub.call_rpc :update_job, request, options: options do |response, operation|
|
@@ -642,9 +625,9 @@ module Google
|
|
642
625
|
##
|
643
626
|
# Starts a job cancellation request. To access the job resource
|
644
627
|
# after cancellation, call
|
645
|
-
#
|
628
|
+
# regions/\\{region}/jobs.list
|
646
629
|
# or
|
647
|
-
#
|
630
|
+
# regions/\\{region}/jobs.get.
|
648
631
|
#
|
649
632
|
# @overload cancel_job(request, options = nil)
|
650
633
|
# Pass arguments to `cancel_job` via a request object, either of type
|
@@ -696,8 +679,8 @@ module Google
|
|
696
679
|
|
697
680
|
header_params = {
|
698
681
|
"project_id" => request.project_id,
|
699
|
-
"region"
|
700
|
-
"job_id"
|
682
|
+
"region" => request.region,
|
683
|
+
"job_id" => request.job_id
|
701
684
|
}
|
702
685
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
703
686
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -705,7 +688,9 @@ module Google
|
|
705
688
|
options.apply_defaults timeout: @config.rpcs.cancel_job.timeout,
|
706
689
|
metadata: metadata,
|
707
690
|
retry_policy: @config.rpcs.cancel_job.retry_policy
|
708
|
-
|
691
|
+
|
692
|
+
options.apply_defaults timeout: @config.timeout,
|
693
|
+
metadata: @config.metadata,
|
709
694
|
retry_policy: @config.retry_policy
|
710
695
|
|
711
696
|
@job_controller_stub.call_rpc :cancel_job, request, options: options do |response, operation|
|
@@ -770,8 +755,8 @@ module Google
|
|
770
755
|
|
771
756
|
header_params = {
|
772
757
|
"project_id" => request.project_id,
|
773
|
-
"region"
|
774
|
-
"job_id"
|
758
|
+
"region" => request.region,
|
759
|
+
"job_id" => request.job_id
|
775
760
|
}
|
776
761
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
777
762
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
@@ -779,7 +764,9 @@ module Google
|
|
779
764
|
options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
|
780
765
|
metadata: metadata,
|
781
766
|
retry_policy: @config.rpcs.delete_job.retry_policy
|
782
|
-
|
767
|
+
|
768
|
+
options.apply_defaults timeout: @config.timeout,
|
769
|
+
metadata: @config.metadata,
|
783
770
|
retry_policy: @config.retry_policy
|
784
771
|
|
785
772
|
@job_controller_stub.call_rpc :delete_job, request, options: options do |response, operation|
|
@@ -803,22 +790,21 @@ module Google
|
|
803
790
|
# Configuration can be applied globally to all clients, or to a single client
|
804
791
|
# on construction.
|
805
792
|
#
|
806
|
-
#
|
807
|
-
#
|
808
|
-
# To modify the global config, setting the timeout for submit_job
|
809
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
810
|
-
#
|
811
|
-
# ::Google::Cloud::Dataproc::V1beta2::JobController::Client.configure do |config|
|
812
|
-
# config.timeout = 10.0
|
813
|
-
# config.rpcs.submit_job.timeout = 20.0
|
814
|
-
# end
|
793
|
+
# @example
|
815
794
|
#
|
816
|
-
#
|
795
|
+
# # Modify the global config, setting the timeout for
|
796
|
+
# # submit_job to 20 seconds,
|
797
|
+
# # and all remaining timeouts to 10 seconds.
|
798
|
+
# ::Google::Cloud::Dataproc::V1beta2::JobController::Client.configure do |config|
|
799
|
+
# config.timeout = 10.0
|
800
|
+
# config.rpcs.submit_job.timeout = 20.0
|
801
|
+
# end
|
817
802
|
#
|
818
|
-
#
|
819
|
-
#
|
820
|
-
#
|
821
|
-
#
|
803
|
+
# # Apply the above configuration only to a new client.
|
804
|
+
# client = ::Google::Cloud::Dataproc::V1beta2::JobController::Client.new do |config|
|
805
|
+
# config.timeout = 10.0
|
806
|
+
# config.rpcs.submit_job.timeout = 20.0
|
807
|
+
# end
|
822
808
|
#
|
823
809
|
# @!attribute [rw] endpoint
|
824
810
|
# The hostname or hostname:port of the service endpoint.
|
@@ -882,7 +868,7 @@ module Google
|
|
882
868
|
config_attr :scope, nil, ::String, ::Array, nil
|
883
869
|
config_attr :lib_name, nil, ::String, nil
|
884
870
|
config_attr :lib_version, nil, ::String, nil
|
885
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
871
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
886
872
|
config_attr :interceptors, nil, ::Array, nil
|
887
873
|
config_attr :timeout, nil, ::Numeric, nil
|
888
874
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -903,7 +889,7 @@ module Google
|
|
903
889
|
def rpcs
|
904
890
|
@rpcs ||= begin
|
905
891
|
parent_rpcs = nil
|
906
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
892
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
907
893
|
Rpcs.new parent_rpcs
|
908
894
|
end
|
909
895
|
end
|
@@ -964,19 +950,19 @@ module Google
|
|
964
950
|
|
965
951
|
# @private
|
966
952
|
def initialize parent_rpcs = nil
|
967
|
-
submit_job_config = parent_rpcs
|
953
|
+
submit_job_config = parent_rpcs.submit_job if parent_rpcs.respond_to? :submit_job
|
968
954
|
@submit_job = ::Gapic::Config::Method.new submit_job_config
|
969
|
-
submit_job_as_operation_config = parent_rpcs
|
955
|
+
submit_job_as_operation_config = parent_rpcs.submit_job_as_operation if parent_rpcs.respond_to? :submit_job_as_operation
|
970
956
|
@submit_job_as_operation = ::Gapic::Config::Method.new submit_job_as_operation_config
|
971
|
-
get_job_config = parent_rpcs
|
957
|
+
get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job
|
972
958
|
@get_job = ::Gapic::Config::Method.new get_job_config
|
973
|
-
list_jobs_config = parent_rpcs
|
959
|
+
list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
|
974
960
|
@list_jobs = ::Gapic::Config::Method.new list_jobs_config
|
975
|
-
update_job_config = parent_rpcs
|
961
|
+
update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job
|
976
962
|
@update_job = ::Gapic::Config::Method.new update_job_config
|
977
|
-
cancel_job_config = parent_rpcs
|
963
|
+
cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job
|
978
964
|
@cancel_job = ::Gapic::Config::Method.new cancel_job_config
|
979
|
-
delete_job_config = parent_rpcs
|
965
|
+
delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
|
980
966
|
@delete_job = ::Gapic::Config::Method.new delete_job_config
|
981
967
|
|
982
968
|
yield self if block_given?
|