Anthos Multi-Cloud V1 API - Class Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client (v0.4.0)

Reference documentation and code samples for the Anthos Multi-Cloud V1 API class Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.

Client for the AwsClusters service.

The AwsClusters API provides a single centrally managed service to create and manage Anthos clusters that run on AWS infrastructure.

Inherits

  • Object

Methods

.configure

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

Configure the AwsClusters 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 AwsClusters clients
::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the AwsClusters 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_aws_cluster

def create_aws_cluster(request, options = nil) -> ::Gapic::Operation
def create_aws_cluster(parent: nil, aws_cluster: nil, aws_cluster_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new AwsCluster resource on a given Google Cloud Platform project and region.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

Overloads
def create_aws_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_aws_cluster via a request object, either of type CreateAwsClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest, ::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_aws_cluster(parent: nil, aws_cluster: nil, aws_cluster_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_aws_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. The parent location where this AwsCluster resource will be created.

    Location names are formatted as projects/<project-id>/locations/<region>.

    See Resource Names for more details on Google Cloud resource names.

  • aws_cluster (::Google::Cloud::GkeMultiCloud::V1::AwsCluster, ::Hash) — Required. The specification of the AwsCluster to create.
  • aws_cluster_id (::String) — Required. A client provided ID the resource. Must be unique within the parent resource.

    The provided ID will be part of the AwsCluster resource name formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>.

    Valid characters are /[a-z][0-9]-/. Cannot be longer than 63 characters.

  • validate_only (::Boolean) — If set, only validate the request, but do not actually create the cluster.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest.new

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

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

#create_aws_node_pool

def create_aws_node_pool(request, options = nil) -> ::Gapic::Operation
def create_aws_node_pool(parent: nil, aws_node_pool: nil, aws_node_pool_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new AwsNodePool, attached to a given AwsCluster.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

Overloads
def create_aws_node_pool(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_aws_node_pool via a request object, either of type CreateAwsNodePoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest, ::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_aws_node_pool(parent: nil, aws_node_pool: nil, aws_node_pool_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_aws_node_pool 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. The AwsCluster resource where this node pool will be created.

    AwsCluster names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>.

    See Resource Names for more details on Google Cloud resource names.

  • aws_node_pool (::Google::Cloud::GkeMultiCloud::V1::AwsNodePool, ::Hash) — Required. The specification of the AwsNodePool to create.
  • aws_node_pool_id (::String) — Required. A client provided ID the resource. Must be unique within the parent resource.

    The provided ID will be part of the AwsNodePool resource name formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>/awsNodePools/<node-pool-id>.

    Valid characters are /[a-z][0-9]-/. Cannot be longer than 63 characters.

  • validate_only (::Boolean) — If set, only validate the request, but do not actually create the node pool.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest.new

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

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

#delete_aws_cluster

def delete_aws_cluster(request, options = nil) -> ::Gapic::Operation
def delete_aws_cluster(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Deletes a specific AwsCluster resource.

Fails if the cluster has one or more associated AwsNodePool resources.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

Overloads
def delete_aws_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_aws_cluster via a request object, either of type DeleteAwsClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest, ::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_aws_cluster(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to delete_aws_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. The resource name the AwsCluster to delete.

    AwsCluster names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>.

    See Resource Names for more details on Google Cloud Platform resource names.

  • validate_only (::Boolean) — If set, only validate the request, but do not actually delete the resource.
  • allow_missing (::Boolean) — If set to true, and the AwsCluster resource is not found, the request will succeed but no action will be taken on the server and a completed Operation will be returned.

    Useful for idempotent deletion.

  • etag (::String) — The current etag of the AwsCluster.

    Allows clients to perform deletions through optimistic concurrency control.

    If the provided etag does not match the current etag of the cluster, the request will fail and an ABORTED error will be returned.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest.new

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

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

#delete_aws_node_pool

def delete_aws_node_pool(request, options = nil) -> ::Gapic::Operation
def delete_aws_node_pool(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation

Deletes a specific AwsNodePool resource.

If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.

Overloads
def delete_aws_node_pool(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_aws_node_pool via a request object, either of type DeleteAwsNodePoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest, ::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_aws_node_pool(name: nil, validate_only: nil, allow_missing: nil, etag: nil) -> ::Gapic::Operation
Pass arguments to delete_aws_node_pool 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. The resource name the AwsNodePool to delete.

    AwsNodePool names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>/awsNodePools/<node-pool-id>.

    See Resource Names for more details on Google Cloud resource names.

  • validate_only (::Boolean) — If set, only validate the request, but do not actually delete the node pool.
  • allow_missing (::Boolean) — If set to true, and the AwsNodePool resource is not found, the request will succeed but no action will be taken on the server and a completed Operation will be returned.

    Useful for idempotent deletion.

  • etag (::String) — The current ETag of the AwsNodePool.

    Allows clients to perform deletions through optimistic concurrency control.

    If the provided ETag does not match the current etag of the node pool, the request will fail and an ABORTED error will be returned.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest.new

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

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

#generate_aws_access_token

def generate_aws_access_token(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse
def generate_aws_access_token(aws_cluster: nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse

Generates a short-lived access token to authenticate to a given AwsCluster resource.

Overloads
def generate_aws_access_token(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse
Pass arguments to generate_aws_access_token via a request object, either of type GenerateAwsAccessTokenRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest, ::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 generate_aws_access_token(aws_cluster: nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse
Pass arguments to generate_aws_access_token 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
  • aws_cluster (::String) — Required. The name of the AwsCluster resource to authenticate to.

    AwsCluster names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>.

    See Resource Names for more details on Google Cloud resource names.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest.new

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

# The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse.
p result

#get_aws_cluster

def get_aws_cluster(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsCluster
def get_aws_cluster(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsCluster

Describes a specific AwsCluster resource.

Overloads
def get_aws_cluster(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsCluster
Pass arguments to get_aws_cluster via a request object, either of type GetAwsClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest, ::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_aws_cluster(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsCluster
Pass arguments to get_aws_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. The name of the AwsCluster resource to describe.

    AwsCluster names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>.

    See Resource Names for more details on Google Cloud Platform resource names.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest.new

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

# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsCluster.
p result

#get_aws_node_pool

def get_aws_node_pool(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool
def get_aws_node_pool(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool

Describes a specific AwsNodePool resource.

Overloads
def get_aws_node_pool(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool
Pass arguments to get_aws_node_pool via a request object, either of type GetAwsNodePoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest, ::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_aws_node_pool(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool
Pass arguments to get_aws_node_pool 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. The name of the AwsNodePool resource to describe.

    AwsNodePool names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>/awsNodePools/<node-pool-id>.

    See Resource Names for more details on Google Cloud resource names.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest.new

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

# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsNodePool.
p result

#get_aws_server_config

def get_aws_server_config(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig
def get_aws_server_config(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig

Returns information, such as supported AWS regions and Kubernetes versions, on a given Google Cloud location.

Overloads
def get_aws_server_config(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig
Pass arguments to get_aws_server_config via a request object, either of type GetAwsServerConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest, ::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_aws_server_config(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AwsServerConfig
Pass arguments to get_aws_server_config 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. The name of the AwsServerConfig resource to describe.

    AwsServerConfig names are formatted as projects/<project-id>/locations/<region>/awsServerConfig.

    See Resource Names for more details on Google Cloud resource names.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest.new

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

# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsServerConfig.
p result

#initialize

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

Create a new AwsClusters client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new do |config|
  config.timeout = 10.0
end

#list_aws_clusters

def list_aws_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsCluster>
def list_aws_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsCluster>

Lists all AwsCluster resources on a given Google Cloud project and region.

Overloads
def list_aws_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsCluster>
Pass arguments to list_aws_clusters via a request object, either of type ListAwsClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest, ::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_aws_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsCluster>
Pass arguments to list_aws_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. The parent location which owns this collection of AwsCluster resources.

    Location names are formatted as projects/<project-id>/locations/<region>.

    See Resource Names for more details on Google Cloud Platform resource names.

  • page_size (::Integer) — The maximum number of items to return.

    If not specified, a default value of 50 will be used by the service. Regardless of the pageSize value, the response can include a partial list and a caller should only rely on response's nextPageToken to determine if there are more instances left to be queried.

  • page_token (::String) — The nextPageToken value returned from a previous awsClusters.list request, if any.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsCluster.
  p response
end

#list_aws_node_pools

def list_aws_node_pools(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsNodePool>
def list_aws_node_pools(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsNodePool>

Lists all AwsNodePool resources on a given AwsCluster.

Overloads
def list_aws_node_pools(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsNodePool>
Pass arguments to list_aws_node_pools via a request object, either of type ListAwsNodePoolsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest, ::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_aws_node_pools(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AwsNodePool>
Pass arguments to list_aws_node_pools 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. The parent AwsCluster which owns this collection of AwsNodePool resources.

    AwsCluster names are formatted as projects/<project-id>/locations/<region>/awsClusters/<cluster-id>.

    See Resource Names for more details on Google Cloud resource names.

  • page_size (::Integer) — The maximum number of items to return.

    If not specified, a default value of 50 will be used by the service. Regardless of the pageSize value, the response can include a partial list and a caller should only rely on response's nextPageToken to determine if there are more instances left to be queried.

  • page_token (::String) — The nextPageToken value returned from a previous awsNodePools.list request, if any.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool.
  p response
end

#operations_client

def operations_client() -> ::Google::Cloud::GkeMultiCloud::V1::AwsClusters::Operations

Get the associated client for long-running operations.

#update_aws_cluster

def update_aws_cluster(request, options = nil) -> ::Gapic::Operation
def update_aws_cluster(aws_cluster: nil, validate_only: nil, update_mask: nil) -> ::Gapic::Operation

Updates an AwsCluster.

Overloads
def update_aws_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_aws_cluster via a request object, either of type UpdateAwsClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest, ::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_aws_cluster(aws_cluster: nil, validate_only: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_aws_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
  • aws_cluster (::Google::Cloud::GkeMultiCloud::V1::AwsCluster, ::Hash) — Required. The AwsCluster resource to update.
  • validate_only (::Boolean) — If set, only validate the request, but do not actually update the cluster.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) —

    Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field can only include these fields from AwsCluster:

    • description.
    • annotations.
    • control_plane.version.
    • authorization.admin_users.
    • control_plane.aws_services_authentication.role_arn.
    • control_plane.aws_services_authentication.role_session_name.
    • control_plane.config_encryption.kms_key_arn.
    • control_plane.instance_type.
    • control_plane.security_group_ids.
    • control_plane.proxy_config.
    • control_plane.proxy_config.secret_arn.
    • control_plane.proxy_config.secret_version.
    • control_plane.root_volume.size_gib.
    • control_plane.root_volume.volume_type.
    • control_plane.root_volume.iops.
    • control_plane.root_volume.kms_key_arn.
    • control_plane.ssh_config.
    • control_plane.ssh_config.ec2_key_pair.
    • control_plane.instance_placement.tenancy.
    • control_plane.iam_instance_profile.
    • logging_config.component_config.enable_components.
    • control_plane.tags.
    • monitoring_config.managed_prometheus_config.enabled.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest.new

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

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

#update_aws_node_pool

def update_aws_node_pool(request, options = nil) -> ::Gapic::Operation
def update_aws_node_pool(aws_node_pool: nil, validate_only: nil, update_mask: nil) -> ::Gapic::Operation

Updates an AwsNodePool.

Overloads
def update_aws_node_pool(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_aws_node_pool via a request object, either of type UpdateAwsNodePoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest, ::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_aws_node_pool(aws_node_pool: nil, validate_only: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_aws_node_pool 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
  • aws_node_pool (::Google::Cloud::GkeMultiCloud::V1::AwsNodePool, ::Hash) — Required. The AwsNodePool resource to update.
  • validate_only (::Boolean) — If set, only validate the request, but don't actually update the node pool.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) —

    Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field can only include these fields from AwsNodePool:

    • annotations.
    • version.
    • autoscaling.min_node_count.
    • autoscaling.max_node_count.
    • config.config_encryption.kms_key_arn.
    • config.security_group_ids.
    • config.root_volume.iops.
    • config.root_volume.kms_key_arn.
    • config.root_volume.volume_type.
    • config.root_volume.size_gib.
    • config.proxy_config.
    • config.proxy_config.secret_arn.
    • config.proxy_config.secret_version.
    • config.ssh_config.
    • config.ssh_config.ec2_key_pair.
    • config.instance_placement.tenancy.
    • config.iam_instance_profile.
    • config.labels.
    • config.tags.
    • config.autoscaling_metrics_collection.
    • config.autoscaling_metrics_collection.granularity.
    • config.autoscaling_metrics_collection.metrics.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/gke_multi_cloud/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest.new

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

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