google-cloud-dataproc-v1 0.6.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/README.md +1 -1
  5. data/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb +3 -2
  6. data/lib/google/cloud/dataproc/v1/autoscaling_policies_services_pb.rb +1 -1
  7. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb +106 -15
  8. data/lib/google/cloud/dataproc/v1/batch_controller/client.rb +719 -0
  9. data/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb +51 -0
  10. data/lib/google/cloud/dataproc/v1/batch_controller/operations.rb +767 -0
  11. data/lib/google/cloud/dataproc/v1/batch_controller/paths.rb +69 -0
  12. data/lib/google/cloud/dataproc/v1/batch_controller.rb +50 -0
  13. data/lib/google/cloud/dataproc/v1/batches_pb.rb +123 -0
  14. data/lib/google/cloud/dataproc/v1/batches_services_pb.rb +52 -0
  15. data/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +266 -49
  16. data/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb +115 -12
  17. data/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb +0 -19
  18. data/lib/google/cloud/dataproc/v1/clusters_pb.rb +23 -10
  19. data/lib/google/cloud/dataproc/v1/clusters_services_pb.rb +3 -1
  20. data/lib/google/cloud/dataproc/v1/job_controller/client.rb +187 -32
  21. data/lib/google/cloud/dataproc/v1/job_controller/operations.rb +115 -12
  22. data/lib/google/cloud/dataproc/v1/jobs_pb.rb +2 -2
  23. data/lib/google/cloud/dataproc/v1/jobs_services_pb.rb +1 -1
  24. data/lib/google/cloud/dataproc/v1/operations_pb.rb +18 -3
  25. data/lib/google/cloud/dataproc/v1/shared_pb.rb +99 -2
  26. data/lib/google/cloud/dataproc/v1/version.rb +1 -1
  27. data/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +163 -24
  28. data/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb +115 -12
  29. data/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb +0 -19
  30. data/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb +2 -2
  31. data/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb +2 -3
  32. data/lib/google/cloud/dataproc/v1.rb +1 -0
  33. data/proto_docs/google/api/resource.rb +10 -71
  34. data/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb +18 -0
  35. data/proto_docs/google/cloud/dataproc/v1/batches.rb +339 -0
  36. data/proto_docs/google/cloud/dataproc/v1/clusters.rb +117 -47
  37. data/proto_docs/google/cloud/dataproc/v1/jobs.rb +20 -9
  38. data/proto_docs/google/cloud/dataproc/v1/operations.rb +48 -0
  39. data/proto_docs/google/cloud/dataproc/v1/shared.rb +336 -1
  40. data/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb +12 -15
  41. metadata +11 -3
@@ -166,6 +166,7 @@ module Google
166
166
 
167
167
  @operations_client = Operations.new do |config|
168
168
  config.credentials = credentials
169
+ config.quota_project = @quota_project_id
169
170
  config.endpoint = @config.endpoint
170
171
  end
171
172
 
@@ -202,7 +203,7 @@ module Google
202
203
  # @param options [::Gapic::CallOptions, ::Hash]
203
204
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
204
205
  #
205
- # @overload create_cluster(project_id: nil, region: nil, cluster: nil, request_id: nil)
206
+ # @overload create_cluster(project_id: nil, region: nil, cluster: nil, request_id: nil, action_on_failed_primary_workers: nil)
206
207
  # Pass arguments to `create_cluster` via keyword arguments. Note that at
207
208
  # least one keyword argument is required. To specify no parameters, or to keep all
208
209
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -215,7 +216,7 @@ module Google
215
216
  # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash]
216
217
  # Required. The cluster to create.
217
218
  # @param request_id [::String]
218
- # Optional. A unique id used to identify the request. If the server receives two
219
+ # Optional. A unique ID used to identify the request. If the server receives two
219
220
  # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s
220
221
  # with the same id, then the second request will be ignored and the
221
222
  # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the backend
@@ -224,8 +225,10 @@ module Google
224
225
  # It is recommended to always set this value to a
225
226
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
226
227
  #
227
- # The id must contain only letters (a-z, A-Z), numbers (0-9),
228
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
228
229
  # underscores (_), and hyphens (-). The maximum length is 40 characters.
