Constructor

ClusterManagerClient

new ClusterManagerClient(options)

Construct an instance of ClusterManagerClient.

Parameter

options

Optional

object

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

Values in options have the following properties:

Parameter

credentials

Optional

object

Credentials object.

credentials.client_email

Optional

string

credentials.private_key

Optional

string

email

Optional

string

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

keyFilename

Optional

string

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

Optional

number

The port on which to connect to the remote host.

projectId

Optional

string

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

Optional

function()

Custom promise module to use instead of native Promises.

servicePath

Optional

string

The domain name of the API remote host.

Properties

port

static

The port for this API service.

scopes

static

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

servicePath

static

The DNS address for this API service.

Methods

cancelOperation

cancelOperation(request, options, callback) returns Promise

Cancels the specified operation.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error)

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.

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);
});

completeIPRotation

completeIPRotation(request, options, callback) returns Promise

Completes master IP rotation.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

createCluster

createCluster(request, options, callback) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

createNodePool

createNodePool(request, options, callback) returns Promise

Creates a node pool for a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

deleteCluster

deleteCluster(request, options, callback) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

deleteNodePool

deleteNodePool(request, options, callback) returns Promise

Deletes a node pool from a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

getCluster

getCluster(request, options, callback) returns Promise

Gets the details of a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

getNodePool

getNodePool(request, options, callback) returns Promise

Retrieves the node pool requested.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

getOperation

getOperation(request, options, callback) returns Promise

Gets the specified operation.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

getProjectId

getProjectId(callback)

Return the project ID used by this class.

Parameter

callback

function(Error, string)

the callback to be called with the current project Id.

getServerConfig

getServerConfig(request, options, callback) returns Promise

Returns configuration info about the Kubernetes Engine service.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

listClusters

listClusters(request, options, callback) returns Promise

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

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

listNodePools

listNodePools(request, options, callback) returns Promise

Lists the node pools for a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

listOperations

listOperations(request, options, callback) returns Promise

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

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

rollbackNodePoolUpgrade

rollbackNodePoolUpgrade(request, options, callback) returns Promise

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

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setAddonsConfig

setAddonsConfig(request, options, callback) returns Promise

Sets the addons for a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setLabels

setLabels(request, options, callback) returns Promise

Sets labels on a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setLegacyAbac

setLegacyAbac(request, options, callback) returns Promise

Enables or disables the ABAC authorization mechanism on a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setLocations

setLocations(request, options, callback) returns Promise

Sets the locations for a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setLoggingService

setLoggingService(request, options, callback) returns Promise

Sets the logging service for a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setMaintenancePolicy

setMaintenancePolicy(request, options, callback) returns Promise

Sets the maintenance policy for a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setMasterAuth

setMasterAuth(request, options, callback) returns 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.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setMonitoringService

setMonitoringService(request, options, callback) returns Promise

Sets the monitoring service for a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setNetworkPolicy

setNetworkPolicy(request, options, callback) returns Promise

Enables/Disables Network Policy for a cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setNodePoolAutoscaling

setNodePoolAutoscaling(request, options, callback) returns Promise

Sets the autoscaling settings for a specific node pool.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setNodePoolManagement

setNodePoolManagement(request, options, callback) returns Promise

Sets the NodeManagement options for a node pool.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

setNodePoolSize

setNodePoolSize(request, options, callback) returns Promise

Sets the size for a specific node pool.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

startIPRotation

startIPRotation(request, options, callback) returns Promise

Start master IP rotation.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

rotateCredentials

Optional

boolean

Whether to rotate credentials during IP rotation.

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

updateCluster

updateCluster(request, options, callback) returns Promise

Updates the settings of a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

updateMaster

updateMaster(request, options, callback) returns Promise

Updates the master for a specific cluster.

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });

updateNodePool

updateNodePool(request, options, callback) returns Promise

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

Parameter

request

Object

The request object that will be sent.

Values in request have the following properties:

Parameter

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

Optional

string

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

options

Optional

Object

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

callback

Optional

function(nullable Error, nullable Object)

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.

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);
  });