google-cloud-dataproc-v1 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb +18 -6
  3. data/lib/google/cloud/dataproc/v1/batch_controller/client.rb +51 -15
  4. data/lib/google/cloud/dataproc/v1/batch_controller/operations.rb +12 -14
  5. data/lib/google/cloud/dataproc/v1/batch_controller/paths.rb +19 -0
  6. data/lib/google/cloud/dataproc/v1/batches_pb.rb +2 -0
  7. data/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +43 -31
  8. data/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb +12 -14
  9. data/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb +19 -0
  10. data/lib/google/cloud/dataproc/v1/clusters_pb.rb +10 -9
  11. data/lib/google/cloud/dataproc/v1/job_controller/client.rb +22 -10
  12. data/lib/google/cloud/dataproc/v1/job_controller/operations.rb +12 -14
  13. data/lib/google/cloud/dataproc/v1/jobs_pb.rb +13 -0
  14. data/lib/google/cloud/dataproc/v1/node_group_controller/client.rb +23 -9
  15. data/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb +12 -14
  16. data/lib/google/cloud/dataproc/v1/operations_pb.rb +1 -0
  17. data/lib/google/cloud/dataproc/v1/shared_pb.rb +24 -1
  18. data/lib/google/cloud/dataproc/v1/version.rb +1 -1
  19. data/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +28 -15
  20. data/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb +12 -14
  21. data/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb +2 -1
  22. data/lib/google/cloud/dataproc/v1.rb +1 -1
  23. data/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb +8 -8
  24. data/proto_docs/google/cloud/dataproc/v1/batches.rb +42 -14
  25. data/proto_docs/google/cloud/dataproc/v1/clusters.rb +60 -54
  26. data/proto_docs/google/cloud/dataproc/v1/jobs.rb +48 -0
  27. data/proto_docs/google/cloud/dataproc/v1/node_groups.rb +1 -1
  28. data/proto_docs/google/cloud/dataproc/v1/operations.rb +3 -0
  29. data/proto_docs/google/cloud/dataproc/v1/shared.rb +174 -56
  30. data/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb +14 -11
  31. metadata +26 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 845bd25567ac1183e380bc1a633116e1e211b0b8683673ae3a26bc4ea68dcfbd
4
- data.tar.gz: 58c166d6d8e3727386eebacffac347b102a661179e12d37b3a3ac73f5903a350
3
+ metadata.gz: 8fd8edb11872376386de8b0fc2bd2062ea6034b76e57f165996b4a60eca4871a
4
+ data.tar.gz: 9c418981785f18f9c3927e4ef0f79751b37bed7cea8af72b241a62f464b85006
5
5
  SHA512:
6
- metadata.gz: c33304f5a779b7d54b74c08efe4c5388bc249c1b0be5ce535c925a2c2b0e5e293317d8d9bc077d1402ff392a455673cae0f559eb037fc831f9b46d0bfb1681ce
7
- data.tar.gz: 3ae99ffbcd72427fcd1121502208525821f42003c040de76264e8923753fcb5bf0c22c1db7d897e662e45ca8d7722eeb01efdde2cd747c7133f3dd002083c405
6
+ metadata.gz: 499f7e7755192e8250f3d205a043a2d3b23a3863af828689bbf64b8a4bb223c6db998a7090315fe37f033469f41710c88c835c8f4afd2b54ebd915e595fb2a11
7
+ data.tar.gz: 16d38762240a7d650836e497a04754aa63fb0b46c294c3a3ce91b08e6e46551ed96501c46b1afdf2df9772f34697b64991cb81137ff53f405eceac56272cef18
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/dataproc/v1/autoscaling_policies_pb"
21
+ require "google/iam/v1"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -153,6 +154,12 @@ module Google
153
154
  @quota_project_id = @config.quota_project
154
155
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
155
156
 
157
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
158
+ config.credentials = credentials
159
+ config.quota_project = @quota_project_id
160
+ config.endpoint = @config.endpoint
161
+ end
162
+
156
163
  @autoscaling_policy_service_stub = ::Gapic::ServiceStub.new(
157
164
  ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Stub,
158
165
  credentials: credentials,
@@ -162,6 +169,13 @@ module Google
162
169
  )
163
170
  end
164
171
 
172
+ ##
173
+ # Get the associated client for mix-in of the IAMPolicy.
174
+ #
175
+ # @return [Google::Iam::V1::IAMPolicy::Client]
176
+ #
177
+ attr_reader :iam_policy_client
178
+
165
179
  # Service calls
166
180
 
167
181
  ##