230
+ # @param action_on_failed_primary_workers [::Google::Cloud::Dataproc::V1::FailureAction]
231
+ # Optional. Failure action when primary worker creation fails.
229
232
  #
230
233
  # @yield [response, operation] Access the result along with the RPC operation
231
234
  # @yieldparam response [::Gapic::Operation]
@@ -235,6 +238,28 @@ module Google
235
238
  #
236
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
237
240
  #
241
+ # @example Basic example
242
+ # require "google/cloud/dataproc/v1"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new
249
+ #
250
+ # # Call the create_cluster method.
251
+ # result = client.create_cluster request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
238
263
  def create_cluster request, options = nil
239
264
  raise ::ArgumentError, "request must be provided" if request.nil?
240
265
 
@@ -252,10 +277,14 @@ module Google
252
277
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
253
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
254
279
 
255
- header_params = {
256
- "project_id" => request.project_id,
257
- "region" => request.region
258
- }
280
+ header_params = {}
281
+ if request.project_id
282
+ header_params["project_id"] = request.project_id
283
+ end
284
+ if request.region
285
+ header_params["region"] = request.region
286
+ end
287
+
259
288
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
260
289
  metadata[:"x-goog-request-params"] ||= request_params_header
261
290
 
@@ -280,6 +309,8 @@ module Google
280
309
  # Updates a cluster in a project. The returned
281
310
  # {::Google::Longrunning::Operation#metadata Operation.metadata} will be
282
311
  # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
312
+ # The cluster must be in a {::Google::Cloud::Dataproc::V1::ClusterStatus::State `RUNNING`} state or an error
313
+ # is returned.
283
314
  #
284
315
  # @overload update_cluster(request, options = nil)
285
316
  # Pass arguments to `update_cluster` via a request object, either of type
@@ -368,7 +399,7 @@ module Google
368
399
  # </tbody>
369
400
  # </table>
370
401
  # @param request_id [::String]
371
- # Optional. A unique id used to identify the request. If the server
402
+ # Optional. A unique ID used to identify the request. If the server
372
403
  # receives two
373
404
  # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s
374
405
  # with the same id, then the second request will be ignored and the
@@ -378,7 +409,7 @@ module Google
378
409
  # It is recommended to always set this value to a
379
410
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
380
411
  #
381
- # The id must contain only letters (a-z, A-Z), numbers (0-9),
412
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
382
413
  # underscores (_), and hyphens (-). The maximum length is 40 characters.
383
414
  #
384
415
  # @yield [response, operation] Access the result along with the RPC operation
@@ -389,6 +420,28 @@ module Google
389
420
  #
390
421
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
391
422
  #
423
+ # @example Basic example
424
+ # require "google/cloud/dataproc/v1"
425
+ #
426
+ # # Create a client object. The client can be reused for multiple calls.
427
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
428
+ #
429
+ # # Create a request. To set request fields, pass in keyword arguments.
430
+ # request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new
431
+ #
432
+ # # Call the update_cluster method.
433
+ # result = client.update_cluster request
434
+ #
435
+ # # The returned object is of type Gapic::Operation. You can use this
436
+ # # object to check the status of an operation, cancel it, or wait
437
+ # # for results. Here is how to block until completion:
438
+ # result.wait_until_done! timeout: 60
439
+ # if result.response?
440
+ # p result.response
441
+ # else
442
+ # puts "Error!"
443
+ # end
444
+ #
392
445
  def update_cluster request, options = nil
393
446
  raise ::ArgumentError, "request must be provided" if request.nil?
394
447
 
@@ -406,11 +459,17 @@ module Google
406
459
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
407
460
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
408
461
 
409
- header_params = {
410
- "project_id" => request.project_id,
411
- "region" => request.region,
412
- "cluster_name" => request.cluster_name
413
- }
462
+ header_params = {}
463
+ if request.project_id
464
+ header_params["project_id"] = request.project_id
465
+ end
466
+ if request.region
467
+ header_params["region"] = request.region
468
+ end
469
+ if request.cluster_name
470
+ header_params["cluster_name"] = request.cluster_name
471
+ end
472
+
414
473
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
415
474
  metadata[:"x-goog-request-params"] ||= request_params_header
416
475
 
