google-cloud-hypercompute_cluster-v1beta 1.2.0 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6564e45f036094fb632be081a41aa8668a6f590f359de474083bb65edeba2ef
4
- data.tar.gz: b73ecbab29c4e759026f46e9298f9786b73ab51d7953950c9326eb0662e95df0
3
+ metadata.gz: 78398966bfbd1b4125e9fd9a590e5b1055844b2e4f637e3ec36e770ec768e197
4
+ data.tar.gz: 296f5447598752a0f9a67c0ee3f5013840335b6ffcf57201c475ca5ed5f4eb21
5
5
  SHA512:
6
- metadata.gz: 123384f89daf70b7cdac5acbf574e5ba2ad7abd76cbee4a98d15798b85504a74ad95deb85ec6d84c0eff353b7539c28a410211e148f940590bc3537eab219205
7
- data.tar.gz: c755c693ec1e623e6b6ff2bc1c1f5b7020c6c6cf6fa4dfda203500d1c9b153dccfdf264af54cef2eb2f13278a92b3e73cdc17b917e50ba1917b37a0d84499ea1
6
+ metadata.gz: bc5358732710aaa88544ba82e69871ff9921aaff5598c7550b75be038df3e854fdd70b92ee9604d50e5e76d0ce843f626ffdcbd75de92af7c70e86fc7c6f8bdb
7
+ data.tar.gz: fa96286cb1473ba3e5b4cf0c604eb79a46b82900849a4c79a3f0676615aadad9c23bdad254d86d2c0a979f8229fd72728565735c7aa293fd80185a3b7a05b3e0
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  # Ruby Client for the Cluster Director V1BETA API
2
2
 
3
- API Client library for the Cluster Director V1BETA API
3
+ The Cluster Director API lets you deploy, manage, and monitor clusters that run artificial intelligence (AI), machine learning (ML), or high performance computing (HPC) workloads.
4
4
 
5
- google-cloud-hypercompute_cluster-v1beta is the official client library for the Cluster Director V1BETA API.
6
5
 
7
6
  https://github.com/googleapis/google-cloud-ruby
8
7
 
@@ -40,7 +39,7 @@ response = client.list_clusters request
40
39
  View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-hypercompute_cluster-v1beta/latest)
41
40
  for class and method documentation.
42
41
 
