Class: Google::Cloud::Container::V1beta1::ClusterManager::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/container/v1beta1/cluster_manager/client.rb

Overview

Client for the ClusterManager service.

Google Kubernetes Engine Cluster Manager v1beta1

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#topic_path

Constructor Details

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

Create a new ClusterManager client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Container::V1beta1::ClusterManager::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the ClusterManager client.

Yield Parameters:



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 218

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/container/v1beta1/cluster_service_services_pb"

  # 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

  @cluster_manager_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Container::V1beta1::ClusterManager::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
end

Class Method Details

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

Configure the ClusterManager Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ClusterManager clients
::Google::Cloud::Container::V1beta1::ClusterManager::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



59
60
61
62
63
64
65
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 59

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Container", "V1beta1"]
    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.list_clusters.timeout = 20.0
    default_config.rpcs.list_clusters.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_cluster.timeout = 20.0
    default_config.rpcs.get_cluster.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.create_cluster.timeout = 45.0

    default_config.rpcs.update_cluster.timeout = 45.0

    default_config.rpcs.update_node_pool.timeout = 45.0

    default_config.rpcs.set_node_pool_autoscaling.timeout = 45.0

    default_config.rpcs.set_logging_service.timeout = 45.0

    default_config.rpcs.set_monitoring_service.timeout = 45.0

    default_config.rpcs.set_addons_config.timeout = 45.0

    default_config.rpcs.set_locations.timeout = 45.0

    default_config.rpcs.update_master.timeout = 45.0

    default_config.rpcs.set_master_auth.timeout = 45.0

    default_config.rpcs.delete_cluster.timeout = 20.0
    default_config.rpcs.delete_cluster.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_operations.timeout = 20.0
    default_config.rpcs.list_operations.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_operation.timeout = 20.0
    default_config.rpcs.get_operation.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.cancel_operation.timeout = 45.0

    default_config.rpcs.get_server_config.timeout = 20.0
    default_config.rpcs.get_server_config.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_node_pools.timeout = 20.0
    default_config.rpcs.list_node_pools.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_node_pool.timeout = 20.0
    default_config.rpcs.get_node_pool.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.create_node_pool.timeout = 45.0

    default_config.rpcs.delete_node_pool.timeout = 20.0
    default_config.rpcs.delete_node_pool.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.rollback_node_pool_upgrade.timeout = 45.0

    default_config.rpcs.set_node_pool_management.timeout = 45.0

    default_config.rpcs.set_labels.timeout = 45.0

    default_config.rpcs.set_legacy_abac.timeout = 45.0

    default_config.rpcs.start_ip_rotation.timeout = 45.0

    default_config.rpcs.complete_ip_rotation.timeout = 45.0

    default_config.rpcs.set_node_pool_size.timeout = 45.0

    default_config.rpcs.set_network_policy.timeout = 45.0

    default_config.rpcs.set_maintenance_policy.timeout = 45.0

    default_config.rpcs.list_usable_subnetworks.timeout = 20.0
    default_config.rpcs.list_usable_subnetworks.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_locations.timeout = 20.0
    default_config.rpcs.list_locations.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#cancel_operation(request, options = nil) ⇒ ::Google::Protobuf::Empty #cancel_operation(project_id: nil, zone: nil, operation_id: nil, name: nil) ⇒ ::Google::Protobuf::Empty

Cancels the specified operation.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::CancelOperationRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #cancel_operation(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_operation via a request object, either of type Google::Cloud::Container::V1beta1::CancelOperationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::CancelOperationRequest, ::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.

  • #cancel_operation(project_id: nil, zone: nil, operation_id: nil, name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to cancel_operation 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the operation resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The server-assigned name of the operation. This field has been deprecated and replaced by the name field.

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

      The name (project, location, operation id) of the operation to cancel. Specified in the format projects/*/locations/*/operations/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1956

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::CancelOperationRequest

  # 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.cancel_operation..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#check_autopilot_compatibility(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::CheckAutopilotCompatibilityResponse #check_autopilot_compatibility(name: nil) ⇒ ::Google::Cloud::Container::V1beta1::CheckAutopilotCompatibilityResponse