@@ -460,7 +519,7 @@ module Google
460
519
  # Optional. Specifying the `cluster_uuid` means the RPC will fail
461
520
  # (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
462
521
  # @param request_id [::String]
463
- # Optional. A unique id used to identify the request. If the server
522
+ # Optional. A unique ID used to identify the request. If the server
464
523
  # receives two
465
524
  # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s
466
525
  # with the same id, then the second request will be ignored and the
@@ -470,7 +529,7 @@ module Google
470
529
  # Recommendation: Set this value to a
471
530
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
472
531
  #
473
- # The id must contain only letters (a-z, A-Z), numbers (0-9),
532
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
474
533
  # underscores (_), and hyphens (-). The maximum length is 40 characters.
475
534
  #
476
535
  # @yield [response, operation] Access the result along with the RPC operation
@@ -481,6 +540,28 @@ module Google
481
540
  #
482
541
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
483
542
  #
543
+ # @example Basic example
544
+ # require "google/cloud/dataproc/v1"
545
+ #
546
+ # # Create a client object. The client can be reused for multiple calls.
547
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
548
+ #
549
+ # # Create a request. To set request fields, pass in keyword arguments.
550
+ # request = Google::Cloud::Dataproc::V1::StopClusterRequest.new
551
+ #
552
+ # # Call the stop_cluster method.
553
+ # result = client.stop_cluster request
554
+ #
555
+ # # The returned object is of type Gapic::Operation. You can use this
556
+ # # object to check the status of an operation, cancel it, or wait
557
+ # # for results. Here is how to block until completion:
558
+ # result.wait_until_done! timeout: 60
559
+ # if result.response?
560
+ # p result.response
561
+ # else
562
+ # puts "Error!"
563
+ # end
564
+ #
484
565
  def stop_cluster request, options = nil
485
566
  raise ::ArgumentError, "request must be provided" if request.nil?
486
567
 
@@ -498,11 +579,17 @@ module Google
498
579
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
499
580
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
500
581
 
501
- header_params = {
502
- "project_id" => request.project_id,
503
- "region" => request.region,
504
- "cluster_name" => request.cluster_name
505
- }
582
+ header_params = {}
583
+ if request.project_id
584
+ header_params["project_id"] = request.project_id
585
+ end
586
+ if request.region
587
+ header_params["region"] = request.region
588
+ end
589
+ if request.cluster_name
590
+ header_params["cluster_name"] = request.cluster_name
591
+ end
592
+
506
593
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
507
594
  metadata[:"x-goog-request-params"] ||= request_params_header
508
595
 
@@ -552,7 +639,7 @@ module Google
552
639
  # Optional. Specifying the `cluster_uuid` means the RPC will fail
553
640
  # (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
554
641
  # @param request_id [::String]
555
- # Optional. A unique id used to identify the request. If the server
642
+ # Optional. A unique ID used to identify the request. If the server
556
643
  # receives two
557
644
  # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s
558
645
  # with the same id, then the second request will be ignored and the
@@ -562,7 +649,7 @@ module Google
562
649
  # Recommendation: Set this value to a
563
650
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
564
651
  #
565
- # The id must contain only letters (a-z, A-Z), numbers (0-9),
652
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
566
653
  # underscores (_), and hyphens (-). The maximum length is 40 characters.
567
654
  #
568
655
  # @yield [response, operation] Access the result along with the RPC operation
@@ -573,6 +660,28 @@ module Google
573
660
  #
574
661
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
575
662
  #
663
+ # @example Basic example
664
+ # require "google/cloud/dataproc/v1"
665
+ #
666
+ # # Create a client object. The client can be reused for multiple calls.
667
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
668
+ #
669
+ # # Create a request. To set request fields, pass in keyword arguments.
670
+ # request = Google::Cloud::Dataproc::V1::StartClusterRequest.new
671
+ #
672
+ # # Call the start_cluster method.
673
+ # result = client.start_cluster request
674
+ #
675
+ # # The returned object is of type Gapic::Operation. You can use this
676
+ # # object to check the status of an operation, cancel it, or wait
677
+ # # for results. Here is how to block until completion:
678
+ # result.wait_until_done! timeout: 60
679
+ # if result.response?
680
+ # p result.response
681
+ # else
682
+ # puts "Error!"
683
+ # end
684
+ #
576
685
  def start_cluster request, options = nil
