google-cloud-dataproc-v1 0.6.1 → 0.7.1
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/README.md +1 -1
- data/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb +3 -2
- data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb +154 -69
- data/lib/google/cloud/dataproc/v1/batch_controller/client.rb +718 -0
- data/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb +51 -0
- data/lib/google/cloud/dataproc/v1/batch_controller/operations.rb +767 -0
- data/lib/google/cloud/dataproc/v1/batch_controller/paths.rb +69 -0
- data/lib/google/cloud/dataproc/v1/batch_controller.rb +50 -0
- data/lib/google/cloud/dataproc/v1/batches_pb.rb +123 -0
- data/lib/google/cloud/dataproc/v1/batches_services_pb.rb +52 -0
- data/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +325 -118
- data/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb +149 -37
- data/lib/google/cloud/dataproc/v1/clusters_pb.rb +9 -2
- data/lib/google/cloud/dataproc/v1/clusters_services_pb.rb +2 -0
- data/lib/google/cloud/dataproc/v1/job_controller/client.rb +244 -104
- data/lib/google/cloud/dataproc/v1/job_controller/operations.rb +149 -37
- data/lib/google/cloud/dataproc/v1/jobs_pb.rb +2 -2
- data/lib/google/cloud/dataproc/v1/operations_pb.rb +18 -3
- data/lib/google/cloud/dataproc/v1/shared_pb.rb +40 -2
- data/lib/google/cloud/dataproc/v1/version.rb +1 -1
- data/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +219 -95
- data/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb +149 -37
- data/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb +2 -2
- data/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb +1 -2
- data/lib/google/cloud/dataproc/v1.rb +1 -0
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb +18 -0
- data/proto_docs/google/cloud/dataproc/v1/batches.rb +339 -0
- data/proto_docs/google/cloud/dataproc/v1/clusters.rb +45 -22
- data/proto_docs/google/cloud/dataproc/v1/jobs.rb +8 -9
- data/proto_docs/google/cloud/dataproc/v1/operations.rb +48 -0
- data/proto_docs/google/cloud/dataproc/v1/shared.rb +117 -1
- data/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb +11 -14
- metadata +12 -4
@@ -39,13 +39,12 @@ module Google
|
|
39
39
|
# See {::Google::Cloud::Dataproc::V1::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::V1::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]
|
@@ -65,58 +64,37 @@ module Google
|
|
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::V1::JobController::Client.new
|
129
|
+
# @example
|
157
130
|
#
|
158
|
-
#
|
159
|
-
#
|
131
|
+
# # Create a client using the default configuration
|
132
|
+
# client = ::Google::Cloud::Dataproc::V1::JobController::Client.new
|
160
133
|
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
134
|
+
# # Create a client using a custom configuration
|
135
|
+
# client = ::Google::Cloud::Dataproc::V1::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
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
|
@@ -263,6 +236,21 @@ module Google
|
|
263
236
|
#
|
264
237
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
265
238
|
#
|
239
|
+
# @example Basic example
|
240
|
+
# require "google/cloud/dataproc/v1"
|
241
|
+
#
|
242
|
+
# # Create a client object. The client can be reused for multiple calls.
|
243
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
244
|
+
#
|
245
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
246
|
+
# request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new
|
247
|
+
#
|
248
|
+
# # Call the submit_job method.
|
249
|
+
# result = client.submit_job request
|
250
|
+
#
|
251
|
+
# # The returned object is of type Google::Cloud::Dataproc::V1::Job.
|
252
|
+
# p result
|
253
|
+
#
|
266
254
|
def submit_job request, options = nil
|
267
255
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
268
256
|
|
@@ -280,17 +268,23 @@ module Google
|
|
280
268
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
281
269
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
282
270
|
|
283
|
-
header_params = {
|
284
|
-
|
285
|
-
"
|
286
|
-
|
271
|
+
header_params = {}
|
272
|
+
if request.project_id
|
273
|
+
header_params["project_id"] = request.project_id
|
274
|
+
end
|
275
|
+
if request.region
|
276
|
+
header_params["region"] = request.region
|
277
|
+
end
|
278
|
+
|
287
279
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
288
280
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
289
281
|
|
290
282
|
options.apply_defaults timeout: @config.rpcs.submit_job.timeout,
|
291
283
|
metadata: metadata,
|
292
284
|
retry_policy: @config.rpcs.submit_job.retry_policy
|
293
|
-
|
285
|
+
|
286
|
+
options.apply_defaults timeout: @config.timeout,
|
287
|
+
metadata: @config.metadata,
|
294
288
|
retry_policy: @config.retry_policy
|
295
289
|
|
296
290
|
@job_controller_stub.call_rpc :submit_job, request, options: options do |response, operation|
|
@@ -348,6 +342,28 @@ module Google
|
|
348
342
|
#
|
349
343
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
350
344
|
#
|
345
|
+
# @example Basic example
|
346
|
+
# require "google/cloud/dataproc/v1"
|
347
|
+
#
|
348
|
+
# # Create a client object. The client can be reused for multiple calls.
|
349
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
350
|
+
#
|
351
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
352
|
+
# request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new
|
353
|
+
#
|
354
|
+
# # Call the submit_job_as_operation method.
|
355
|
+
# result = client.submit_job_as_operation request
|
356
|
+
#
|
357
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
358
|
+
# # object to check the status of an operation, cancel it, or wait
|
359
|
+
# # for results. Here is how to block until completion:
|
360
|
+
# result.wait_until_done! timeout: 60
|
361
|
+
# if result.response?
|
362
|
+
# p result.response
|
363
|
+
# else
|
364
|
+
# puts "Error!"
|
365
|
+
# end
|
366
|
+
#
|
351
367
|
def submit_job_as_operation request, options = nil
|
352
368
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
353
369
|
|
@@ -365,17 +381,23 @@ module Google
|
|
365
381
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
366
382
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
367
383
|
|
368
|
-
header_params = {
|
369
|
-
|
370
|
-
"
|
371
|
-
|
384
|
+
header_params = {}
|
385
|
+
if request.project_id
|
386
|
+
header_params["project_id"] = request.project_id
|
387
|
+
end
|
388
|
+
if request.region
|
389
|
+
header_params["region"] = request.region
|
390
|
+
end
|
391
|
+
|
372
392
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
373
393
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
374
394
|
|
375
395
|
options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout,
|
376
396
|
metadata: metadata,
|
377
397
|
retry_policy: @config.rpcs.submit_job_as_operation.retry_policy
|
378
|
-
|
398
|
+
|
399
|
+
options.apply_defaults timeout: @config.timeout,
|
400
|
+
metadata: @config.metadata,
|
379
401
|
retry_policy: @config.retry_policy
|
380
402
|
|
381
403
|
@job_controller_stub.call_rpc :submit_job_as_operation, request, options: options do |response, operation|
|
@@ -421,6 +443,21 @@ module Google
|
|
421
443
|
#
|
422
444
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
423
445
|
#
|
446
|
+
# @example Basic example
|
447
|
+
# require "google/cloud/dataproc/v1"
|
448
|
+
#
|
449
|
+
# # Create a client object. The client can be reused for multiple calls.
|
450
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
451
|
+
#
|
452
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
453
|
+
# request = Google::Cloud::Dataproc::V1::GetJobRequest.new
|
454
|
+
#
|
455
|
+
# # Call the get_job method.
|
456
|
+
# result = client.get_job request
|
457
|
+
#
|
458
|
+
# # The returned object is of type Google::Cloud::Dataproc::V1::Job.
|
459
|
+
# p result
|
460
|
+
#
|
424
461
|
def get_job request, options = nil
|
425
462
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
426
463
|
|
@@ -438,18 +475,26 @@ module Google
|
|
438
475
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
439
476
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
440
477
|
|
441
|
-
header_params = {
|
442
|
-
|
443
|
-
"
|
444
|
-
|
445
|
-
|
478
|
+
header_params = {}
|
479
|
+
if request.project_id
|
480
|
+
header_params["project_id"] = request.project_id
|
481
|
+
end
|
482
|
+
if request.region
|
483
|
+
header_params["region"] = request.region
|
484
|
+
end
|
485
|
+
if request.job_id
|
486
|
+
header_params["job_id"] = request.job_id
|
487
|
+
end
|
488
|
+
|
446
489
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
447
490
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
448
491
|
|
449
492
|
options.apply_defaults timeout: @config.rpcs.get_job.timeout,
|
450
493
|
metadata: metadata,
|
451
494
|
retry_policy: @config.rpcs.get_job.retry_policy
|
452
|
-
|
495
|
+
|
496
|
+
options.apply_defaults timeout: @config.timeout,
|
497
|
+
metadata: @config.metadata,
|
453
498
|
retry_policy: @config.retry_policy
|
454
499
|
|
455
500
|
@job_controller_stub.call_rpc :get_job, request, options: options do |response, operation|
|
@@ -520,6 +565,27 @@ module Google
|
|
520
565
|
#
|
521
566
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
522
567
|
#
|
568
|
+
# @example Basic example
|
569
|
+
# require "google/cloud/dataproc/v1"
|
570
|
+
#
|
571
|
+
# # Create a client object. The client can be reused for multiple calls.
|
572
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
573
|
+
#
|
574
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
575
|
+
# request = Google::Cloud::Dataproc::V1::ListJobsRequest.new
|
576
|
+
#
|
577
|
+
# # Call the list_jobs method.
|
578
|
+
# result = client.list_jobs request
|
579
|
+
#
|
580
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
581
|
+
# # iterate over all elements by calling #each, and the enumerable
|
582
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
583
|
+
# # methods are also available for managing paging directly.
|
584
|
+
# result.each do |response|
|
585
|
+
# # Each element is of type ::Google::Cloud::Dataproc::V1::Job.
|
586
|
+
# p response
|
587
|
+
# end
|
588
|
+
#
|
523
589
|
def list_jobs request, options = nil
|
524
590
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
525
591
|
|
@@ -537,17 +603,23 @@ module Google
|
|
537
603
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
538
604
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
539
605
|
|
540
|
-
header_params = {
|
541
|
-
|
542
|
-
"
|
543
|
-
|
606
|
+
header_params = {}
|
607
|
+
if request.project_id
|
608
|
+
header_params["project_id"] = request.project_id
|
609
|
+
end
|
610
|
+
if request.region
|
611
|
+
header_params["region"] = request.region
|
612
|
+
end
|
613
|
+
|
544
614
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
545
615
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
546
616
|
|
547
617
|
options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
|
548
618
|
metadata: metadata,
|
549
619
|
retry_policy: @config.rpcs.list_jobs.retry_policy
|
550
|
-
|
620
|
+
|
621
|
+
options.apply_defaults timeout: @config.timeout,
|
622
|
+
metadata: @config.metadata,
|
551
623
|
retry_policy: @config.retry_policy
|
552
624
|
|
553
625
|
@job_controller_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
@@ -602,6 +674,21 @@ module Google
|
|
602
674
|
#
|
603
675
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
604
676
|
#
|
677
|
+
# @example Basic example
|
678
|
+
# require "google/cloud/dataproc/v1"
|
679
|
+
#
|
680
|
+
# # Create a client object. The client can be reused for multiple calls.
|
681
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
682
|
+
#
|
683
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
684
|
+
# request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new
|
685
|
+
#
|
686
|
+
# # Call the update_job method.
|
687
|
+
# result = client.update_job request
|
688
|
+
#
|
689
|
+
# # The returned object is of type Google::Cloud::Dataproc::V1::Job.
|
690
|
+
# p result
|
691
|
+
#
|
605
692
|
def update_job request, options = nil
|
606
693
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
607
694
|
|
@@ -619,18 +706,26 @@ module Google
|
|
619
706
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
620
707
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
621
708
|
|
622
|
-
header_params = {
|
623
|
-
|
624
|
-
"
|
625
|
-
|
626
|
-
|
709
|
+
header_params = {}
|
710
|
+
if request.project_id
|
711
|
+
header_params["project_id"] = request.project_id
|
712
|
+
end
|
713
|
+
if request.region
|
714
|
+
header_params["region"] = request.region
|
715
|
+
end
|
716
|
+
if request.job_id
|
717
|
+
header_params["job_id"] = request.job_id
|
718
|
+
end
|
719
|
+
|
627
720
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
628
721
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
629
722
|
|
630
723
|
options.apply_defaults timeout: @config.rpcs.update_job.timeout,
|
631
724
|
metadata: metadata,
|
632
725
|
retry_policy: @config.rpcs.update_job.retry_policy
|
633
|
-
|
726
|
+
|
727
|
+
options.apply_defaults timeout: @config.timeout,
|
728
|
+
metadata: @config.metadata,
|
634
729
|
retry_policy: @config.retry_policy
|
635
730
|
|
636
731
|
@job_controller_stub.call_rpc :update_job, request, options: options do |response, operation|
|
@@ -679,6 +774,21 @@ module Google
|
|
679
774
|
#
|
680
775
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
681
776
|
#
|
777
|
+
# @example Basic example
|
778
|
+
# require "google/cloud/dataproc/v1"
|
779
|
+
#
|
780
|
+
# # Create a client object. The client can be reused for multiple calls.
|
781
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
782
|
+
#
|
783
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
784
|
+
# request = Google::Cloud::Dataproc::V1::CancelJobRequest.new
|
785
|
+
#
|
786
|
+
# # Call the cancel_job method.
|
787
|
+
# result = client.cancel_job request
|
788
|
+
#
|
789
|
+
# # The returned object is of type Google::Cloud::Dataproc::V1::Job.
|
790
|
+
# p result
|
791
|
+
#
|
682
792
|
def cancel_job request, options = nil
|
683
793
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
684
794
|
|
@@ -696,18 +806,26 @@ module Google
|
|
696
806
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
697
807
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
698
808
|
|
699
|
-
header_params = {
|
700
|
-
|
701
|
-
"
|
702
|
-
|
703
|
-
|
809
|
+
header_params = {}
|
810
|
+
if request.project_id
|
811
|
+
header_params["project_id"] = request.project_id
|
812
|
+
end
|
813
|
+
if request.region
|
814
|
+
header_params["region"] = request.region
|
815
|
+
end
|
816
|
+
if request.job_id
|
817
|
+
header_params["job_id"] = request.job_id
|
818
|
+
end
|
819
|
+
|
704
820
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
705
821
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
706
822
|
|
707
823
|
options.apply_defaults timeout: @config.rpcs.cancel_job.timeout,
|
708
824
|
metadata: metadata,
|
709
825
|
retry_policy: @config.rpcs.cancel_job.retry_policy
|
710
|
-
|
826
|
+
|
827
|
+
options.apply_defaults timeout: @config.timeout,
|
828
|
+
metadata: @config.metadata,
|
711
829
|
retry_policy: @config.retry_policy
|
712
830
|
|
713
831
|
@job_controller_stub.call_rpc :cancel_job, request, options: options do |response, operation|
|
@@ -753,6 +871,21 @@ module Google
|
|
753
871
|
#
|
754
872
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
755
873
|
#
|
874
|
+
# @example Basic example
|
875
|
+
# require "google/cloud/dataproc/v1"
|
876
|
+
#
|
877
|
+
# # Create a client object. The client can be reused for multiple calls.
|
878
|
+
# client = Google::Cloud::Dataproc::V1::JobController::Client.new
|
879
|
+
#
|
880
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
881
|
+
# request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new
|
882
|
+
#
|
883
|
+
# # Call the delete_job method.
|
884
|
+
# result = client.delete_job request
|
885
|
+
#
|
886
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
887
|
+
# p result
|
888
|
+
#
|
756
889
|
def delete_job request, options = nil
|
757
890
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
758
891
|
|
@@ -770,18 +903,26 @@ module Google
|
|
770
903
|
gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
|
771
904
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
772
905
|
|
773
|
-
header_params = {
|
774
|
-
|
775
|
-
"
|
776
|
-
|
777
|
-
|
906
|
+
header_params = {}
|
907
|
+
if request.project_id
|
908
|
+
header_params["project_id"] = request.project_id
|
909
|
+
end
|
910
|
+
if request.region
|
911
|
+
header_params["region"] = request.region
|
912
|
+
end
|
913
|
+
if request.job_id
|
914
|
+
header_params["job_id"] = request.job_id
|
915
|
+
end
|
916
|
+
|
778
917
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
779
918
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
780
919
|
|
781
920
|
options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
|
782
921
|
metadata: metadata,
|
783
922
|
retry_policy: @config.rpcs.delete_job.retry_policy
|
784
|
-
|
923
|
+
|
924
|
+
options.apply_defaults timeout: @config.timeout,
|
925
|
+
metadata: @config.metadata,
|
785
926
|
retry_policy: @config.retry_policy
|
786
927
|
|
787
928
|
@job_controller_stub.call_rpc :delete_job, request, options: options do |response, operation|
|
@@ -805,22 +946,21 @@ module Google
|
|
805
946
|
# Configuration can be applied globally to all clients, or to a single client
|
806
947
|
# on construction.
|
807
948
|
#
|
808
|
-
#
|
809
|
-
#
|
810
|
-
#
|
811
|
-
# to 20 seconds,
|
812
|
-
#
|
813
|
-
#
|
814
|
-
#
|
815
|
-
#
|
816
|
-
#
|
817
|
-
#
|
818
|
-
#
|
819
|
-
#
|
820
|
-
#
|
821
|
-
#
|
822
|
-
#
|
823
|
-
# end
|
949
|
+
# @example
|
950
|
+
#
|
951
|
+
# # Modify the global config, setting the timeout for
|
952
|
+
# # submit_job to 20 seconds,
|
953
|
+
# # and all remaining timeouts to 10 seconds.
|
954
|
+
# ::Google::Cloud::Dataproc::V1::JobController::Client.configure do |config|
|
955
|
+
# config.timeout = 10.0
|
956
|
+
# config.rpcs.submit_job.timeout = 20.0
|
957
|
+
# end
|
958
|
+
#
|
959
|
+
# # Apply the above configuration only to a new client.
|
960
|
+
# client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config|
|
961
|
+
# config.timeout = 10.0
|
962
|
+
# config.rpcs.submit_job.timeout = 20.0
|
963
|
+
# end
|
824
964
|
#
|
825
965
|
# @!attribute [rw] endpoint
|
826
966
|
# The hostname or hostname:port of the service endpoint.
|