Reference documentation and code samples for the Anthos Multi-Cloud V1 API class Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.
Client for the AttachedClusters service.
The AttachedClusters API provides a single centrally managed service to register and manage Anthos attached clusters that run on customer's owned infrastructure.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the AttachedClusters Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AttachedClusters clients ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the AttachedClusters 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_attached_cluster
def create_attached_cluster(request, options = nil) -> ::Gapic::Operation
def create_attached_cluster(parent: nil, attached_cluster: nil, attached_cluster_id: nil, validate_only: nil) -> ::Gapic::Operation
Creates a new AttachedCluster 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.
def create_attached_cluster(request, options = nil) -> ::Gapic::Operation
create_attached_cluster
via a request object, either of type
CreateAttachedClusterRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest, ::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_attached_cluster(parent: nil, attached_cluster: nil, attached_cluster_id: nil, validate_only: nil) -> ::Gapic::Operation
create_attached_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).
-
parent (::String) — Required. The parent location where this
AttachedCluster 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.
- attached_cluster (::Google::Cloud::GkeMultiCloud::V1::AttachedCluster, ::Hash) — Required. The specification of the AttachedCluster to create.
-
attached_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 AttachedCluster resource name formatted as
projects/<project-id>/locations/<region>/attachedClusters/<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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest.new # Call the create_attached_cluster method. result = client.create_attached_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_attached_cluster
def delete_attached_cluster(request, options = nil) -> ::Gapic::Operation
def delete_attached_cluster(name: nil, validate_only: nil, allow_missing: nil, ignore_errors: nil, etag: nil) -> ::Gapic::Operation
Deletes a specific AttachedCluster resource.
If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.
def delete_attached_cluster(request, options = nil) -> ::Gapic::Operation
delete_attached_cluster
via a request object, either of type
DeleteAttachedClusterRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest, ::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_attached_cluster(name: nil, validate_only: nil, allow_missing: nil, ignore_errors: nil, etag: nil) -> ::Gapic::Operation
delete_attached_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).
-
name (::String) — Required. The resource name the
AttachedCluster to delete.
AttachedCluster
names are formatted asprojects/<project-id>/locations/<region>/attachedClusters/<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
AttachedCluster 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.
- ignore_errors (::Boolean) — If set to true, the deletion of AttachedCluster resource will succeed even if errors occur during deleting in cluster resources. Using this parameter may result in orphaned resources in the cluster.
-
etag (::String) — The current etag of the
AttachedCluster.
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest.new # Call the delete_attached_cluster method. result = client.delete_attached_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
#generate_attached_cluster_install_manifest
def generate_attached_cluster_install_manifest(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse
def generate_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse
Generates the install manifest to be installed on the target cluster.
def generate_attached_cluster_install_manifest(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse
generate_attached_cluster_install_manifest
via a request object, either of type
GenerateAttachedClusterInstallManifestRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest, ::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_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil) -> ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse
generate_attached_cluster_install_manifest
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).
-
parent (::String) — Required. The parent location where this
AttachedCluster 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.
-
attached_cluster_id (::String) — Required. A client provided ID of the resource. Must be unique within the
parent resource.
The provided ID will be part of the AttachedCluster resource name formatted as
projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>
.Valid characters are
/[a-z][0-9]-/
. Cannot be longer than 63 characters.When generating an install manifest for importing an existing Membership resource, the attached_cluster_id field must be the Membership id.
Membership names are formatted as
projects/<project-id>/locations/<region>/memberships/<membership-id>
. -
platform_version (::String) — Required. The platform version for the cluster (e.g.
1.19.0-gke.1000
).You can list all supported versions on a given Google Cloud region by calling GetAttachedServerConfig.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest.new # Call the generate_attached_cluster_install_manifest method. result = client.generate_attached_cluster_install_manifest request # The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse. p result
#get_attached_cluster
def get_attached_cluster(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster
def get_attached_cluster(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster
Describes a specific AttachedCluster resource.
def get_attached_cluster(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster
get_attached_cluster
via a request object, either of type
GetAttachedClusterRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest, ::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_attached_cluster(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster
get_attached_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).
-
name (::String) — Required. The name of the
AttachedCluster resource
to describe.
AttachedCluster
names are formatted asprojects/<project-id>/locations/<region>/attachedClusters/<cluster-id>
.See Resource Names for more details on Google Cloud Platform resource names.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::GkeMultiCloud::V1::AttachedCluster)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest.new # Call the get_attached_cluster method. result = client.get_attached_cluster request # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AttachedCluster. p result
#get_attached_server_config
def get_attached_server_config(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig
def get_attached_server_config(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig
Returns information, such as supported Kubernetes versions, on a given Google Cloud location.
def get_attached_server_config(request, options = nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig
get_attached_server_config
via a request object, either of type
GetAttachedServerConfigRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest, ::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_attached_server_config(name: nil) -> ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig
get_attached_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).
-
name (::String) — Required. The name of the
AttachedServerConfig
resource to describe.
AttachedServerConfig
names are formatted asprojects/<project-id>/locations/<region>/attachedServerConfig
.See Resource Names for more details on Google Cloud resource names.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest.new # Call the get_attached_server_config method. result = client.get_attached_server_config request # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig. p result
#import_attached_cluster
def import_attached_cluster(request, options = nil) -> ::Gapic::Operation
def import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil) -> ::Gapic::Operation
Imports creates a new AttachedCluster resource by importing an existing Fleet Membership resource.
Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be imported through this method.
If successful, the response contains a newly created Operation resource that can be described to track the status of the operation.
def import_attached_cluster(request, options = nil) -> ::Gapic::Operation
import_attached_cluster
via a request object, either of type
ImportAttachedClusterRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest, ::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 import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil) -> ::Gapic::Operation
import_attached_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).
-
parent (::String) — Required. The parent location where this
AttachedCluster 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.
- validate_only (::Boolean) — If set, only validate the request, but do not actually import the cluster.
- fleet_membership (::String) — Required. The name of the fleet membership resource to import.
-
platform_version (::String) — Required. The platform version for the cluster (e.g.
1.19.0-gke.1000
).You can list all supported versions on a given Google Cloud region by calling GetAttachedServerConfig.
-
distribution (::String) — Required. The Kubernetes distribution of the underlying attached cluster.
Supported values: ["eks", "aks"].
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest.new # Call the import_attached_cluster method. result = client.import_attached_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
#initialize
def initialize() { |config| ... } -> Client
Create a new AttachedClusters client object.
- (config) — Configure the AttachedClusters client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new # Create a client using a custom configuration client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config| config.timeout = 10.0 end
#list_attached_clusters
def list_attached_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>
def list_attached_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>
Lists all AttachedCluster resources on a given Google Cloud project and region.
def list_attached_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>
list_attached_clusters
via a request object, either of type
ListAttachedClustersRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest, ::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_attached_clusters(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>
list_attached_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).
-
parent (::String) — Required. The parent location which owns this collection of
AttachedCluster 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 attachedClusters.list request, if any.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest.new # Call the list_attached_clusters method. result = client.list_attached_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::AttachedCluster. p response end
#operations_client
def operations_client() -> ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Operations
Get the associated client for long-running operations.
#update_attached_cluster
def update_attached_cluster(request, options = nil) -> ::Gapic::Operation
def update_attached_cluster(attached_cluster: nil, validate_only: nil, update_mask: nil) -> ::Gapic::Operation
Updates an AttachedCluster.
def update_attached_cluster(request, options = nil) -> ::Gapic::Operation
update_attached_cluster
via a request object, either of type
UpdateAttachedClusterRequest or an equivalent Hash.
- request (::Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest, ::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_attached_cluster(attached_cluster: nil, validate_only: nil, update_mask: nil) -> ::Gapic::Operation
update_attached_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).
- attached_cluster (::Google::Cloud::GkeMultiCloud::V1::AttachedCluster, ::Hash) — Required. The AttachedCluster 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 AttachedCluster:
-
description
. -
annotations
. -
platform_version
. -
authorization.admin_users
. -
logging_config.component_config.enable_components
. -
monitoring_config.managed_prometheus_config.enabled
.
-
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::AttachedClusters::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest.new # Call the update_attached_cluster method. result = client.update_attached_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