Cluster Director V1BETA API - Class Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client (v0.1.0)

Reference documentation and code samples for the Cluster Director V1BETA API class Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.

REST client for the HypercomputeCluster service.

Service describing handlers for resources

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the HypercomputeCluster Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all HypercomputeCluster clients
::Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the HypercomputeCluster Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_cluster

def create_cluster(request, options = nil) -> ::Gapic::Operation
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Cluster in a given project and location.

Overloads
def create_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_cluster via a request object, either of type CreateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::HypercomputeCluster::V1beta::CreateClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent location in which the cluster should be created, in the format projects/{project}/locations/{location}.
  • cluster_id (::String) — Required. ID of the cluster to create. Must conform to RFC-1034 (lower-case, alphanumeric, and at most 63 characters).
  • cluster (::Google::Cloud::HypercomputeCluster::V1beta::Cluster, ::Hash) — Required. Cluster to create.
  • request_id (::String) — Optional. A unique identifier for this request. A random UUID is recommended. This request is idempotent if and only if request_id is provided.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/hypercompute_cluster/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::HypercomputeCluster::V1beta::CreateClusterRequest.new

# Call the create_cluster method.
result = client.create_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_cluster

def delete_cluster(request, options = nil) -> ::Gapic::Operation
def delete_cluster(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a single Cluster.

Overloads
def delete_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_cluster via a request object, either of type DeleteClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::HypercomputeCluster::V1beta::DeleteClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_cluster(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the cluster to delete, in the format projects/{project}/locations/{location}/clusters/{cluster}.
  • request_id (::String) — Optional. A unique identifier for this request. A random UUID is recommended. This request is idempotent if and only if request_id is provided.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/hypercompute_cluster/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::HypercomputeCluster::V1beta::DeleteClusterRequest.new

# Call the delete_cluster method.
result = client.delete_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_cluster

def get_cluster(request, options = nil) -> ::Google::Cloud::HypercomputeCluster::V1beta::Cluster
def get_cluster(name: nil) -> ::Google::Cloud::HypercomputeCluster::V1beta::Cluster

Gets details of a single Cluster.

Overloads
def get_cluster(request, options = nil) -> ::Google::Cloud::HypercomputeCluster::V1beta::Cluster
Pass arguments to get_cluster via a request object, either of type GetClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::HypercomputeCluster::V1beta::GetClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_cluster(name: nil) -> ::Google::Cloud::HypercomputeCluster::V1beta::Cluster
Pass arguments to get_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the cluster to retrieve, in the format projects/{project}/locations/{location}/clusters/{cluster}.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/hypercompute_cluster/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::HypercomputeCluster::V1beta::GetClusterRequest.new

# Call the get_cluster method.
result = client.get_cluster request

# The returned object is of type Google::Cloud::HypercomputeCluster::V1beta::Cluster.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new HypercomputeCluster REST client object.

Yields
  • (config) — Configure the HypercomputeCluster client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_clusters

def list_clusters(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Cluster>
def list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Cluster>

Lists Clusters in a given project and location.

Overloads
def list_clusters(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Cluster>
Pass arguments to list_clusters via a request object, either of type ListClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::HypercomputeCluster::V1beta::ListClustersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::HypercomputeCluster::V1beta::Cluster>
Pass arguments to list_clusters via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Parent location of the clusters to list, in the format projects/{project}/locations/{location}.
  • page_size (::Integer) — Optional. Maximum number of clusters to return. The service may return fewer than this value.
  • page_token (::String) — Optional. A page token received from a previous ListClusters call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListClusters must match the call that provided the page token.
  • filter (::String) — Optional. Filter to apply to the returned results.
  • order_by (::String) — Optional. How to order the resulting clusters. Must be one of the following strings:

    • name
    • name desc
    • create_time
    • create_time desc

    If not specified, clusters will be returned in an arbitrary order.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/hypercompute_cluster/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::HypercomputeCluster::V1beta::ListClustersRequest.new

# Call the list_clusters method.
result = client.list_clusters request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::HypercomputeCluster::V1beta::Cluster.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_cluster

def update_cluster(request, options = nil) -> ::Gapic::Operation
def update_cluster(cluster: nil, update_mask: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Cluster.

Overloads
def update_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_cluster via a request object, either of type UpdateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::HypercomputeCluster::V1beta::UpdateClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_cluster(cluster: nil, update_mask: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • cluster (::Google::Cloud::HypercomputeCluster::V1beta::Cluster, ::Hash) — Required. Cluster to update.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Mask specifying which fields in the cluster to update. All paths must be specified explicitly - wildcards are not supported. At least one path must be provided.
  • request_id (::String) — Optional. A unique identifier for this request. A random UUID is recommended. This request is idempotent if and only if request_id is provided.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/hypercompute_cluster/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::HypercomputeCluster::V1beta::HypercomputeCluster::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::HypercomputeCluster::V1beta::UpdateClusterRequest.new

# Call the update_cluster method.
result = client.update_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end