577
686
  raise ::ArgumentError, "request must be provided" if request.nil?
578
687
 
@@ -590,11 +699,17 @@ module Google
590
699
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
591
700
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
592
701
 
593
- header_params = {
594
- "project_id" => request.project_id,
595
- "region" => request.region,
596
- "cluster_name" => request.cluster_name
597
- }
702
+ header_params = {}
703
+ if request.project_id
704
+ header_params["project_id"] = request.project_id
705
+ end
706
+ if request.region
707
+ header_params["region"] = request.region
708
+ end
709
+ if request.cluster_name
710
+ header_params["cluster_name"] = request.cluster_name
711
+ end
712
+
598
713
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
599
714
  metadata[:"x-goog-request-params"] ||= request_params_header
600
715
 
@@ -646,7 +761,7 @@ module Google
646
761
  # Optional. Specifying the `cluster_uuid` means the RPC should fail
647
762
  # (with error NOT_FOUND) if cluster with specified UUID does not exist.
648
763
  # @param request_id [::String]
649
- # Optional. A unique id used to identify the request. If the server
764
+ # Optional. A unique ID used to identify the request. If the server
650
765
  # receives two
651
766
  # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s
652
767
  # with the same id, then the second request will be ignored and the
@@ -656,7 +771,7 @@ module Google
656
771
  # It is recommended to always set this value to a
657
772
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
658
773
  #
659
- # The id must contain only letters (a-z, A-Z), numbers (0-9),
774
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9),
660
775
  # underscores (_), and hyphens (-). The maximum length is 40 characters.
661
776
  #
662
777
  # @yield [response, operation] Access the result along with the RPC operation
@@ -667,6 +782,28 @@ module Google
667
782
  #
668
783
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
669
784
  #
785
+ # @example Basic example
786
+ # require "google/cloud/dataproc/v1"
787
+ #
788
+ # # Create a client object. The client can be reused for multiple calls.
789
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
790
+ #
791
+ # # Create a request. To set request fields, pass in keyword arguments.
792
+ # request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new
793
+ #
794
+ # # Call the delete_cluster method.
795
+ # result = client.delete_cluster request
796
+ #
797
+ # # The returned object is of type Gapic::Operation. You can use this
798
+ # # object to check the status of an operation, cancel it, or wait
799
+ # # for results. Here is how to block until completion:
800
+ # result.wait_until_done! timeout: 60
801
+ # if result.response?
802
+ # p result.response
803
+ # else
804
+ # puts "Error!"
805
+ # end
806
+ #
670
807
  def delete_cluster request, options = nil
671
808
  raise ::ArgumentError, "request must be provided" if request.nil?
672
809
 
@@ -684,11 +821,17 @@ module Google
684
821
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
685
822
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
686
823
 
687
- header_params = {
688
- "project_id" => request.project_id,
689
- "region" => request.region,
690
- "cluster_name" => request.cluster_name
691
- }
824
+ header_params = {}
825
+ if request.project_id
826
+ header_params["project_id"] = request.project_id
827
+ end
828
+ if request.region
829
+ header_params["region"] = request.region
830
+ end
831
+ if request.cluster_name
832
+ header_params["cluster_name"] = request.cluster_name
833
+ end
834
+
692
835
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
693
836
  metadata[:"x-goog-request-params"] ||= request_params_header
694
837
 
@@ -743,6 +886,21 @@ module Google
743
886
  #
744
887
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
745
888
  #
889
+ # @example Basic example
890
+ # require "google/cloud/dataproc/v1"
891
+ #
892
+ # # Create a client object. The client can be reused for multiple calls.
893
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
894
+ #
895
+ # # Create a request. To set request fields, pass in keyword arguments.
896
+ # request = Google::Cloud::Dataproc::V1::GetClusterRequest.new
897
+ #
898
+ # # Call the get_cluster method.
899
+ # result = client.get_cluster request
900
+ #
901
+ # # The returned object is of type Google::Cloud::Dataproc::V1::Cluster.
902
+ # p result
903
+ #
746
904
  def get_cluster request, options = nil