43
- See also the [Product Documentation](https://cloud.google.com/blog/products/compute/managed-slurm-and-other-cluster-director-enhancements)
42
+ See also the [Product Documentation](https://cloud.google.com/cluster-director/docs)
44
43
  for general usage information.
45
44
 
46
45
  ## Debug Logging
@@ -450,9 +450,10 @@ module Google
450
450
  # Required. Parent location in which the cluster should be created, in the
451
451
  # format `projects/{project}/locations/{location}`.
452
452
  # @param cluster_id [::String]
453
- # Required. ID of the cluster to create. Must conform to
454
- # [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
455
- # alphanumeric, and at most 63 characters).
453
+ # Required. The ID of the cluster to create.
454
+ # The cluster ID must start with a lowercase letter (`a`-`z`), use only
455
+ # lowercase letters or numbers, and contain up to 10 characters. For example,
456
+ # specify `cluster001`.
456
457
  # @param cluster [::Google::Cloud::HypercomputeCluster::V1beta::Cluster, ::Hash]
457
458
  # Required. Cluster to create.
458
459
  # @param request_id [::String]
@@ -734,6 +735,117 @@ module Google
734
735
  raise ::Google::Cloud::Error.from_error(e)
735
736
  end
736
737
 
738
+ ##
739
+ # Lists Nodes in a given cluster.
740
+ #
741
+ # @overload list_nodes(request, options = nil)
742
+ # Pass arguments to `list_nodes` via a request object, either of type
743
+ # {::Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest} or an equivalent Hash.
744
+ #
745
+ # @param request [::Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest, ::Hash]
746
+ # A request object representing the call parameters. Required. To specify no
747
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
748
+ # @param options [::Gapic::CallOptions, ::Hash]
749
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
750
+ #
751
+ # @overload list_nodes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
752
+ # Pass arguments to `list_nodes` via keyword arguments. Note that at
753
+ # least one keyword argument is required. To specify no parameters, or to keep all
754
+ # the default parameter values, pass an empty Hash as a request object (see above).
755
+ #
756
+ # @param parent [::String]
757
+ # Required. Parent cluster of the nodes to list, in the format
758
+ # `projects/{project}/locations/{location}/clusters/{cluster}`.
759
+ # @param page_size [::Integer]
760
+ # Optional. Maximum number of nodes to return. The service may return fewer
761
+ # than this value.
762
+ # @param page_token [::String]
763
+ # Optional. A page token received from a previous `ListNodes` call. Provide
764
+ # this to retrieve the subsequent page. When paginating, all other parameters
765
+ # provided to `ListNodes` must match the call that provided the page
766
+ # token.
767
+ # @param filter [::String]
768
+ # Optional. [Filter](https://google.aip.dev/160) to apply to the returned
769
+ # results.
770
+ # @param order_by [::String]
771
+ # Optional. How to order the resulting nodes. Must be one of the following
772
+ # strings:
773
+ #
774
+ # * `name`
775
+ # * `name desc`
776
+ #
777
+ # If not specified, nodes will be returned in an arbitrary order.
778
+ #
779
+ # @yield [response, operation] Access the result along with the RPC operation
780
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Node>]
781
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
782
+ #
783
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Node>]
784
+ #
785
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
786
+ #
787
+ # @example Basic example
788
+ # require "google/cloud/hypercompute_cluster/v1beta"
789
+ #
790
+ # # Create a client object. The client can be reused for multiple calls.
791
+ # client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Client.new
792
+ #
793
+ # # Create a request. To set request fields, pass in keyword arguments.
794
+ # request = Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest.new
795
+ #
796
+ # # Call the list_nodes method.
797
+ # result = client.list_nodes request
798
+ #
799
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
800
+ # # over elements, and API calls will be issued to fetch pages as needed.
801
+ # result.each do |item|
802
+ # # Each element is of type ::Google::Cloud::HypercomputeCluster::V1beta::Node.
803
+ # p item
804
+ # end
805
+ #
806
+ def list_nodes request, options = nil
807
+ raise ::ArgumentError, "request must be provided" if request.nil?
808
+
809
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest
810
+
811
+ # Converts hash and nil to an options object
812
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
813
+
814
+ # Customize the options with defaults
815
+ metadata = @config.rpcs.list_nodes.metadata.to_h
816
+
817
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
818
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
819
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
820
+ gapic_version: ::Google::Cloud::HypercomputeCluster::V1beta::VERSION
821
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
822
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
823
+
824
+ header_params = {}
825
+ if request.parent
826
+ header_params["parent"] = request.parent
827
+ end
828
+
829
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
830
+ metadata[:"x-goog-request-params"] ||= request_params_header
831
+
832
+ options.apply_defaults timeout: @config.rpcs.list_nodes.timeout,
833
+ metadata: metadata,
834
+ retry_policy: @config.rpcs.list_nodes.retry_policy
835
+
836
+ options.apply_defaults timeout: @config.timeout,
837
+ metadata: @config.metadata,
838
+ retry_policy: @config.retry_policy
839
+
840
+ @hypercompute_cluster_stub.call_rpc :list_nodes, request, options: options do |response, operation|
841
+ response = ::Gapic::PagedEnumerable.new @hypercompute_cluster_stub, :list_nodes, request, response, operation, options
842
+ yield response, operation if block_given?
843
+ throw :response, response
844
+ end
845
+ rescue ::GRPC::BadStatus => e
846
+ raise ::Google::Cloud::Error.from_error(e)
847
+ end
848
+
737
849
  ##
738
850
  # Configuration class for the HypercomputeCluster API.
739
851
  #
@@ -944,6 +1056,11 @@ module Google
944
1056
  # @return [::Gapic::Config::Method]
945
1057
  #
946
1058
  attr_reader :delete_cluster
