new ClusterManagerClient([options])

Construct an instance of ClusterManagerClient.

Parameters

Name Type Optional Description

options

 

Yes

The configuration object. See the subsequent parameters for more details.

Values in options have the following properties:

Name Type Optional Description

credentials

 

Yes

Credentials object.

credentials.client_email

 

Yes

credentials.private_key

 

Yes

email

 

Yes

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename

 

Yes

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port

 

Yes

The port on which to connect to the remote host.

projectId

 

Yes

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

promise

 

Yes

Custom promise module to use instead of native Promises.

servicePath

 

Yes

The domain name of the API remote host.

Properties

static

apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

static

port

The port for this API service.

static

scopes

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

static

servicePath

The DNS address for this API service.

Methods

cancelOperation(request[, options][, callback]) → Promise

Cancels the specified operation.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const operationId = '';
const request = {
  projectId: projectId,
  zone: zone,
  operationId: operationId,
};
client.cancelOperation(request).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

operationId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

completeIPRotation(request[, options][, callback]) → Promise

Completes master IP rotation.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.completeIPRotation(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

createCluster(request[, options][, callback]) → Promise

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

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const cluster = {};
const request = {
  projectId: projectId,
  zone: zone,
  cluster: cluster,
};
client.createCluster(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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

Object

 

A cluster resource

This object should have the same structure as Cluster

parent

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

createNodePool(request[, options][, callback]) → Promise

Creates a node pool for a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePool = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePool: nodePool,
};
client.createNodePool(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePool

Object

 

The node pool to create.

This object should have the same structure as NodePool

parent

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

deleteCluster(request[, options][, callback]) → Promise

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.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.deleteCluster(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

deleteNodePool(request[, options][, callback]) → Promise

Deletes a node pool from a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
};
client.deleteNodePool(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

getCluster(request[, options][, callback]) → Promise

Gets the details of a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.getCluster(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Cluster.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Cluster. The promise has a method named "cancel" which cancels the ongoing API call.

getNodePool(request[, options][, callback]) → Promise

Retrieves the node pool requested.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
};
client.getNodePool(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing NodePool.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing NodePool. The promise has a method named "cancel" which cancels the ongoing API call.

getOperation(request[, options][, callback]) → Promise

Gets the specified operation.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const operationId = '';
const request = {
  projectId: projectId,
  zone: zone,
  operationId: operationId,
};
client.getOperation(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

operationId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

getProjectId(callback)

Return the project ID used by this class.

Parameter

Name Type Optional Description

callback

function(Error, string)

 

the callback to be called with the current project Id.

getServerConfig(request[, options][, callback]) → Promise

Returns configuration info about the Kubernetes Engine service.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const request = {
  projectId: projectId,
  zone: zone,
};
client.getServerConfig(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ServerConfig.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ServerConfig. The promise has a method named "cancel" which cancels the ongoing API call.

listClusters(request[, options][, callback]) → Promise

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

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const request = {
  projectId: projectId,
  zone: zone,
};
client.listClusters(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ListClustersResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ListClustersResponse. The promise has a method named "cancel" which cancels the ongoing API call.

listNodePools(request[, options][, callback]) → Promise

Lists the node pools for a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.listNodePools(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

parent

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ListNodePoolsResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ListNodePoolsResponse. The promise has a method named "cancel" which cancels the ongoing API call.

listOperations(request[, options][, callback]) → Promise

Lists all operations in a project in a specific zone or all zones.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const request = {
  projectId: projectId,
  zone: zone,
};
client.listOperations(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ListOperationsResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ListOperationsResponse. The promise has a method named "cancel" which cancels the ongoing API call.

rollbackNodePoolUpgrade(request[, options][, callback]) → Promise

Roll back the previously Aborted or Failed NodePool upgrade. This will be an no-op if the last upgrade successfully completed.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
};
client.rollbackNodePoolUpgrade(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setAddonsConfig(request[, options][, callback]) → Promise

Sets the addons for a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const addonsConfig = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  addonsConfig: addonsConfig,
};
client.setAddonsConfig(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

addonsConfig

Object

 

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

This object should have the same structure as AddonsConfig

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setLabels(request[, options][, callback]) → Promise

Sets labels on a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const resourceLabels = {};
const labelFingerprint = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  resourceLabels: resourceLabels,
  labelFingerprint: labelFingerprint,
};
client.setLabels(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

resourceLabels

Object with string properties

 

The labels to set for that cluster.

labelFingerprint

string

 

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

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setLegacyAbac(request[, options][, callback]) → Promise

Enables or disables the ABAC authorization mechanism on a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const enabled = false;
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  enabled: enabled,
};
client.setLegacyAbac(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

enabled

boolean

 

Whether ABAC authorization will be enabled in the cluster.

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setLocations(request[, options][, callback]) → Promise

Sets the locations for a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const locations = [];
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  locations: locations,
};
client.setLocations(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

locations

Array of string

 

The desired list of Google Compute Engine locations 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

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setLoggingService(request[, options][, callback]) → Promise

Sets the logging service for a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const loggingService = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  loggingService: loggingService,
};
client.setLoggingService(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

loggingService

string

 

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

  • "logging.googleapis.com" - the Google Cloud Logging service
  • "none" - no metrics will be exported from the cluster

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setMaintenancePolicy(request[, options][, callback]) → Promise

Sets the maintenance policy for a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const maintenancePolicy = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  maintenancePolicy: maintenancePolicy,
};
client.setMaintenancePolicy(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

The Google Developers Console project ID or project number.

zone

string

 

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

clusterId

string

 

The name of the cluster to update.

maintenancePolicy

Object

 

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

This object should have the same structure as MaintenancePolicy

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setMasterAuth(request[, options][, callback]) → Promise

Used to set master auth materials. Currently supports :- Changing the admin password for a specific cluster. This can be either via password generation or explicitly set the password.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const action = 'UNKNOWN';
const update = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  action: action,
  update: update,
};
client.setMasterAuth(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

action

number

 

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

The number should be among the values of Action

update

Object

 

A description of the update.

This object should have the same structure as MasterAuth

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setMonitoringService(request[, options][, callback]) → Promise

Sets the monitoring service for a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const monitoringService = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  monitoringService: monitoringService,
};
client.setMonitoringService(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

monitoringService

string

 

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

  • "monitoring.googleapis.com" - the Google Cloud Monitoring service
  • "none" - no metrics will be exported from the cluster

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setNetworkPolicy(request[, options][, callback]) → Promise

Enables/Disables Network Policy for a cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const networkPolicy = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  networkPolicy: networkPolicy,
};
client.setNetworkPolicy(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

networkPolicy

Object

 

Configuration options for the NetworkPolicy feature.

This object should have the same structure as NetworkPolicy

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setNodePoolAutoscaling(request[, options][, callback]) → Promise

Sets the autoscaling settings for a specific node pool.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const autoscaling = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
  autoscaling: autoscaling,
};
client.setNodePoolAutoscaling(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

autoscaling

Object

 

Autoscaling configuration for the node pool.

This object should have the same structure as NodePoolAutoscaling

name

string

Yes

The name (project, location, cluster, node pool) of the node pool to set autoscaler settings. Specified in the format 'projects/* /locations/* /clusters/* /nodePools/*'.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setNodePoolManagement(request[, options][, callback]) → Promise

Sets the NodeManagement options for a node pool.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const management = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
  management: management,
};
client.setNodePoolManagement(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

management

Object

 

NodeManagement configuration for the node pool.

This object should have the same structure as NodeManagement

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

setNodePoolSize(request[, options][, callback]) → Promise

Sets the size for a specific node pool.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const nodeCount = 0;
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
  nodeCount: nodeCount,
};
client.setNodePoolSize(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

nodeCount

number

 

The desired node count for the pool.

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

startIPRotation(request[, options][, callback]) → Promise

Start master IP rotation.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.startIPRotation(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

name

string

Yes

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

rotateCredentials

boolean

Yes

Whether to rotate credentials during IP rotation.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

updateCluster(request[, options][, callback]) → Promise

Updates the settings of a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const update = {};
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  update: update,
};
client.updateCluster(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

update

Object

 

A description of the update.

This object should have the same structure as ClusterUpdate

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

updateMaster(request[, options][, callback]) → Promise

Updates the master for a specific cluster.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const masterVersion = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  masterVersion: masterVersion,
};
client.updateMaster(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

masterVersion

string

 

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

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.

updateNodePool(request[, options][, callback]) → Promise

Updates the version and/or image type for a specific node pool.

Example

const container = require('@google-cloud/container');

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = '';
const zone = '';
const clusterId = '';
const nodePoolId = '';
const nodeVersion = '';
const imageType = '';
const request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
  nodeVersion: nodeVersion,
  imageType: imageType,
};
client.updateNodePool(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

projectId

string

 

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

zone

string

 

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.

clusterId

string

 

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

nodePoolId

string

 

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

nodeVersion

string

 

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

imageType

string

 

The desired image type for the node pool.

name

string

Yes

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

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Operation.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Operation. The promise has a method named "cancel" which cancels the ongoing API call.