Class: Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb

Overview

REST 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.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#attached_cluster_path, #attached_server_config_path, #location_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new AttachedClusters REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::Client.new

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

Yields:

  • (config)

    Configure the AttachedClusters client.

Yield Parameters:



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 161

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @attached_clusters_stub = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @attached_clusters_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end
end

Instance Attribute Details

#operations_client::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::Operations (readonly)

Get the associated client for long-running operations.



215
216
217
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 215

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the AttachedClusters Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all AttachedClusters clients
::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "GkeMultiCloud", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_attached_cluster.timeout = 60.0

    default_config.rpcs.update_attached_cluster.timeout = 60.0

    default_config.rpcs.import_attached_cluster.timeout = 60.0

    default_config.rpcs.get_attached_cluster.timeout = 60.0
    default_config.rpcs.get_attached_cluster.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_attached_clusters.timeout = 60.0
    default_config.rpcs.list_attached_clusters.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_attached_cluster.timeout = 60.0

    default_config.rpcs.get_attached_server_config.timeout = 60.0
    default_config.rpcs.get_attached_server_config.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.generate_attached_cluster_install_manifest.timeout = 60.0
    default_config.rpcs.generate_attached_cluster_install_manifest.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.generate_attached_cluster_agent_token.timeout = 60.0
    default_config.rpcs.generate_attached_cluster_agent_token.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



131
132
133
134
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 131

def configure
  yield @config if block_given?
  @config
end

#create_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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 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

Overloads:

  • #create_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_attached_cluster via a request object, either of type CreateAttachedClusterRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_attached_cluster(parent: nil, attached_cluster: nil, attached_cluster_id: nil, validate_only: nil) ⇒ ::Gapic::Operation

    Pass arguments to 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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) (defaults to: nil)

      Required. The specification of the AttachedCluster to create.

    • attached_cluster_id (::String) (defaults to: nil)

      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) (defaults to: nil)

      If set, only validate the request, but do not actually create the cluster.

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.



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 306

def create_attached_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::CreateAttachedClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_attached_cluster..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_attached_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_attached_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.create_attached_cluster request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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 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

Overloads:

  • #delete_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_attached_cluster via a request object, either of type DeleteAttachedClusterRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_attached_cluster(name: nil, validate_only: nil, allow_missing: nil, ignore_errors: nil, etag: nil) ⇒ ::Gapic::Operation

    Pass arguments to 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name the AttachedCluster to delete.

      AttachedCluster names are formatted as projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>.

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

    • validate_only (::Boolean) (defaults to: nil)

      If set, only validate the request, but do not actually delete the resource.

    • allow_missing (::Boolean) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.

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.



847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 847

def delete_attached_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::DeleteAttachedClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_attached_cluster..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_attached_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_attached_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.delete_attached_cluster request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#generate_attached_cluster_agent_token(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse #generate_attached_cluster_agent_token(attached_cluster: nil, subject_token: nil, subject_token_type: nil, version: nil, grant_type: nil, audience: nil, scope: nil, requested_token_type: nil, options: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse

Generates an access token for a cluster agent.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #generate_attached_cluster_agent_token(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse

    Pass arguments to generate_attached_cluster_agent_token via a request object, either of type GenerateAttachedClusterAgentTokenRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #generate_attached_cluster_agent_token(attached_cluster: nil, subject_token: nil, subject_token_type: nil, version: nil, grant_type: nil, audience: nil, scope: nil, requested_token_type: nil, options: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse

    Pass arguments to generate_attached_cluster_agent_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).

    Parameters:

    • attached_cluster (::String) (defaults to: nil)

      Required.

    • subject_token (::String) (defaults to: nil)

      Required.

    • subject_token_type (::String) (defaults to: nil)

      Required.

    • version (::String) (defaults to: nil)

      Required.

    • grant_type (::String) (defaults to: nil)

      Optional.

    • audience (::String) (defaults to: nil)

      Optional.

    • scope (::String) (defaults to: nil)

      Optional.

    • requested_token_type (::String) (defaults to: nil)

      Optional.

    • options (::String) (defaults to: nil)

      Optional.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 1139

def generate_attached_cluster_agent_token request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.generate_attached_cluster_agent_token..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.generate_attached_cluster_agent_token.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.generate_attached_cluster_agent_token.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.generate_attached_cluster_agent_token request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#generate_attached_cluster_install_manifest(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse #generate_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil, proxy_config: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse

Generates the install manifest to be installed on the target cluster.

Examples:

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::Rest::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

Overloads:

  • #generate_attached_cluster_install_manifest(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse

    Pass arguments to generate_attached_cluster_install_manifest via a request object, either of type GenerateAttachedClusterInstallManifestRequest or an equivalent Hash.

    Parameters:

  • #generate_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil, proxy_config: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse

    Pass arguments to 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      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.

    • proxy_config (::Google::Cloud::GkeMultiCloud::V1::AttachedProxyConfig, ::Hash) (defaults to: nil)

      Optional. Proxy configuration for outbound HTTP(S) traffic.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 1045