1059
+ ##
1060
+ # RPC-specific configuration for `list_nodes`
1061
+ # @return [::Gapic::Config::Method]
1062
+ #
1063
+ attr_reader :list_nodes
947
1064
 
948
1065
  # @private
949
1066
  def initialize parent_rpcs = nil
@@ -957,6 +1074,8 @@ module Google
957
1074
  @update_cluster = ::Gapic::Config::Method.new update_cluster_config
958
1075
  delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
959
1076
  @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
1077
+ list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes
1078
+ @list_nodes = ::Gapic::Config::Method.new list_nodes_config
960
1079
 
961
1080
  yield self if block_given?
962
1081
  end
@@ -79,6 +79,25 @@ module Google
79
79
  "projects/#{project}/zones/#{zone}/instances/#{instance}"
80
80
  end
81
81
 
82
+ ##
83
+ # Create a fully-qualified Disk resource string.
84
+ #
85
+ # The resource will be in the following format:
86
+ #
87
+ # `projects/{project}/zones/{zone}/disks/{disk}`
88
+ #
89
+ # @param project [String]
90
+ # @param zone [String]
91
+ # @param disk [String]
92
+ #
93
+ # @return [::String]
94
+ def disk_path project:, zone:, disk:
95
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
96
+ raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"
97
+
98
+ "projects/#{project}/zones/#{zone}/disks/#{disk}"
99
+ end
100
+
82
101
  ##
83
102
  # Create a fully-qualified DiskType resource string.
84
103
  #
@@ -118,24 +137,24 @@ module Google
118
137
  end
119
138
 
120
139
  ##
121
- # Create a fully-qualified Location resource string.
140
+ # Create a fully-qualified Image resource string.
122
141
  #
123
142
  # The resource will be in the following format:
124
143
  #
125
- # `projects/{project}/locations/{location}`
144
+ # `projects/{project}/global/images/{image}`
126
145
  #
127
146
  # @param project [String]
128
- # @param location [String]
147
+ # @param image [String]
129
148
  #
130
149
  # @return [::String]
131
- def location_path project:, location:
150
+ def image_path project:, image:
132
151
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
133
152
 
134
- "projects/#{project}/locations/#{location}"
153
+ "projects/#{project}/global/images/#{image}"
135
154
  end
136
155
 
137
156
  ##
138
- # Create a fully-qualified LustreInstance resource string.
157
+ # Create a fully-qualified Instance resource string.
139
158
  #
140
159
  # The resource will be in the following format:
141
160
  #
@@ -146,13 +165,90 @@ module Google
146
165
  # @param instance [String]
147
166
  #
148
167
  # @return [::String]
149
- def lustre_instance_path project:, location:, instance:
168
+ def instance_path project:, location:, instance:
150
169
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
151
170
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
152
171
 
153
172
  "projects/#{project}/locations/#{location}/instances/#{instance}"
154
173
  end
155
174
 
