Class v1beta1.ClusterManagerClient (5.19.0)

Google Kubernetes Engine Cluster Manager v1beta1 v1beta1

Package

@google-cloud/container

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of ClusterManagerClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new ClusterManagerClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

clusterManagerStub

clusterManagerStub?: Promise<{
        [name: string]: Function;
    }>;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

cancelOperation(request, options)

cancelOperation(request?: protos.google.container.v1beta1.ICancelOperationRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.container.v1beta1.ICancelOperationRequest | undefined,
        {} | undefined
    ]>;

Cancels the specified operation.

Parameters
Name Description
request ICancelOperationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICancelOperationRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The name (project, location, operation id) of the operation to cancel.
   *  Specified in the format `projects/* /locations/* /operations/*`.
   */
  // const name = 'abc123'

  // Imports the Container library
  const {ClusterManagerClient} = require('@google-cloud/container').v1beta1;

  // Instantiates a client
  const containerClient = new ClusterManagerClient();

  async function callCancelOperation() {
    // Construct request
    const request = {
      projectId,
      zone,
      operationId,
    };

    // Run request
    const response = await containerClient.cancelOperation(request);
    console.log(response);
  }

  callCancelOperation();

cancelOperation(request, options, callback)

cancelOperation(request: protos.google.container.v1beta1.ICancelOperationRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICancelOperationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICancelOperationRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICancelOperationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

cancelOperation(request, callback)

cancelOperation(request: protos.google.container.v1beta1.ICancelOperationRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICancelOperationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICancelOperationRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICancelOperationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

checkAutopilotCompatibility(request, options)

checkAutopilotCompatibility(request?: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, options?: CallOptions): Promise<[
        protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse,
        (protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest | undefined),
        {} | undefined
    ]>;

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

Parameters
Name Description
request ICheckAutopilotCompatibilityRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, (protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing CheckAutopilotCompatibilityResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The name (project, location, cluster) of the cluster to retrieve.
   *  Specified in the format `projects/* /locations/* /clusters/*`.
   */
  // const name = 'abc123'

  // Imports the Container library
  const {ClusterManagerClient} = require('@google-cloud/container').v1beta1;

  // Instantiates a client
  const containerClient = new ClusterManagerClient();

  async function callCheckAutopilotCompatibility() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await containerClient.checkAutopilotCompatibility(request);
    console.log(response);
  }

  callCheckAutopilotCompatibility();

checkAutopilotCompatibility(request, options, callback)

checkAutopilotCompatibility(request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, options: CallOptions, callback: Callback<protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICheckAutopilotCompatibilityRequest
options CallOptions
callback Callback<protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

checkAutopilotCompatibility(request, callback)

checkAutopilotCompatibility(request: protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest, callback: Callback<protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICheckAutopilotCompatibilityRequest
callback Callback<protos.google.container.v1beta1.ICheckAutopilotCompatibilityResponse, protos.google.container.v1beta1.ICheckAutopilotCompatibilityRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise<void>

{Promise} A promise that resolves when the client is closed.

completeIPRotation(request, options)

completeIPRotation(request?: protos.google.container.v1beta1.ICompleteIPRotationRequest, options?: CallOptions): Promise<[
        protos.google.container.v1beta1.IOperation,
        protos.google.container.v1beta1.ICompleteIPRotationRequest | undefined,
        {} | undefined
    ]>;

Completes master IP rotation.

Parameters
Name Description
request ICompleteIPRotationRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICompleteIPRotationRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The name (project, location, cluster name) of the cluster to complete IP
   *  rotation. Specified in the format `projects/* /locations/* /clusters/*`.
   */
  // const name = 'abc123'

  // Imports the Container library
  const {ClusterManagerClient} = require('@google-cloud/container').v1beta1;

  // Instantiates a client
  const containerClient = new ClusterManagerClient();

  async function callCompleteIPRotation() {
    // Construct request
    const request = {
      projectId,
      zone,
      clusterId,
    };

    // Run request
    const response = await containerClient.completeIPRotation(request);
    console.log(response);
  }

  callCompleteIPRotation();

completeIPRotation(request, options, callback)

completeIPRotation(request: protos.google.container.v1beta1.ICompleteIPRotationRequest, options: CallOptions, callback: Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICompleteIPRotationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICompleteIPRotationRequest
options CallOptions
callback Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICompleteIPRotationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

completeIPRotation(request, callback)

completeIPRotation(request: protos.google.container.v1beta1.ICompleteIPRotationRequest, callback: Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICompleteIPRotationRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICompleteIPRotationRequest
callback Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICompleteIPRotationRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

completeNodePoolUpgrade(request, options)

completeNodePoolUpgrade(request?: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest | undefined),
        {} | undefined
    ]>;

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

Parameters
Name Description
request ICompleteNodePoolUpgradeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, (protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The name (project, location, cluster, node pool id) of the node pool to
   *  complete upgrade.
   *  Specified in the format `projects/* /locations/* /clusters/* /nodePools/*`.
   */
  // const name = 'abc123'

  // Imports the Container library
  const {ClusterManagerClient} = require('@google-cloud/container').v1beta1;

  // Instantiates a client
  const containerClient = new ClusterManagerClient();

  async function callCompleteNodePoolUpgrade() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await containerClient.completeNodePoolUpgrade(request);
    console.log(response);
  }

  callCompleteNodePoolUpgrade();

completeNodePoolUpgrade(request, options, callback)

completeNodePoolUpgrade(request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICompleteNodePoolUpgradeRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

completeNodePoolUpgrade(request, callback)

completeNodePoolUpgrade(request: protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICompleteNodePoolUpgradeRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.container.v1beta1.ICompleteNodePoolUpgradeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createCluster(request, options)

createCluster(request?: protos.google.container.v1beta1.ICreateClusterRequest, options?: CallOptions): Promise<[
        protos.google.container.v1beta1.IOperation,
        protos.google.container.v1beta1.ICreateClusterRequest | undefined,
        {} | undefined
    ]>;

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.

Parameters
Name Description
request ICreateClusterRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICreateClusterRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. A cluster
   *  resource (https://cloud.google.com/container-engine/reference/rest/v1beta1/projects.locations.clusters)
   */
  // const cluster = {}
  /**
   *  The parent (project and location) where the cluster will be created.
   *  Specified in the format `projects/* /locations/*`.
   */
  // const parent = 'abc123'

  // Imports the Container library
  const {ClusterManagerClient} = require('@google-cloud/container').v1beta1;

  // Instantiates a client
  const containerClient = new ClusterManagerClient();

  async function callCreateCluster() {
    // Construct request
    const request = {
      projectId,
      zone,
      cluster,
    };

    // Run request
    const response = await containerClient.createCluster(request);
    console.log(response);
  }

  callCreateCluster();

createCluster(request, options, callback)

createCluster(request: protos.google.container.v1beta1.ICreateClusterRequest, options: CallOptions, callback: Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICreateClusterRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateClusterRequest
options CallOptions
callback Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICreateClusterRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createCluster(request, callback)

createCluster(request: protos.google.container.v1beta1.ICreateClusterRequest, callback: Callback<protos.google.container.v1beta1.IOperation, protos.google.container.v1beta1.ICreateClusterRequest | null | undefined, {}