def generate_attached_cluster_install_manifest request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.generate_attached_cluster_install_manifest..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.generate_attached_cluster_install_manifest.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.generate_attached_cluster_install_manifest.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.generate_attached_cluster_install_manifest request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_attached_cluster(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster #get_attached_cluster(name: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster

Describes a specific AttachedCluster resource.

Examples:

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::Rest::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

Overloads:

  • #get_attached_cluster(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster

    Pass arguments to get_attached_cluster via a request object, either of type GetAttachedClusterRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_attached_cluster(name: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster

    Pass arguments to 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the AttachedCluster resource to describe.

      AttachedCluster names are formatted as projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>.

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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 624

def get_attached_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAttachedClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_attached_cluster..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_attached_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_attached_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.get_attached_cluster request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_attached_server_config(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig #get_attached_server_config(name: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig

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

Examples:

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::Rest::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

Overloads:

  • #get_attached_server_config(request, options = nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig

    Pass arguments to get_attached_server_config via a request object, either of type GetAttachedServerConfigRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_attached_server_config(name: nil) ⇒ ::Google::Cloud::GkeMultiCloud::V1::AttachedServerConfig

    Pass arguments to 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the AttachedServerConfig resource to describe.

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

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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 936

def get_attached_server_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GetAttachedServerConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_attached_server_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_attached_server_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_attached_server_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.get_attached_server_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation #import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil, proxy_config: 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.

Examples:

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::Rest::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 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

Overloads:

  • #import_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to import_attached_cluster via a request object, either of type ImportAttachedClusterRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil, proxy_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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) (defaults to: nil)

      If set, only validate the request, but do not actually import the cluster.

    • fleet_membership (::String) (defaults to: nil)

      Required. The name of the fleet membership resource to import.

    • platform_version (::String) (defaults to: nil)

      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) (defaults to: nil)

      Required. The Kubernetes distribution of the underlying attached cluster.

      Supported values: ["eks", "aks", "generic"].

    • proxy_config (::Google::Cloud::GkeMultiCloud::V1::AttachedProxyConfig, ::Hash) (defaults to: nil)

      Optional. Proxy configuration for outbound HTTP(S) traffic.

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.



535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 535

def import_attached_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::ImportAttachedClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.import_attached_cluster..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.import_attached_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.import_attached_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.import_attached_cluster request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_attached_clusters(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster> #list_attached_clusters(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>

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

Examples:

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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AttachedCluster.
  p item
end

Overloads:

  • #list_attached_clusters(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>

    Pass arguments to list_attached_clusters via a request object, either of type ListAttachedClustersRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_attached_clusters(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::GkeMultiCloud::V1::AttachedCluster>

    Pass arguments to 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      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) (defaults to: nil)

      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) (defaults to: nil)

      The nextPageToken value returned from a previous attachedClusters.list request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 725

def list_attached_clusters request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::ListAttachedClustersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_attached_clusters..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_attached_clusters.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_attached_clusters.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.list_attached_clusters request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @attached_clusters_stub, :list_attached_clusters, "attached_clusters", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


222
223
224
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 222

def logger
  @attached_clusters_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


141
142
143
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 141

def universe_domain
  @attached_clusters_stub.universe_domain
end

#update_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation #update_attached_cluster(attached_cluster: nil, validate_only: nil, update_mask: nil) ⇒ ::Gapic::Operation

Updates an AttachedCluster.

Examples:

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::Rest::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 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

Overloads:

  • #update_attached_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_attached_cluster via a request object, either of type UpdateAttachedClusterRequest or an equivalent Hash.

    Parameters:

    • 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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_attached_cluster(attached_cluster: nil, validate_only: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to 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).

    Parameters:

    • attached_cluster (::Google::Cloud::GkeMultiCloud::V1::AttachedCluster, ::Hash) (defaults to: nil)

      Required. The AttachedCluster resource to update.

    • validate_only (::Boolean) (defaults to: nil)

      If set, only validate the request, but do not actually update the cluster.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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:

      • annotations.
      • authorization.admin_groups.
      • authorization.admin_users.
      • binary_authorization.evaluation_mode.
      • description.
      • logging_config.component_config.enable_components.
      • monitoring_config.managed_prometheus_config.enabled.
      • platform_version.
      • proxy_config.kubernetes_secret.name.
      • proxy_config.kubernetes_secret.namespace.
      • security_posture_config.vulnerability_mode
      • monitoring_config.cloud_monitoring_config.enabled

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.



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb', line 416

def update_attached_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::UpdateAttachedClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_attached_cluster..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_attached_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_attached_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @attached_clusters_stub.update_attached_cluster request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end