175
+ ##
176
+ # Create a fully-qualified InstanceGroupManager resource string.
177
+ #
178
+ # @overload instance_group_manager_path(project:, zone:, instance_group_manager:)
179
+ # The resource will be in the following format:
180
+ #
181
+ # `projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}`
182
+ #
183
+ # @param project [String]
184
+ # @param zone [String]
185
+ # @param instance_group_manager [String]
186
+ #
187
+ # @overload instance_group_manager_path(project:, region:, instance_group_manager:)
188
+ # The resource will be in the following format:
189
+ #
190
+ # `projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}`
191
+ #
192
+ # @param project [String]
193
+ # @param region [String]
194
+ # @param instance_group_manager [String]
195
+ #
196
+ # @return [::String]
197
+ def instance_group_manager_path **args
198
+ resources = {
199
+ "instance_group_manager:project:zone" => (proc do |project:, zone:, instance_group_manager:|
200
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
201
+ raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"
202
+
203
+ "projects/#{project}/zones/#{zone}/instanceGroupManagers/#{instance_group_manager}"
204
+ end),
205
+ "instance_group_manager:project:region" => (proc do |project:, region:, instance_group_manager:|
206
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
207
+ raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"
208
+
209
+ "projects/#{project}/regions/#{region}/instanceGroupManagers/#{instance_group_manager}"
210
+ end)
211
+ }
212
+
213
+ resource = resources[args.keys.sort.join(":")]
214
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
215
+ resource.call(**args)
216
+ end
217
+
218
+ ##
219
+ # Create a fully-qualified InstanceTemplate resource string.
220
+ #
221
+ # The resource will be in the following format:
222
+ #
223
+ # `projects/{project}/global/instanceTemplates/{instance_template}`
224
+ #
225
+ # @param project [String]
226
+ # @param instance_template [String]
227
+ #
228
+ # @return [::String]
229
+ def instance_template_path project:, instance_template:
230
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
231
+
232
+ "projects/#{project}/global/instanceTemplates/#{instance_template}"
233
+ end
234
+
235
+ ##
236
+ # Create a fully-qualified Location resource string.
237
+ #
238
+ # The resource will be in the following format:
239
+ #
240
+ # `projects/{project}/locations/{location}`
241
+ #
242
+ # @param project [String]
243
+ # @param location [String]
244
+ #
245
+ # @return [::String]
246
+ def location_path project:, location:
247
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
248
+
249
+ "projects/#{project}/locations/#{location}"
250
+ end
251
+
156
252
  ##
157
253
  # Create a fully-qualified Network resource string.
158
254
  #
@@ -170,6 +266,20 @@ module Google
170
266
  "projects/#{project}/global/networks/#{network}"
171
267
  end
172
268
 
269
+ ##
270
+ # Create a fully-qualified Project resource string.
271
+ #
272
+ # The resource will be in the following format:
273
+ #
274
+ # `projects/{project}`
275
+ #
276
+ # @param project [String]
277
+ #
278
+ # @return [::String]
279
+ def project_path project:
280
+ "projects/#{project}"
281
+ end
282
+
173
283
  ##
174
284
  # Create a fully-qualified Reservation resource string.
175
285
  #
@@ -189,6 +299,110 @@ module Google
189
299
  "projects/#{project}/zones/#{zone}/reservations/#{reservation}"
190
300
  end
191
301
 