@@ -498,13 +512,11 @@ module Google
498
512
  # # Call the list_autoscaling_policies method.
499
513
  # result = client.list_autoscaling_policies request
500
514
  #
501
- # # The returned object is of type Gapic::PagedEnumerable. You can
502
- # # iterate over all elements by calling #each, and the enumerable
503
- # # will lazily make API calls to fetch subsequent pages. Other
504
- # # methods are also available for managing paging directly.
505
- # result.each do |response|
515
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
516
+ # # over elements, and API calls will be issued to fetch pages as needed.
517
+ # result.each do |item|
506
518
  # # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.
507
- # p response
519
+ # p item
508
520
  # end
509
521
  #
510
522
  def list_autoscaling_policies request, options = nil
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/dataproc/v1/batches_pb"
21
+ require "google/iam/v1"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -139,6 +140,12 @@ module Google
139
140
  config.endpoint = @config.endpoint
140
141
  end
141
142
 
143
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
144
+ config.credentials = credentials
145
+ config.quota_project = @quota_project_id
146
+ config.endpoint = @config.endpoint
147
+ end
148
+
142
149
  @batch_controller_stub = ::Gapic::ServiceStub.new(
143
150
  ::Google::Cloud::Dataproc::V1::BatchController::Stub,
144
151
  credentials: credentials,
@@ -155,6 +162,13 @@ module Google
155
162
  #
156
163
  attr_reader :operations_client
157
164
 
165
+ ##
166
+ # Get the associated client for mix-in of the IAMPolicy.
167
+ #
168
+ # @return [Google::Iam::V1::IAMPolicy::Client]
169
+ #
170
+ attr_reader :iam_policy_client
171
+
158
172
  # Service calls
159
173
 
160
174
  ##
@@ -180,8 +194,8 @@ module Google
180
194
  # @param batch [::Google::Cloud::Dataproc::V1::Batch, ::Hash]
181
195
  # Required. The batch to create.
182
196
  # @param batch_id [::String]
183
- # Optional. The ID to use for the batch, which will become the final component of
184
- # the batch's resource name.
197
+ # Optional. The ID to use for the batch, which will become the final
198
+ # component of the batch's resource name.
185
199
  #
186
200
  # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`.
187
201
  # @param request_id [::String]
@@ -218,14 +232,14 @@ module Google
218
232
  # # Call the create_batch method.
219
233
  # result = client.create_batch request
220
234
  #
221
- # # The returned object is of type Gapic::Operation. You can use this
222
- # # object to check the status of an operation, cancel it, or wait
223
- # # for results. Here is how to block until completion:
235
+ # # The returned object is of type Gapic::Operation. You can use it to
236
+ # # check the status of an operation, cancel it, or wait for results.
237
+ # # Here is how to wait for a response.
224
238
  # result.wait_until_done! timeout: 60
225
239
  # if result.response?
226
240
  # p result.response
227
241
  # else
228
- # puts "Error!"
242
+ # puts "No response received."
229
243
  # end
230
244
  #
231
245
  def create_batch request, options = nil
@@ -289,7 +303,9 @@ module Google
289
303
  # the default parameter values, pass an empty Hash as a request object (see above).
290
304
  #
291
305
  # @param name [::String]
292
- # Required. The name of the batch to retrieve.
306
+ # Required. The fully qualified name of the batch to retrieve
307
+ # in the format
308
+ # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
293
309
  #
294
310
  # @yield [response, operation] Access the result along with the RPC operation
295
311
  # @yieldparam response [::Google::Cloud::Dataproc::V1::Batch]
@@ -368,7 +384,7 @@ module Google
368
384
  # @param options [::Gapic::CallOptions, ::Hash]
369
385
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
370
386
  #
371
- # @overload list_batches(parent: nil, page_size: nil, page_token: nil)
387
+ # @overload list_batches(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
372
388
  # Pass arguments to `list_batches` via keyword arguments. Note that at
373
389
  # least one keyword argument is required. To specify no parameters, or to keep all
374
390
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -382,6 +398,26 @@ module Google
382
398
  # @param page_token [::String]
383
399
  # Optional. A page token received from a previous `ListBatches` call.
384
400
  # Provide this token to retrieve the subsequent page.
401
+ # @param filter [::String]
402
+ # Optional. A filter for the batches to return in the response.
403
+ #
404
+ # A filter is a logical expression constraining the values of various fields
405
+ # in each batch resource. Filters are case sensitive, and may contain
406
+ # multiple clauses combined with logical operators (AND/OR).
407
+ # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`.
408
+ #
409
+ # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"`
410
+ # filters for batches in state RUNNING that were created before 2023-01-01
411
+ #
412
+ # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed
413
+ # description of the filter syntax and a list of supported comparisons.
414
+ # @param order_by [::String]
415
+ # Optional. Field(s) on which to sort the list of batches.
416
+ #
417
+ # Currently the only supported sort orders are unspecified (empty) and
418
+ # `create_time desc` to sort by most recently created batches first.
419
+ #
420
+ # See https://google.aip.dev/132#ordering for more details.
385
421
  #
386
422
  # @yield [response, operation] Access the result along with the RPC operation
387
423
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>]
@@ -403,13 +439,11 @@ module Google
403
439
  # # Call the list_batches method.
