Class ClusterManagerClient (2.11.2)

ClusterManagerClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.container_v1beta1.services.cluster_manager.transports.base.ClusterManagerTransport]] = None, client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Google Kubernetes Engine Cluster Manager v1beta1

Properties

transport

Returns the transport used by the client instance.

Returns
TypeDescription
ClusterManagerTransportThe transport used by the client instance.

Methods

ClusterManagerClient

ClusterManagerClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.container_v1beta1.services.cluster_manager.transports.base.ClusterManagerTransport]] = None, client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Instantiates the cluster manager client.

Parameters
NameDescription
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Union[str, ClusterManagerTransport]

The transport to use. If set to None, a transport is chosen automatically.

client_options google.api_core.client_options.ClientOptions

Custom options for the client. It won't take effect if a transport instance is provided. (1) The api_endpoint property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto switch to the default mTLS endpoint if client certificate is present, this is the default value). However, the api_endpoint property takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide client certificate for mutual TLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

Exceptions
TypeDescription
google.auth.exceptions.MutualTLSChannelErrorIf mutual TLS transport creation failed for any reason.

__exit__

__exit__(type, value, traceback)

Releases underlying transport's resources.

cancel_operation

cancel_operation(request: Optional[Union[google.cloud.container_v1beta1.types.cluster_service.CancelOperationRequest, dict]] = None, *, project_id: Optional[str] = None, zone: Optional[str] = None, operation_id: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Cancels the specified operation.

from google.cloud import container_v1beta1

def sample_cancel_operation():
    # Create a client
    client = container_v1beta1.ClusterManagerClient()

    # Initialize request argument(s)
    request = container_v1beta1.CancelOperationRequest(
        project_id="project_id_value",
        zone="zone_value",
        operation_id="operation_id_value",
    )

    # Make the request
    client.cancel_operation(request=request)
Parameters
NameDescription
request Union[google.cloud.container_v1beta1.types.CancelOperationRequest, dict]

The request object. CancelOperationRequest cancels a single operation.

project_id str

Required. Deprecated. The Google Developers Console project ID or project number https://cloud.google.com/resource-manager/docs/creating-managing-projects__. This field has been deprecated and replaced by the name field. This corresponds to the project_id field on the request instance; if request is provided, this should not be set.

zone str

Required. Deprecated. The name of the Google Compute Engine zone https://cloud.google.com/compute/docs/zones#available__ in which the operation resides. This field has been deprecated and replaced by the name field. This corresponds to the zone field on the request instance; if request is provided, this should not be set.

operation_id str

Required. Deprecated. The server-assigned name of the operation. This field has been deprecated and replaced by the name field. This corresponds to the operation_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

common_billing_account_path

common_billing_account_path(billing_account: str)

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str)

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str)

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str)

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str)

Returns a fully-qualified project string.

complete_ip_rotation

complete_ip_rotation(request: Optional[Union[google.cloud.container_v1beta1.types.cluster_service.CompleteIPRotationRequest, dict]] = None, *, project_id: Optional[str] = None, zone: Optional[str] = None, cluster_id: Optional[str] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Completes master IP rotation.

from google.cloud import container_v1beta1

def sample_complete_ip_rotation():
    # Create a client
    client = container_v1beta1.ClusterManagerClient()

    # Initialize request argument(s)
    request = container_v1beta1.CompleteIPRotationRequest(
        project_id="project_id_value",
        zone="zone_value",
        cluster_id="cluster_id_value",
    )

    # Make the request
    response = client.complete_ip_rotation(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.container_v1beta1.types.CompleteIPRotationRequest, dict]

The request object. CompleteIPRotationRequest moves the cluster master back into single-IP mode.

project_id str

Required. Deprecated. The Google Developers Console project ID or project number https://cloud.google.com/resource-manager/docs/creating-managing-projects__. This field has been deprecated and replaced by the name field. This corresponds to the project_id field on the request instance; if request is provided, this should not be set.

zone str

Required. Deprecated. The name of the Google Compute Engine zone https://cloud.google.com/compute/docs/zones#available__ in which the cluster resides. This field has been deprecated and replaced by the name field. This corresponds to the zone field on the request instance; if request is provided, this should not be set.

cluster_id str

Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. This corresponds to the cluster_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.container_v1beta1.types.OperationThis operation resource represents operations that may have happened or are happening on the cluster. All fields are output only.

complete_node_pool_upgrade

complete_node_pool_upgrade(request: Optional[Union[google.cloud.container_v1beta1.types.cluster_service.CompleteNodePoolUpgradeRequest, dict]] = None, *, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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

from google.cloud import container_v1beta1

def sample_complete_node_pool_upgrade():
    # Create a client
    client = container_v1beta1.ClusterManagerClient()

    # Initialize request argument(s)
    request = container_v1beta1.CompleteNodePoolUpgradeRequest(
    )

    # Make the request
    client.complete_node_pool_upgrade(request=request)
Parameters
NameDescription
request Union[google.cloud.container_v1beta1.types.CompleteNodePoolUpgradeRequest, dict]

The request object. CompleteNodePoolUpgradeRequest sets the name of target node pool to complete upgrade.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

create_cluster

create_cluster(request: Optional[Union[google.cloud.container_v1beta1.types.cluster_service.CreateClusterRequest, dict]] = None, *, project_id: Optional[str] = None, zone: Optional[str] = None, cluster: Optional[google.cloud.container_v1beta1.types.cluster_service.Cluster] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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 <https://cloud.google.com/compute/docs/networks-and-firewalls#networks>__.

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.

from google.cloud import container_v1beta1

def sample_create_cluster():
    # Create a client
    client = container_v1beta1.ClusterManagerClient()

    # Initialize request argument(s)
    request = container_v1beta1.CreateClusterRequest(
        project_id="project_id_value",
        zone="zone_value",
    )

    # Make the request
    response = client.create_cluster(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Union[google.cloud.container_v1beta1.types.CreateClusterRequest, dict]

The request object. CreateClusterRequest creates a cluster.

project_id str

Required. Deprecated. The Google Developers Console project ID or project number https://cloud.google.com/resource-manager/docs/creating-managing-projects__. This field has been deprecated and replaced by the parent field. This corresponds to the project_id field on the request instance; if request is provided, this should not be set.

zone str

Required. Deprecated. The name of the Google Compute Engine zone https://cloud.google.com/compute/docs/zones#available__ in which the cluster resides. This field has been deprecated and replaced by the parent field. This corresponds to the zone field on the request instance; if request is provided, this should not be set.

cluster google.cloud.container_v1beta1.types.Cluster

Required. A cluster resource https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters__ This corresponds to the cluster field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.