302
+ ##
303
+ # Create a fully-qualified ReservationBlock resource string.
304
+ #
305
+ # The resource will be in the following format:
306
+ #
307
+ # `projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks/{reservation_block}`
308
+ #
309
+ # @param project [String]
310
+ # @param zone [String]
311
+ # @param reservation [String]
312
+ # @param reservation_block [String]
313
+ #
314
+ # @return [::String]
315
+ def reservation_block_path project:, zone:, reservation:, reservation_block:
316
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
317
+ raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"
318
+ raise ::ArgumentError, "reservation cannot contain /" if reservation.to_s.include? "/"
319
+
320
+ "projects/#{project}/zones/#{zone}/reservations/#{reservation}/reservationBlocks/#{reservation_block}"
321
+ end
322
+
323
+ ##
324
+ # Create a fully-qualified ReservationSubBlock resource string.
325
+ #
326
+ # The resource will be in the following format:
327
+ #
328
+ # `projects/{project}/zones/{zone}/reservations/{reservation}/reservationBlocks/{reservation_block}/reservationSubBlocks/{reservation_sub_block}`
329
+ #
330
+ # @param project [String]
331
+ # @param zone [String]
332
+ # @param reservation [String]
333
+ # @param reservation_block [String]
334
+ # @param reservation_sub_block [String]
335
+ #
336
+ # @return [::String]
337
+ def reservation_sub_block_path project:, zone:, reservation:, reservation_block:, reservation_sub_block:
338
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
339
+ raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"
340
+ raise ::ArgumentError, "reservation cannot contain /" if reservation.to_s.include? "/"
341
+ raise ::ArgumentError, "reservation_block cannot contain /" if reservation_block.to_s.include? "/"
342
+
343
+ "projects/#{project}/zones/#{zone}/reservations/#{reservation}/reservationBlocks/#{reservation_block}/reservationSubBlocks/#{reservation_sub_block}"
344
+ end
345
+
346
+ ##
347
+ # Create a fully-qualified Snapshot resource string.
348
+ #
349
+ # @overload snapshot_path(project:, snapshot:)
350
+ # The resource will be in the following format:
351
+ #
352
+ # `projects/{project}/global/snapshots/{snapshot}`
353
+ #
354
+ # @param project [String]
355
+ # @param snapshot [String]
356
+ #
357
+ # @overload snapshot_path(project:, region:, snapshot:)
358
+ # The resource will be in the following format:
359
+ #
360
+ # `projects/{project}/regions/{region}/snapshots/{snapshot}`
361
+ #
362
+ # @param project [String]
363
+ # @param region [String]
364
+ # @param snapshot [String]
365
+ #
366
+ # @return [::String]
367
+ def snapshot_path **args
368
+ resources = {
369
+ "project:snapshot" => (proc do |project:, snapshot:|
370
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
371
+
372
+ "projects/#{project}/global/snapshots/#{snapshot}"
373
+ end),
374
+ "project:region:snapshot" => (proc do |project:, region:, snapshot:|
375
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
376
+ raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"
377
+
378
+ "projects/#{project}/regions/#{region}/snapshots/#{snapshot}"
379
+ end)
380
+ }
381
+
382
+ resource = resources[args.keys.sort.join(":")]
383
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
384
+ resource.call(**args)
385
+ end
386
+
387
+ ##
388
+ # Create a fully-qualified StoragePool resource string.
389
+ #
390
+ # The resource will be in the following format:
391
+ #
392
+ # `projects/{project}/zones/{zone}/storagePools/{storage_pool}`
393
+ #
394
+ # @param project [String]
395
+ # @param zone [String]
396
+ # @param storage_pool [String]
397
+ #
398
+ # @return [::String]
399
+ def storage_pool_path project:, zone:, storage_pool:
400
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
401
+ raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"
402
+
403
+ "projects/#{project}/zones/#{zone}/storagePools/#{storage_pool}"
404
+ end
405
+
192
406
  ##
193
407
  # Create a fully-qualified Subnetwork resource string.
194
408
  #
@@ -430,9 +430,10 @@ module Google
430
430
  # Required. Parent location in which the cluster should be created, in the
431
431
  # format `projects/{project}/locations/{location}`.
432
432
  # @param cluster_id [::String]
433
- # Required. ID of the cluster to create. Must conform to
434
- # [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case,
435
- # alphanumeric, and at most 63 characters).
433
+ # Required. The ID of the cluster to create.
434
+ # The cluster ID must start with a lowercase letter (`a`-`z`), use only
435
+ # lowercase letters or numbers, and contain up to 10 characters. For example,
436
+ # specify `cluster001`.
436
437
  # @param cluster [::Google::Cloud::HypercomputeCluster::V1beta::Cluster, ::Hash]
437
438
  # Required. Cluster to create.
438
439
  # @param request_id [::String]
@@ -693,6 +694,110 @@ module Google
693
694
  raise ::Google::Cloud::Error.from_error(e)
694
695
  end
695
696
 
