class Google::Apis::ContainerV1::ContainerService

Google Container Engine API

Builds and manages clusters that run container-based applications, powered by

open source Kubernetes technology.

@example

require 'google/apis/container_v1'

Container = Google::Apis::ContainerV1 # Alias the module
service = Container::ContainerService.new

@see cloud.google.com/container-engine/

Attributes

key[RW]

@return [String]

API key. Your API key identifies your project and provides you with API access,
quota, and reports. Required unless you provide an OAuth 2.0 token.
quota_user[RW]

@return [String]

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

Public Class Methods

new() click to toggle source
Calls superclass method Google::Apis::Core::BaseService.new
# File generated/google/apis/container_v1/service.rb, line 46
def initialize
  super('https://container.googleapis.com/', '')
end

Public Instance Methods

create_cluster(project_id, zone, create_cluster_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

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](/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the cluster 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 is being used by the cluster. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides.

@param [Google::Apis::ContainerV1::CreateClusterRequest] create_cluster_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 190
def create_cluster(project_id, zone, create_cluster_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/projects/{projectId}/zones/{zone}/clusters', options)
  command.request_representation = Google::Apis::ContainerV1::CreateClusterRequest::Representation
  command.request_object = create_cluster_request_object
  command.response_representation = Google::Apis::ContainerV1::Operation::Representation
  command.response_class = Google::Apis::ContainerV1::Operation
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
delete_zone_cluster(project_id, zone, cluster_id, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

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 (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides.

@param [String] cluster_id

The name of the cluster to delete.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 274
def delete_zone_cluster(project_id, zone, cluster_id, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}', options)
  command.response_representation = Google::Apis::ContainerV1::Operation::Representation
  command.response_class = Google::Apis::ContainerV1::Operation
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['clusterId'] = cluster_id unless cluster_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_project_zone_serverconfig(project_id, zone, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Returns configuration info about the Container Engine service. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) to
return operations for.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::ServerConfig] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::ServerConfig]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 74
def get_project_zone_serverconfig(project_id, zone, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/zones/{zone}/serverconfig', options)
  command.response_representation = Google::Apis::ContainerV1::ServerConfig::Representation
  command.response_class = Google::Apis::ContainerV1::ServerConfig
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_zone_cluster(project_id, zone, cluster_id, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets the details of a specific cluster. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides.

@param [String] cluster_id

The name of the cluster to retrieve.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::Cluster] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::Cluster]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 147
def get_zone_cluster(project_id, zone, cluster_id, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}', options)
  command.response_representation = Google::Apis::ContainerV1::Cluster::Representation
  command.response_class = Google::Apis::ContainerV1::Cluster
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['clusterId'] = cluster_id unless cluster_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
get_zone_operation(project_id, zone, operation_id, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Gets the specified operation. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides.

@param [String] operation_id

The server-assigned `name` of the operation.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 347
def get_zone_operation(project_id, zone, operation_id, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/zones/{zone}/operations/{operationId}', options)
  command.response_representation = Google::Apis::ContainerV1::Operation::Representation
  command.response_class = Google::Apis::ContainerV1::Operation
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['operationId'] = operation_id unless operation_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_zone_clusters(project_id, zone, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all clusters owned by a project in either the specified zone or all zones. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides, or "-" for all zones.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::ListClustersResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::ListClustersResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 110
def list_zone_clusters(project_id, zone, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/zones/{zone}/clusters', options)
  command.response_representation = Google::Apis::ContainerV1::ListClustersResponse::Representation
  command.response_class = Google::Apis::ContainerV1::ListClustersResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
list_zone_operations(project_id, zone, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Lists all operations in a project in a specific zone or all zones. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) to
return operations for, or `-` for all zones.

@param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::ListOperationsResponse] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::ListOperationsResponse]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 310
def list_zone_operations(project_id, zone, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/projects/{projectId}/zones/{zone}/operations', options)
  command.response_representation = Google::Apis::ContainerV1::ListOperationsResponse::Representation
  command.response_class = Google::Apis::ContainerV1::ListOperationsResponse
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end
update_cluster(project_id, zone, cluster_id, update_cluster_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) click to toggle source

Updates the settings of a specific cluster. @param [String] project_id

The Google Developers Console [project ID or project number](https://support.
google.com/cloud/answer/6158840).

@param [String] zone

The name of the Google Compute Engine [zone](/compute/docs/zones#available) in
which the cluster resides.

@param [String] cluster_id

The name of the cluster to upgrade.

@param [Google::Apis::ContainerV1::UpdateClusterRequest] update_cluster_request_object @param [String] fields

Selector specifying which fields to include in a partial response.

@param [String] #quota_user

Available to use for quota purposes for server-side applications. Can be any
arbitrary string assigned to a user, but should not exceed 40 characters.

@param [Google::Apis::RequestOptions] options

Request-specific options

@yield [result, err] Result & error if block supplied @yieldparam result [Google::Apis::ContainerV1::Operation] parsed result object @yieldparam err [StandardError] error object if request failed

@return [Google::Apis::ContainerV1::Operation]

@raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification @raise [Google::Apis::AuthorizationError] Authorization is required

# File generated/google/apis/container_v1/service.rb, line 230
def update_cluster(project_id, zone, cluster_id, update_cluster_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:put, 'v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}', options)
  command.request_representation = Google::Apis::ContainerV1::UpdateClusterRequest::Representation
  command.request_object = update_cluster_request_object
  command.response_representation = Google::Apis::ContainerV1::Operation::Representation
  command.response_class = Google::Apis::ContainerV1::Operation
  command.params['projectId'] = project_id unless project_id.nil?
  command.params['zone'] = zone unless zone.nil?
  command.params['clusterId'] = cluster_id unless cluster_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Protected Instance Methods

apply_command_defaults(command) click to toggle source
# File generated/google/apis/container_v1/service.rb, line 361
def apply_command_defaults(command)
  command.query['key'] = key unless key.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
end