Checks the cluster compatibility with Autopilot mode, and returns a list of compatibility issues.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::CheckAutopilotCompatibilityRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::CheckAutopilotCompatibilityResponse.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3740

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::CheckAutopilotCompatibilityRequest

  # 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.check_autopilot_compatibility..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :check_autopilot_compatibility, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#complete_ip_rotation(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #complete_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Completes master IP rotation.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::CompleteIPRotationRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #complete_ip_rotation(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to complete_ip_rotation via a request object, either of type Google::Cloud::Container::V1beta1::CompleteIPRotationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::CompleteIPRotationRequest, ::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.

  • #complete_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to complete_ip_rotation 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster name) of the cluster to complete IP rotation. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3244

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::CompleteIPRotationRequest

  # 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.complete_ip_rotation..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :complete_ip_rotation, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#complete_node_pool_upgrade(request, options = nil) ⇒ ::Google::Protobuf::Empty #complete_node_pool_upgrade(name: nil) ⇒ ::Google::Protobuf::Empty

CompleteNodePoolUpgrade will signal an on-going node pool upgrade to complete.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::CompleteNodePoolUpgradeRequest.new

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #complete_node_pool_upgrade(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to complete_node_pool_upgrade via a request object, either of type Google::Cloud::Container::V1beta1::CompleteNodePoolUpgradeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::CompleteNodePoolUpgradeRequest, ::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.

  • #complete_node_pool_upgrade(name: nil) ⇒ ::Google::Protobuf::Empty

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

      The name (project, location, cluster, node pool id) of the node pool to complete upgrade. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2629

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::CompleteNodePoolUpgradeRequest

  # 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.complete_node_pool_upgrade..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :complete_node_pool_upgrade, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Configure the ClusterManager 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:



188
189
190
191
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 188

def configure
  yield @config if block_given?
  @config
end

#create_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #create_cluster(project_id: nil, zone: nil, cluster: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Creates a cluster, consisting of the specified number and type of Google Compute Engine instances.

By default, the cluster is created in the project's default network.

One firewall is added for the cluster. After cluster creation, the Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster.

Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

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

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #create_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to create_cluster via a request object, either of type Google::Cloud::Container::V1beta1::CreateClusterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::CreateClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

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

  • #create_cluster(project_id: nil, zone: nil, cluster: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to create_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

    • cluster (::Google::Cloud::Container::V1beta1::Cluster, ::Hash) (defaults to: nil)

      Required. A cluster resource

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

      The parent (project and location) where the cluster will be created. Specified in the format projects/*/locations/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



525
526
527
528
529
530
531
532
533
534
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
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 525

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::CreateClusterRequest

  # 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_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :create_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #create_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Creates a node pool for a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::CreateNodePoolRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #create_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to create_node_pool via a request object, either of type Google::Cloud::Container::V1beta1::CreateNodePoolRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::CreateNodePoolRequest, ::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_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to create_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field.

    • node_pool (::Google::Cloud::Container::V1beta1::NodePool, ::Hash) (defaults to: nil)

      Required. The node pool to create.

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

      The parent (project, location, cluster name) where the node pool will be created. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2439

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::CreateNodePoolRequest

  # 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_node_pool..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :create_node_pool, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #delete_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Deletes the cluster, including the Kubernetes endpoint and all worker nodes.

Firewalls and routes that were configured during cluster creation are also deleted.

Other Google Compute Engine resources that might be in use by the cluster, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

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

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #delete_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::DeleteClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

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

  • #delete_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to delete_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster) of the cluster to delete. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1664

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::DeleteClusterRequest

  # 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_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #delete_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Deletes a node pool from a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::DeleteNodePoolRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #delete_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::DeleteNodePoolRequest, ::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_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to delete_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2541

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::DeleteNodePoolRequest

  # 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_node_pool..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :delete_node_pool, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Cluster #get_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Cluster

Gets the details for a specific cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

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

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

# The returned object is of type Google::Cloud::Container::V1beta1::Cluster.
p result

Overloads:

  • #get_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Cluster

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::GetClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

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

  • #get_cluster(project_id: nil, zone: nil, cluster_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Cluster

    Pass arguments to get_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster) of the cluster to retrieve. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



414
415
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
452
453
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 414

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::GetClusterRequest

  # 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_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :get_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_json_web_keys(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse #get_json_web_keys(parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse

Gets the public component of the cluster signing keys in JSON Web Key format.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::GetJSONWebKeysRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse.
p result

Overloads:

  • #get_json_web_keys(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::GetJSONWebKeysRequest, ::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_json_web_keys(parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse

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

      The cluster (project, location, cluster name) to get keys for. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2138

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::GetJSONWebKeysRequest

  # 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_json_web_keys..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :get_json_web_keys, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::NodePool #get_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::NodePool

Retrieves the requested node pool.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::GetNodePoolRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::NodePool.
p result

Overloads:

  • #get_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::NodePool

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::GetNodePoolRequest, ::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_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::NodePool

    Pass arguments to get_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2338

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::GetNodePoolRequest

  # 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_node_pool..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :get_node_pool, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_operation(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #get_operation(project_id: nil, zone: nil, operation_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Gets the specified operation.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::GetOperationRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #get_operation(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::GetOperationRequest, ::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_operation(project_id: nil, zone: nil, operation_id: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to get_operation 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The server-assigned name of the operation. This field has been deprecated and replaced by the name field.

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

      The name (project, location, operation id) of the operation to get. Specified in the format projects/*/locations/*/operations/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1858

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::GetOperationRequest

  # 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_operation..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :get_operation, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_server_config(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ServerConfig #get_server_config(project_id: nil, zone: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::ServerConfig

Returns configuration info about the Google Kubernetes Engine service.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::GetServerConfigRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::ServerConfig.
p result

Overloads:

  • #get_server_config(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ServerConfig

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::GetServerConfigRequest, ::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_server_config(project_id: nil, zone: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::ServerConfig

    Pass arguments to get_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone to return operations for. This field has been deprecated and replaced by the name field.

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

      The name (project and location) of the server config to get, specified in the format projects/*/locations/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2051

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::GetServerConfigRequest

  # 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_server_config..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :get_server_config, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_clusters(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListClustersResponse #list_clusters(project_id: nil, zone: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListClustersResponse

Lists all clusters owned by a project in either the specified zone or all zones.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

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

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

# The returned object is of type Google::Cloud::Container::V1beta1::ListClustersResponse.
p result

Overloads:

  • #list_clusters(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListClustersResponse

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::ListClustersRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

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

  • #list_clusters(project_id: nil, zone: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListClustersResponse

    Pass arguments to list_clusters via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field.

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

      The parent (project and location) where the clusters will be listed. Specified in the format projects/*/locations/*. Location "-" matches all zones and all regions.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 316

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::ListClustersRequest

  # 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_clusters..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :list_clusters, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_locations(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListLocationsResponse #list_locations(parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListLocationsResponse

Fetches locations that offer Google Kubernetes Engine.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::ListLocationsRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::ListLocationsResponse.
p result

Overloads:

  • #list_locations(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListLocationsResponse

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::ListLocationsRequest, ::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_locations(parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListLocationsResponse

    Pass arguments to list_locations 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. Contains the name of the resource requested. Specified in the format projects/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3826

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::ListLocationsRequest

  # 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_locations..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :list_locations, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_node_pools(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListNodePoolsResponse #list_node_pools(project_id: nil, zone: nil, cluster_id: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListNodePoolsResponse

Lists the node pools for a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::ListNodePoolsRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::ListNodePoolsResponse.
p result

Overloads:

  • #list_node_pools(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListNodePoolsResponse

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::ListNodePoolsRequest, ::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_node_pools(project_id: nil, zone: nil, cluster_id: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListNodePoolsResponse

    Pass arguments to list_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field.

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

      The parent (project, location, cluster name) where the node pools will be listed. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2236

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::ListNodePoolsRequest

  # 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_node_pools..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :list_node_pools, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_operations(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListOperationsResponse #list_operations(project_id: nil, zone: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListOperationsResponse

Lists all operations in a project in the specified zone or all zones.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::ListOperationsRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::ListOperationsResponse.
p result

Overloads:

  • #list_operations(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::ListOperationsResponse

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::ListOperationsRequest, ::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_operations(project_id: nil, zone: nil, parent: nil) ⇒ ::Google::Cloud::Container::V1beta1::ListOperationsResponse

    Pass arguments to list_operations 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the parent field.

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

      Required. Deprecated. The name of the Google Compute Engine zone to return operations for, or - for all zones. This field has been deprecated and replaced by the parent field.

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

      The parent (project and location) where the operations will be listed. Specified in the format projects/*/locations/*. Location "-" matches all zones and all regions.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1760

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::ListOperationsRequest

  # 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_operations..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :list_operations, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_usable_subnetworks(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Container::V1beta1::UsableSubnetwork> #list_usable_subnetworks(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Container::V1beta1::UsableSubnetwork>

Lists subnetworks that can be used for creating clusters in a project.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::ListUsableSubnetworksRequest.new

# Call the list_usable_subnetworks method.
result = client.list_usable_subnetworks 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::Container::V1beta1::UsableSubnetwork.
  p item
end

Overloads:

  • #list_usable_subnetworks(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Container::V1beta1::UsableSubnetwork>

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::ListUsableSubnetworksRequest, ::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_usable_subnetworks(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Container::V1beta1::UsableSubnetwork>

    Pass arguments to list_usable_subnetworks 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 project where subnetworks are usable. Specified in the format projects/*.

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

      Filtering currently only supports equality on the networkProjectId and must be in the form: "networkProjectId=[PROJECTID]", where networkProjectId is the project which owns the listed subnetworks. This defaults to the parent project ID.

    • page_size (::Integer) (defaults to: nil)

      The max number of results per page that should be returned. If the number of available results is larger than page_size, a next_page_token is returned which can be used to get the next page of results in subsequent requests. Acceptable values are 0 to 500, inclusive. (Default: 500)

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

      Specifies a page token to use. Set this to the nextPageToken returned by previous list requests to get the next page of results.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3652

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::ListUsableSubnetworksRequest

  # 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_usable_subnetworks..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :list_usable_subnetworks, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @cluster_manager_stub, :list_usable_subnetworks, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#rollback_node_pool_upgrade(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #rollback_node_pool_upgrade(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil, respect_pdb: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::RollbackNodePoolUpgradeRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #rollback_node_pool_upgrade(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::RollbackNodePoolUpgradeRequest, ::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.

  • #rollback_node_pool_upgrade(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, name: nil, respect_pdb: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to rollback_node_pool_upgrade 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster, node pool id) of the node poll to rollback upgrade. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

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

      Option for rollback to ignore the PodDisruptionBudget. Default value is false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2735

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::RollbackNodePoolUpgradeRequest

  # 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.rollback_node_pool_upgrade..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :rollback_node_pool_upgrade, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_addons_config(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_addons_config(project_id: nil, zone: nil, cluster_id: nil, addons_config: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets the addons for a specific cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetAddonsConfigRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_addons_config(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetAddonsConfigRequest, ::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.

  • #set_addons_config(project_id: nil, zone: nil, cluster_id: nil, addons_config: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_addons_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

    • addons_config (::Google::Cloud::Container::V1beta1::AddonsConfig, ::Hash) (defaults to: nil)

      Required. The desired configurations for the various addons available to run in the cluster.

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

      The name (project, location, cluster) of the cluster to set addons. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1234

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetAddonsConfigRequest

  # 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.set_addons_config..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_addons_config, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_labels(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_labels(project_id: nil, zone: nil, cluster_id: nil, resource_labels: nil, label_fingerprint: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets labels on a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetLabelsRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_labels(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetLabelsRequest, ::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.

  • #set_labels(project_id: nil, zone: nil, cluster_id: nil, resource_labels: nil, label_fingerprint: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_labels 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

    • resource_labels (::Hash{::String => ::String}) (defaults to: nil)

      Required. The labels to set for that cluster.

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

      Required. The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Kubernetes Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make a get() request to the resource to get the latest fingerprint.

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

      The name (project, location, cluster name) of the cluster to set labels. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2946

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetLabelsRequest

  # 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.set_labels..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_labels, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_legacy_abac(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_legacy_abac(project_id: nil, zone: nil, cluster_id: nil, enabled: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Enables or disables the ABAC authorization mechanism on a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetLegacyAbacRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_legacy_abac(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetLegacyAbacRequest, ::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.

  • #set_legacy_abac(project_id: nil, zone: nil, cluster_id: nil, enabled: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_legacy_abac 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field.

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

      Required. Whether ABAC authorization will be enabled in the cluster.

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

      The name (project, location, cluster name) of the cluster to set legacy abac. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3046

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetLegacyAbacRequest

  # 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.set_legacy_abac..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_legacy_abac, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_locations(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_locations(project_id: nil, zone: nil, cluster_id: nil, locations: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Deprecated.

This method is deprecated and may be removed in the next major version update.

Sets the locations for a specific cluster. Deprecated. Use projects.locations.clusters.update instead.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetLocationsRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_locations(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetLocationsRequest, ::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.

  • #set_locations(project_id: nil, zone: nil, cluster_id: nil, locations: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_locations 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

    • locations (::Array<::String>) (defaults to: nil)

      Required. The desired list of Google Compute Engine zones in which the cluster's nodes should be located. Changing the locations a cluster is in will result in nodes being either created or removed from the cluster, depending on whether locations are being added or removed.

      This list must always include the cluster's primary zone.

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

      The name (project, location, cluster) of the cluster to set locations. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1345

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetLocationsRequest

  # 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.set_locations..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_locations, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_logging_service(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_logging_service(project_id: nil, zone: nil, cluster_id: nil, logging_service: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets the logging service for a specific cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetLoggingServiceRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_logging_service(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetLoggingServiceRequest, ::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.

  • #set_logging_service(project_id: nil, zone: nil, cluster_id: nil, logging_service: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_logging_service 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

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

      Required. The logging service the cluster should use to write logs. Currently available options:

      • logging.googleapis.com/kubernetes - The Cloud Logging service with a Kubernetes-native resource model
      • logging.googleapis.com - The legacy Cloud Logging service (no longer available as of GKE 1.15).
      • none - no logs will be exported from the cluster.

      If left as an empty string,logging.googleapis.com/kubernetes will be used for GKE 1.14+ or logging.googleapis.com for earlier versions.

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

      The name (project, location, cluster) of the cluster to set logging. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1023

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetLoggingServiceRequest

  # 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.set_logging_service..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_logging_service, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_maintenance_policy(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_maintenance_policy(project_id: nil, zone: nil, cluster_id: nil, maintenance_policy: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets the maintenance policy for a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetMaintenancePolicyRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_maintenance_policy(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetMaintenancePolicyRequest, ::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.

  • #set_maintenance_policy(project_id: nil, zone: nil, cluster_id: nil, maintenance_policy: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_maintenance_policy 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:

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

      Required. The Google Developers Console project ID or project number.

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

      Required. The name of the Google Compute Engine zone in which the cluster resides.

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

      Required. The name of the cluster to update.

    • maintenance_policy (::Google::Cloud::Container::V1beta1::MaintenancePolicy, ::Hash) (defaults to: nil)

      Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy.

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

      The name (project, location, cluster name) of the cluster to set maintenance policy. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3549

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetMaintenancePolicyRequest

  # 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.set_maintenance_policy..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_maintenance_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_master_auth(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_master_auth(project_id: nil, zone: nil, cluster_id: nil, action: nil, update: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetMasterAuthRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_master_auth(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetMasterAuthRequest, ::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.

  • #set_master_auth(project_id: nil, zone: nil, cluster_id: nil, action: nil, update: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_master_auth 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

    • action (::Google::Cloud::Container::V1beta1::SetMasterAuthRequest::Action) (defaults to: nil)

      Required. The exact form of action to be taken on the master auth.

    • update (::Google::Cloud::Container::V1beta1::MasterAuth, ::Hash) (defaults to: nil)

      Required. A description of the update.

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

      The name (project, location, cluster) of the cluster to set auth. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1558

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetMasterAuthRequest

  # 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.set_master_auth..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_master_auth, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_monitoring_service(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_monitoring_service(project_id: nil, zone: nil, cluster_id: nil, monitoring_service: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets the monitoring service for a specific cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetMonitoringServiceRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_monitoring_service(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetMonitoringServiceRequest, ::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.

  • #set_monitoring_service(project_id: nil, zone: nil, cluster_id: nil, monitoring_service: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_monitoring_service 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

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

      Required. The monitoring service the cluster should use to write metrics. Currently available options:

      • "monitoring.googleapis.com/kubernetes" - The Cloud Monitoring service with a Kubernetes-native resource model
      • monitoring.googleapis.com - The legacy Cloud Monitoring service (no longer available as of GKE 1.15).
      • none - No metrics will be exported from the cluster.

      If left as an empty string,monitoring.googleapis.com/kubernetes will be used for GKE 1.14+ or monitoring.googleapis.com for earlier versions.

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

      The name (project, location, cluster) of the cluster to set monitoring. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1133
1134
1135
1136
1137
1138
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/container/v1beta1/cluster_manager/client.rb', line 1133

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetMonitoringServiceRequest

  # 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.set_monitoring_service..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_monitoring_service, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_network_policy(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_network_policy(project_id: nil, zone: nil, cluster_id: nil, network_policy: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Enables or disables Network Policy for a cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetNetworkPolicyRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_network_policy(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetNetworkPolicyRequest, ::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.

  • #set_network_policy(project_id: nil, zone: nil, cluster_id: nil, network_policy: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_network_policy 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

    • network_policy (::Google::Cloud::Container::V1beta1::NetworkPolicy, ::Hash) (defaults to: nil)

      Required. Configuration options for the NetworkPolicy feature.

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

      The name (project, location, cluster name) of the cluster to set networking policy. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3450

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetNetworkPolicyRequest

  # 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.set_network_policy..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_network_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_node_pool_autoscaling(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_node_pool_autoscaling(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, autoscaling: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets the autoscaling settings of a specific node pool.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetNodePoolAutoscalingRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_node_pool_autoscaling(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetNodePoolAutoscalingRequest, ::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.

  • #set_node_pool_autoscaling(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, autoscaling: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_node_pool_autoscaling 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field.

    • autoscaling (::Google::Cloud::Container::V1beta1::NodePoolAutoscaling, ::Hash) (defaults to: nil)

      Required. Autoscaling configuration for the node pool.

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

      The name (project, location, cluster, node pool) of the node pool to set autoscaler settings. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 913

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetNodePoolAutoscalingRequest

  # 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.set_node_pool_autoscaling..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_node_pool_autoscaling, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_node_pool_management(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_node_pool_management(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, management: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Sets the NodeManagement options for a node pool.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetNodePoolManagementRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_node_pool_management(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetNodePoolManagementRequest, ::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.

  • #set_node_pool_management(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, management: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_node_pool_management 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field.

    • management (::Google::Cloud::Container::V1beta1::NodeManagement, ::Hash) (defaults to: nil)

      Required. NodeManagement configuration for the node pool.

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

      The name (project, location, cluster, node pool id) of the node pool to set management properties. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 2839

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetNodePoolManagementRequest

  # 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.set_node_pool_management..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_node_pool_management, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_node_pool_size(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #set_node_pool_size(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_count: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

SetNodePoolSizeRequest sets the size of a node pool. The new size will be used for all replicas, including future replicas created by modifying NodePool.locations.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::SetNodePoolSizeRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #set_node_pool_size(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::SetNodePoolSizeRequest, ::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.

  • #set_node_pool_size(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_count: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to set_node_pool_size 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field.

    • node_count (::Integer) (defaults to: nil)

      Required. The desired node count for the pool.

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

      The name (project, location, cluster, node pool id) of the node pool to set size. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3350

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::SetNodePoolSizeRequest

  # 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.set_node_pool_size..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :set_node_pool_size, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_ip_rotation(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #start_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil, rotate_credentials: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Starts master IP rotation.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::StartIPRotationRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #start_ip_rotation(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::StartIPRotationRequest, ::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.

  • #start_ip_rotation(project_id: nil, zone: nil, cluster_id: nil, name: nil, rotate_credentials: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to start_ip_rotation 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field.

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

      The name (project, location, cluster name) of the cluster to start IP rotation. Specified in the format projects/*/locations/*/clusters/*.

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

      Whether to rotate credentials during IP rotation.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 3146

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::StartIPRotationRequest

  # 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.start_ip_rotation..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :start_ip_rotation, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


198
199
200
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 198

def universe_domain
  @cluster_manager_stub.universe_domain
end

#update_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #update_cluster(project_id: nil, zone: nil, cluster_id: nil, update: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Updates the settings for a specific cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

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

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #update_cluster(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::UpdateClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

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

  • #update_cluster(project_id: nil, zone: nil, cluster_id: nil, update: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to update_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

    • update (::Google::Cloud::Container::V1beta1::ClusterUpdate, ::Hash) (defaults to: nil)

      Required. A description of the update.

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

      The name (project, location, cluster) of the cluster to update. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
658
659
660
661
662
663
664
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 625

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::UpdateClusterRequest

  # 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_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :update_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_master(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #update_master(project_id: nil, zone: nil, cluster_id: nil, master_version: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Updates the master for a specific cluster.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::UpdateMasterRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #update_master(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::UpdateMasterRequest, ::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_master(project_id: nil, zone: nil, cluster_id: nil, master_version: nil, name: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to update_master 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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

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

      Required. The Kubernetes version to change the master to.

      Users may specify either explicit versions offered by Kubernetes Engine or version aliases, which have the following behavior:

      • "latest": picks the highest valid Kubernetes version
      • "1.X": picks the highest valid patch+gke.N patch in the 1.X version
      • "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
      • "1.X.Y-gke.N": picks an explicit Kubernetes version
      • "-": picks the default Kubernetes version
    • name (::String) (defaults to: nil)

      The name (project, location, cluster) of the cluster to update. Specified in the format projects/*/locations/*/clusters/*.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 1454

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::UpdateMasterRequest

  # 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_master..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :update_master, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation #update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, locations: nil, workload_metadata_config: nil, name: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, etag: nil, fast_socket: nil, logging_config: nil, resource_labels: nil, windows_node_config: nil, machine_type: nil, disk_type: nil, disk_size_gb: nil, resource_manager_tags: nil, queued_provisioning: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

Updates the version and/or image type of a specific node pool.

Examples:

Basic example

require "google/cloud/container/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new

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

# The returned object is of type Google::Cloud::Container::V1beta1::Operation.
p result

Overloads:

  • #update_node_pool(request, options = nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

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

    Parameters:

    • request (::Google::Cloud::Container::V1beta1::UpdateNodePoolRequest, ::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_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, locations: nil, workload_metadata_config: nil, name: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, etag: nil, fast_socket: nil, logging_config: nil, resource_labels: nil, windows_node_config: nil, machine_type: nil, disk_type: nil, disk_size_gb: nil, resource_manager_tags: nil, queued_provisioning: nil) ⇒ ::Google::Cloud::Container::V1beta1::Operation

    Pass arguments to update_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:

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

      Required. Deprecated. The Google Developers Console project ID or project number. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field.

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

      Required. Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field.

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

      Required. The Kubernetes version to change the nodes to (typically an upgrade).

      Users may specify either explicit versions offered by Kubernetes Engine or version aliases, which have the following behavior:

      • "latest": picks the highest valid Kubernetes version
      • "1.X": picks the highest valid patch+gke.N patch in the 1.X version
      • "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
      • "1.X.Y-gke.N": picks an explicit Kubernetes version
      • "-": picks the Kubernetes master version
    • image_type (::String) (defaults to: nil)

      Required. The desired image type for the node pool. Please see https://cloud.google.com/kubernetes-engine/docs/concepts/node-images for available image types.

    • locations (::Array<::String>) (defaults to: nil)

      The desired list of Google Compute Engine zones in which the node pool's nodes should be located. Changing the locations for a node pool will result in nodes being either created or removed from the node pool, depending on whether locations are being added or removed.

    • workload_metadata_config (::Google::Cloud::Container::V1beta1::WorkloadMetadataConfig, ::Hash) (defaults to: nil)

      The desired workload metadata config for the node pool.

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

      The name (project, location, cluster, node pool) of the node pool to update. Specified in the format projects/*/locations/*/clusters/*/nodePools/*.

    • upgrade_settings (::Google::Cloud::Container::V1beta1::NodePool::UpgradeSettings, ::Hash) (defaults to: nil)

      Upgrade settings control disruption and speed of the upgrade.

    • tags (::Google::Cloud::Container::V1beta1::NetworkTags, ::Hash) (defaults to: nil)

      The desired network tags to be applied to all nodes in the node pool. If this field is not present, the tags will not be changed. Otherwise, the existing network tags will be replaced with the provided tags.

    • taints (::Google::Cloud::Container::V1beta1::NodeTaints, ::Hash) (defaults to: nil)

      The desired node taints to be applied to all nodes in the node pool. If this field is not present, the taints will not be changed. Otherwise, the existing node taints will be replaced with the provided taints.

    • labels (::Google::Cloud::Container::V1beta1::NodeLabels, ::Hash) (defaults to: nil)

      The desired node labels to be applied to all nodes in the node pool. If this field is not present, the labels will not be changed. Otherwise, the existing node labels will be replaced with the provided labels.

    • linux_node_config (::Google::Cloud::Container::V1beta1::LinuxNodeConfig, ::Hash) (defaults to: nil)

      Parameters that can be configured on Linux nodes.

    • kubelet_config (::Google::Cloud::Container::V1beta1::NodeKubeletConfig, ::Hash) (defaults to: nil)

      Node kubelet configs.

    • node_network_config (::Google::Cloud::Container::V1beta1::NodeNetworkConfig, ::Hash) (defaults to: nil)

      Node network config.

    • gcfs_config (::Google::Cloud::Container::V1beta1::GcfsConfig, ::Hash) (defaults to: nil)

      GCFS config.

    • confidential_nodes (::Google::Cloud::Container::V1beta1::ConfidentialNodes, ::Hash) (defaults to: nil)

      Confidential nodes config. All the nodes in the node pool will be Confidential VM once enabled.

    • gvnic (::Google::Cloud::Container::V1beta1::VirtualNIC, ::Hash) (defaults to: nil)

      Enable or disable gvnic on the node pool.

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

      The current etag of the node pool. If an etag is provided and does not match the current etag of the node pool, update will be blocked and an ABORTED error will be returned.

    • fast_socket (::Google::Cloud::Container::V1beta1::FastSocket, ::Hash) (defaults to: nil)

      Enable or disable NCCL fast socket for the node pool.

    • logging_config (::Google::Cloud::Container::V1beta1::NodePoolLoggingConfig, ::Hash) (defaults to: nil)

      Logging configuration.

    • resource_labels (::Google::Cloud::Container::V1beta1::ResourceLabels, ::Hash) (defaults to: nil)

      The resource labels for the node pool to use to annotate any related Google Compute Engine resources.

    • windows_node_config (::Google::Cloud::Container::V1beta1::WindowsNodeConfig, ::Hash) (defaults to: nil)

      Parameters that can be configured on Windows nodes.

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

      Optional. The desired machine type for nodes in the node pool. Initiates an upgrade operation that migrates the nodes in the node pool to the specified machine type.

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

      Optional. The desired disk type for nodes in the node pool. Initiates an upgrade operation that migrates the nodes in the node pool to the specified disk type.

    • disk_size_gb (::Integer) (defaults to: nil)

      Optional. The desired disk size for nodes in the node pool. Initiates an upgrade operation that migrates the nodes in the node pool to the specified disk size.

    • resource_manager_tags (::Google::Cloud::Container::V1beta1::ResourceManagerTags, ::Hash) (defaults to: nil)

      Desired resource manager tag keys and values to be attached to the nodes for managing Compute Engine firewalls using Network Firewall Policies. Existing tags will be replaced with new values.

    • queued_provisioning (::Google::Cloud::Container::V1beta1::NodePool::QueuedProvisioning, ::Hash) (defaults to: nil)

      Specifies the configuration of queued provisioning.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
# File 'lib/google/cloud/container/v1beta1/cluster_manager/client.rb', line 809

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Container::V1beta1::UpdateNodePoolRequest

  # 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_node_pool..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Container::V1beta1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @cluster_manager_stub.call_rpc :update_node_pool, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end