697
+ ##
698
+ # Lists Nodes in a given cluster.
699
+ #
700
+ # @overload list_nodes(request, options = nil)
701
+ # Pass arguments to `list_nodes` via a request object, either of type
702
+ # {::Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest} or an equivalent Hash.
703
+ #
704
+ # @param request [::Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest, ::Hash]
705
+ # A request object representing the call parameters. Required. To specify no
706
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
707
+ # @param options [::Gapic::CallOptions, ::Hash]
708
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
709
+ #
710
+ # @overload list_nodes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
711
+ # Pass arguments to `list_nodes` via keyword arguments. Note that at
712
+ # least one keyword argument is required. To specify no parameters, or to keep all
713
+ # the default parameter values, pass an empty Hash as a request object (see above).
714
+ #
715
+ # @param parent [::String]
716
+ # Required. Parent cluster of the nodes to list, in the format
717
+ # `projects/{project}/locations/{location}/clusters/{cluster}`.
718
+ # @param page_size [::Integer]
719
+ # Optional. Maximum number of nodes to return. The service may return fewer
720
+ # than this value.
721
+ # @param page_token [::String]
722
+ # Optional. A page token received from a previous `ListNodes` call. Provide
723
+ # this to retrieve the subsequent page. When paginating, all other parameters
724
+ # provided to `ListNodes` must match the call that provided the page
725
+ # token.
726
+ # @param filter [::String]
727
+ # Optional. [Filter](https://google.aip.dev/160) to apply to the returned
728
+ # results.
729
+ # @param order_by [::String]
730
+ # Optional. How to order the resulting nodes. Must be one of the following
731
+ # strings:
732
+ #
733
+ # * `name`
734
+ # * `name desc`
735
+ #
736
+ # If not specified, nodes will be returned in an arbitrary order.
737
+ # @yield [result, operation] Access the result along with the TransportOperation object
738
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Node>]
739
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
740
+ #
741
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Node>]
742
+ #
743
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
744
+ #
745
+ # @example Basic example
746
+ # require "google/cloud/hypercompute_cluster/v1beta"
747
+ #
748
+ # # Create a client object. The client can be reused for multiple calls.
749
+ # client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new
750
+ #
751
+ # # Create a request. To set request fields, pass in keyword arguments.
752
+ # request = Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest.new
753
+ #
754
+ # # Call the list_nodes method.
755
+ # result = client.list_nodes request
756
+ #
757
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
758
+ # # over elements, and API calls will be issued to fetch pages as needed.
759
+ # result.each do |item|
760
+ # # Each element is of type ::Google::Cloud::HypercomputeCluster::V1beta::Node.
761
+ # p item
762
+ # end
763
+ #
764
+ def list_nodes request, options = nil
765
+ raise ::ArgumentError, "request must be provided" if request.nil?
766
+
767
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::HypercomputeCluster::V1beta::ListNodesRequest
768
+
769
+ # Converts hash and nil to an options object
770
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
771
+
772
+ # Customize the options with defaults
773
+ call_metadata = @config.rpcs.list_nodes.metadata.to_h
774
+
775
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
776
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
777
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
778
+ gapic_version: ::Google::Cloud::HypercomputeCluster::V1beta::VERSION,
779
+ transports_version_send: [:rest]
780
+
781
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
782
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
783
+
784
+ options.apply_defaults timeout: @config.rpcs.list_nodes.timeout,
785
+ metadata: call_metadata,
786
+ retry_policy: @config.rpcs.list_nodes.retry_policy
787
+
788
+ options.apply_defaults timeout: @config.timeout,
789
+ metadata: @config.metadata,
790
+ retry_policy: @config.retry_policy
791
+
792
+ @hypercompute_cluster_stub.list_nodes request, options do |result, operation|
793
+ result = ::Gapic::Rest::PagedEnumerable.new @hypercompute_cluster_stub, :list_nodes, "nodes", request, result, options
794
+ yield result, operation if block_given?
795
+ throw :response, result
796
+ end
797
+ rescue ::Gapic::Rest::Error => e
798
+ raise ::Google::Cloud::Error.from_error(e)
799
+ end
800
+
696
801
  ##
697
802
  # Configuration class for the HypercomputeCluster REST API.
698
803
  #
@@ -873,6 +978,11 @@ module Google
873
978
  # @return [::Gapic::Config::Method]
874
979
  #
875
980
  attr_reader :delete_cluster
981
+ ##
982
+ # RPC-specific configuration for `list_nodes`
983
+ # @return [::Gapic::Config::Method]
984
+ #
985
+ attr_reader :list_nodes
876
986
 
877
987
  # @private
878
988
  def initialize parent_rpcs = nil
@@ -886,6 +996,8 @@ module Google
886
996
  @update_cluster = ::Gapic::Config::Method.new update_cluster_config
887
997
  delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
888
998
  @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
999
+ list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes
1000
+ @list_nodes = ::Gapic::Config::Method.new list_nodes_config
889
1001
 
890
1002
  yield self if block_given?
891
1003
  end