404
440
  # result = client.list_batches request
405
441
  #
406
- # # The returned object is of type Gapic::PagedEnumerable. You can
407
- # # iterate over all elements by calling #each, and the enumerable
408
- # # will lazily make API calls to fetch subsequent pages. Other
409
- # # methods are also available for managing paging directly.
410
- # result.each do |response|
442
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
443
+ # # over elements, and API calls will be issued to fetch pages as needed.
444
+ # result.each do |item|
411
445
  # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch.
412
- # p response
446
+ # p item
413
447
  # end
414
448
  #
415
449
  def list_batches request, options = nil
@@ -474,7 +508,9 @@ module Google
474
508
  # the default parameter values, pass an empty Hash as a request object (see above).
475
509
  #
476
510
  # @param name [::String]
477
- # Required. The name of the batch resource to delete.
511
+ # Required. The fully qualified name of the batch to retrieve
512
+ # in the format
513
+ # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
478
514
  #
479
515
  # @yield [response, operation] Access the result along with the RPC operation
480
516
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -60,6 +60,25 @@ module Google
60
60
  "projects/#{project}/locations/#{location}"
61
61
  end
62
62
 
63
+ ##
64
+ # Create a fully-qualified Service resource string.
65
+ #
66
+ # The resource will be in the following format:
67
+ #
68
+ # `projects/{project}/locations/{location}/services/{service}`
69
+ #
70
+ # @param project [String]
71
+ # @param location [String]
72
+ # @param service [String]
73
+ #
74
+ # @return [::String]
75
+ def service_path project:, location:, service:
76
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
77
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
78
+
79
+ "projects/#{project}/locations/#{location}/services/#{service}"
80
+ end
81
+
63
82
  extend self
64
83
  end
65
84
  end
@@ -27,6 +27,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
27
27
  optional :parent, :string, 1
28
28
  optional :page_size, :int32, 2
29
29
  optional :page_token, :string, 3
30
+ optional :filter, :string, 4
31
+ optional :order_by, :string, 5
30
32
  end
31
33
  add_message "google.cloud.dataproc.v1.ListBatchesResponse" do
32
34
  repeated :batches, :message, 1, "google.cloud.dataproc.v1.Batch"
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/dataproc/v1/clusters_pb"
21
+ require "google/iam/v1"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -170,6 +171,12 @@ module Google
170
171
  config.endpoint = @config.endpoint
171
172
  end
172
173
 