747
905
  raise ::ArgumentError, "request must be provided" if request.nil?
748
906
 
@@ -760,11 +918,17 @@ module Google
760
918
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
761
919
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
762
920
 
763
- header_params = {
764
- "project_id" => request.project_id,
765
- "region" => request.region,
766
- "cluster_name" => request.cluster_name
767
- }
921
+ header_params = {}
922
+ if request.project_id
923
+ header_params["project_id"] = request.project_id
924
+ end
925
+ if request.region
926
+ header_params["region"] = request.region
927
+ end
928
+ if request.cluster_name
929
+ header_params["cluster_name"] = request.cluster_name
930
+ end
931
+
768
932
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
769
933
  metadata[:"x-goog-request-params"] ||= request_params_header
770
934
 
@@ -840,6 +1004,27 @@ module Google
840
1004
  #
841
1005
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
842
1006
  #
1007
+ # @example Basic example
1008
+ # require "google/cloud/dataproc/v1"
1009
+ #
1010
+ # # Create a client object. The client can be reused for multiple calls.
1011
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
1012
+ #
1013
+ # # Create a request. To set request fields, pass in keyword arguments.
1014
+ # request = Google::Cloud::Dataproc::V1::ListClustersRequest.new
1015
+ #
1016
+ # # Call the list_clusters method.
1017
+ # result = client.list_clusters request
1018
+ #
1019
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1020
+ # # iterate over all elements by calling #each, and the enumerable
1021
+ # # will lazily make API calls to fetch subsequent pages. Other
1022
+ # # methods are also available for managing paging directly.
1023
+ # result.each do |response|
1024
+ # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster.
1025
+ # p response
1026
+ # end
1027
+ #
843
1028
  def list_clusters request, options = nil
844
1029
  raise ::ArgumentError, "request must be provided" if request.nil?
845
1030
 
@@ -857,10 +1042,14 @@ module Google
857
1042
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
858
1043
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
859
1044
 
860
- header_params = {
861
- "project_id" => request.project_id,
862
- "region" => request.region
863
- }
1045
+ header_params = {}
1046
+ if request.project_id
1047
+ header_params["project_id"] = request.project_id
1048
+ end
1049
+ if request.region
1050
+ header_params["region"] = request.region
1051
+ end
1052
+
864
1053
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
865
1054
  metadata[:"x-goog-request-params"] ||= request_params_header
866
1055
 
@@ -921,6 +1110,28 @@ module Google
921
1110
  #
922
1111
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
923
1112
  #
1113
+ # @example Basic example
1114
+ # require "google/cloud/dataproc/v1"
1115
+ #
1116
+ # # Create a client object. The client can be reused for multiple calls.
1117
+ # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new
1118
+ #
1119
+ # # Create a request. To set request fields, pass in keyword arguments.
1120
+ # request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new
1121
+ #
1122
+ # # Call the diagnose_cluster method.
1123
+ # result = client.diagnose_cluster request
1124
+ #
1125
+ # # The returned object is of type Gapic::Operation. You can use this
1126
+ # # object to check the status of an operation, cancel it, or wait
1127
+ # # for results. Here is how to block until completion:
1128
+ # result.wait_until_done! timeout: 60
1129
+ # if result.response?
1130
+ # p result.response
1131
+ # else
1132
+ # puts "Error!"
1133
+ # end
1134
+ #
924
1135
  def diagnose_cluster request, options = nil
925
1136
  raise ::ArgumentError, "request must be provided" if request.nil?
926
1137
 
@@ -938,11 +1149,17 @@ module Google
938
1149
  gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
939
1150
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
940
1151
 
941
- header_params = {
942
- "project_id" => request.project_id,
943
- "region" => request.region,
944
- "cluster_name" => request.cluster_name
945
- }
1152
+ header_params = {}
1153
+ if request.project_id
1154
+ header_params["project_id"] = request.project_id
1155
+ end
1156
+ if request.region
1157
+ header_params["region"] = request.region
1158
+ end
1159
+ if request.cluster_name
1160
+ header_params["cluster_name"] = request.cluster_name
1161
+ end
1162
+
946
1163
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
947
1164
  metadata[:"x-goog-request-params"] ||= request_params_header
948
1165