174
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @config.endpoint
178
+ end
179
+
173
180
  @cluster_controller_stub = ::Gapic::ServiceStub.new(
174
181
  ::Google::Cloud::Dataproc::V1::ClusterController::Stub,
175
182
  credentials: credentials,
@@ -186,6 +193,13 @@ module Google
186
193
  #
187
194
  attr_reader :operations_client
188
195
 
196
+ ##
197
+ # Get the associated client for mix-in of the IAMPolicy.
198
+ #
199
+ # @return [Google::Iam::V1::IAMPolicy::Client]
200
+ #
201
+ attr_reader :iam_policy_client
202
+
189
203
  # Service calls
190
204
 
191
205
  ##
@@ -251,14 +265,14 @@ module Google
251
265
  # # Call the create_cluster method.
252
266
  # result = client.create_cluster request
253
267
  #
254
- # # The returned object is of type Gapic::Operation. You can use this
255
- # # object to check the status of an operation, cancel it, or wait
256
- # # for results. Here is how to block until completion:
268
+ # # The returned object is of type Gapic::Operation. You can use it to
269
+ # # check the status of an operation, cancel it, or wait for results.
270
+ # # Here is how to wait for a response.
257
271
  # result.wait_until_done! timeout: 60
258
272
  # if result.response?
259
273
  # p result.response
260
274
  # else
261
- # puts "Error!"
275
+ # puts "No response received."
262
276
  # end
263
277
  #
264
278
  def create_cluster request, options = nil
@@ -339,7 +353,7 @@ module Google
339
353
  # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash]
340
354
  # Required. The changes to the cluster.
341
355
  # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash]
342
- # Optional. Timeout for graceful YARN decomissioning. Graceful
356
+ # Optional. Timeout for graceful YARN decommissioning. Graceful
343
357
  # decommissioning allows removing nodes from the cluster without
344
358
  # interrupting jobs in progress. Timeout specifies how long to wait for jobs
345
359
  # in progress to finish before forcefully removing nodes (and potentially
@@ -434,14 +448,14 @@ module Google
434
448
  # # Call the update_cluster method.
435
449
  # result = client.update_cluster request
436
450
  #
437
- # # The returned object is of type Gapic::Operation. You can use this
438
- # # object to check the status of an operation, cancel it, or wait
439
- # # for results. Here is how to block until completion:
451
+ # # The returned object is of type Gapic::Operation. You can use it to
452
+ # # check the status of an operation, cancel it, or wait for results.
453
+ # # Here is how to wait for a response.
440
454
  # result.wait_until_done! timeout: 60
441
455
  # if result.response?
442
456
  # p result.response
443
457
  # else
444
- # puts "Error!"
458
+ # puts "No response received."
445
459
  # end
446
460
  #
447
461
  def update_cluster request, options = nil
@@ -554,14 +568,14 @@ module Google
554
568
  # # Call the stop_cluster method.
555
569
  # result = client.stop_cluster request
556
570
  #
557
- # # The returned object is of type Gapic::Operation. You can use this
558
- # # object to check the status of an operation, cancel it, or wait
559
- # # for results. Here is how to block until completion:
571
+ # # The returned object is of type Gapic::Operation. You can use it to
572
+ # # check the status of an operation, cancel it, or wait for results.
573
+ # # Here is how to wait for a response.
560
574
  # result.wait_until_done! timeout: 60
561
575
  # if result.response?
562
576
  # p result.response
563
577
  # else
564
- # puts "Error!"
578
+ # puts "No response received."
565
579
  # end
566
580
  #
567
581
  def stop_cluster request, options = nil
@@ -674,14 +688,14 @@ module Google
674
688
  # # Call the start_cluster method.
675
689
  # result = client.start_cluster request
676
690
  #
677
- # # The returned object is of type Gapic::Operation. You can use this
678
- # # object to check the status of an operation, cancel it, or wait
679
- # # for results. Here is how to block until completion:
691
+ # # The returned object is of type Gapic::Operation. You can use it to
692
+ # # check the status of an operation, cancel it, or wait for results.
693
+ # # Here is how to wait for a response.
680
694
  # result.wait_until_done! timeout: 60
681
695
  # if result.response?
682
696
  # p result.response
683
697
  # else
684
- # puts "Error!"
698
+ # puts "No response received."
685
699
  # end
686
700
  #
687
701
  def start_cluster request, options = nil
@@ -796,14 +810,14 @@ module Google
796
810
  # # Call the delete_cluster method.
797
811
  # result = client.delete_cluster request
798
812
  #
799
- # # The returned object is of type Gapic::Operation. You can use this
800
- # # object to check the status of an operation, cancel it, or wait
801
- # # for results. Here is how to block until completion:
813
+ # # The returned object is of type Gapic::Operation. You can use it to
814
+ # # check the status of an operation, cancel it, or wait for results.
815
+ # # Here is how to wait for a response.
802
816
  # result.wait_until_done! timeout: 60
803
817
  # if result.response?
804
818
  # p result.response
805
819
  # else
806
- # puts "Error!"
820
+ # puts "No response received."
807
821
  # end
808
822
  #
809
823
  def delete_cluster request, options = nil
@@ -1018,13 +1032,11 @@ module Google
1018
1032
  # # Call the list_clusters method.
1019
1033
  # result = client.list_clusters request
1020
1034
  #
1021
- # # The returned object is of type Gapic::PagedEnumerable. You can
1022
- # # iterate over all elements by calling #each, and the enumerable
1023
- # # will lazily make API calls to fetch subsequent pages. Other
1024
- # # methods are also available for managing paging directly.
1025
- # result.each do |response|
1035
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1036
+ # # over elements, and API calls will be issued to fetch pages as needed.
1037
+ # result.each do |item|
1026
1038
  # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster.
1027
- # p response
1039
+ # p item
1028
1040
  # end
1029
1041
  #
1030
1042
  def list_clusters request, options = nil
@@ -1124,14 +1136,14 @@ module Google
1124
1136
  # # Call the diagnose_cluster method.
1125
1137
  # result = client.diagnose_cluster request
1126
1138
  #
1127
- # # The returned object is of type Gapic::Operation. You can use this
1128
- # # object to check the status of an operation, cancel it, or wait
1129
- # # for results. Here is how to block until completion:
1139
+ # # The returned object is of type Gapic::Operation. You can use it to
1140
+ # # check the status of an operation, cancel it, or wait for results.
1141
+ # # Here is how to wait for a response.
1130
1142
  # result.wait_until_done! timeout: 60
1131
1143
  # if result.response?
1132
1144
  # p result.response
1133
1145
  # else
1134
- # puts "Error!"
1146
+ # puts "No response received."
1135
1147
  # end
1136
1148
  #
1137
1149
  def diagnose_cluster request, options = nil
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil
@@ -24,6 +24,25 @@ module Google
24
24
  module ClusterController
25
25
  # Path helper methods for the ClusterController API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified Cluster resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/clusters/{cluster}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param cluster [String]
37
+ #
38
+ # @return [::String]
39
+ def cluster_path project:, location:, cluster:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/clusters/#{cluster}"
44
+ end
45
+
27
46
  ##
28
47
  # Create a fully-qualified NodeGroup resource string.
29
48
  #
@@ -69,7 +69,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
69
69
  optional :zone_uri, :string, 1
70
70
  optional :network_uri, :string, 2
71
71
  optional :subnetwork_uri, :string, 6
72
- optional :internal_ip_only, :bool, 7
72
+ proto3_optional :internal_ip_only, :bool, 7
73
73
  optional :private_ipv6_google_access, :enum, 12, "google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess"
74
74
  optional :service_account, :string, 8
75
75
  repeated :service_account_scopes, :string, 3
@@ -90,9 +90,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
90
90
  optional :node_group_uri, :string, 1
91
91
  end
92
92
  add_message "google.cloud.dataproc.v1.ShieldedInstanceConfig" do
93
- optional :enable_secure_boot, :bool, 1
94
- optional :enable_vtpm, :bool, 2
95
- optional :enable_integrity_monitoring, :bool, 3
93
+ proto3_optional :enable_secure_boot, :bool, 1
94
+ proto3_optional :enable_vtpm, :bool, 2
95
+ proto3_optional :enable_integrity_monitoring, :bool, 3
96
96
  end
97
97
  add_message "google.cloud.dataproc.v1.ConfidentialInstanceConfig" do
98
98
  optional :enable_confidential_compute, :bool, 1
@@ -210,6 +210,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
210
210
  add_message "google.cloud.dataproc.v1.MetastoreConfig" do
211
211
  optional :dataproc_metastore_service, :string, 1
212
212
  end
213
+ add_message "google.cloud.dataproc.v1.ClusterMetrics" do
214
+ map :hdfs_metrics, :string, :int64, 1
215
+ map :yarn_metrics, :string, :int64, 2
216
+ end
213
217
  add_message "google.cloud.dataproc.v1.DataprocMetricConfig" do
214
218
  repeated :metrics, :message, 1, "google.cloud.dataproc.v1.DataprocMetricConfig.Metric"
215
219
  end
@@ -225,10 +229,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
225
229
  value :YARN, 4
226
230
  value :SPARK_HISTORY_SERVER, 5
227
231
  value :HIVESERVER2, 6
228
- end
229
- add_message "google.cloud.dataproc.v1.ClusterMetrics" do
230
- map :hdfs_metrics, :string, :int64, 1
231
- map :yarn_metrics, :string, :int64, 2
232
+ value :HIVEMETASTORE, 7
232
233
  end
233
234
  add_message "google.cloud.dataproc.v1.CreateClusterRequest" do
234
235
  optional :project_id, :string, 1
@@ -339,10 +340,10 @@ module Google
339
340
  SoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SoftwareConfig").msgclass
340
341
  LifecycleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LifecycleConfig").msgclass
341
342
  MetastoreConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.MetastoreConfig").msgclass
343
+ ClusterMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterMetrics").msgclass
342
344
  DataprocMetricConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig").msgclass
343
345
  DataprocMetricConfig::Metric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig.Metric").msgclass
344
346
  DataprocMetricConfig::MetricSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource").enummodule
345
- ClusterMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterMetrics").msgclass
346
347
  CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateClusterRequest").msgclass
347
348
  UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateClusterRequest").msgclass
348
349
  StopClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StopClusterRequest").msgclass