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 usaing 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 above 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

The Google Developers Console project ID or project number.

zone

string

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

operationId

string

The server-assigned name of the operation.

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

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

var projectId = '';
var zone = '';
var operationId = '';
var 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

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.

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.completeIPRotation(request)
  .then(responses => {
    var 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

The Google Developers Console project ID or project number.

zone

string

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

cluster

Object

A cluster resource

This object should have the same structure as Cluster

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

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

var projectId = '';
var zone = '';
var cluster = {};
var request = {
  projectId: projectId,
  zone: zone,
  cluster: cluster,
};
client.createCluster(request)
  .then(responses => {
    var 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

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.

nodePool

Object

The node pool to create.

This object should have the same structure as NodePool

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var nodePool = {};
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePool: nodePool,
};
client.createNodePool(request)
  .then(responses => {
    var 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

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

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.deleteCluster(request)
  .then(responses => {
    var 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

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.

nodePoolId

string

The name of the node pool to delete.

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var nodePoolId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
};
client.deleteNodePool(request)
  .then(responses => {
    var 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

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

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.getCluster(request)
  .then(responses => {
    var 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

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.

nodePoolId

string

The name of the node pool.

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var nodePoolId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
};
client.getNodePool(request)
  .then(responses => {
    var 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

The Google Developers Console project ID or project number.

zone

string

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

operationId

string

The server-assigned name of the operation.

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

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

var projectId = '';
var zone = '';
var operationId = '';
var request = {
  projectId: projectId,
  zone: zone,
  operationId: operationId,
};
client.getOperation(request)
  .then(responses => {
    var 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 Container Engine service.

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 to return operations for.

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

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

var projectId = '';
var zone = '';
var request = {
  projectId: projectId,
  zone: zone,
};
client.getServerConfig(request)
  .then(responses => {
    var 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

The Google Developers Console project ID or project number.

zone

string

The name of the Google Compute Engine zone in which the cluster resides, or "-" for all zones.

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

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

var projectId = '';
var zone = '';
var request = {
  projectId: projectId,
  zone: zone,
};
client.listClusters(request)
  .then(responses => {
    var 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

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.

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.listNodePools(request)
  .then(responses => {
    var 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

The Google Developers Console project ID or project number.

zone

string

The name of the Google Compute Engine zone to return operations for, or - for all zones.

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

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

var projectId = '';
var zone = '';
var request = {
  projectId: projectId,
  zone: zone,
};
client.listOperations(request)
  .then(responses => {
    var 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

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

nodePoolId

string

The name of the node pool to rollback.

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

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

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

setAddonsConfig

setAddonsConfig(request, options, callback) returns Promise

Sets the addons of a specific 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 upgrade.

addonsConfig

Object

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

This object should have the same structure as AddonsConfig

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var addonsConfig = {};
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  addonsConfig: addonsConfig,
};
client.setAddonsConfig(request)
  .then(responses => {
    var 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

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.

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

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var resourceLabels = {};
var labelFingerprint = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  resourceLabels: resourceLabels,
  labelFingerprint: labelFingerprint,
};
client.setLabels(request)
  .then(responses => {
    var 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

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.

enabled

boolean

Whether ABAC authorization will be enabled in the cluster.

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

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

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

setLocations

setLocations(request, options, callback) returns Promise

Sets the locations of a specific 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 upgrade.

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.

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

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

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

setLoggingService

setLoggingService(request, options, callback) returns Promise

Sets the logging service of a specific 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 upgrade.

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

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var loggingService = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  loggingService: loggingService,
};
client.setLoggingService(request)
  .then(responses => {
    var 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

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var maintenancePolicy = {};
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  maintenancePolicy: maintenancePolicy,
};
client.setMaintenancePolicy(request)
  .then(responses => {
    var 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 of 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

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

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

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

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

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

setMonitoringService

setMonitoringService(request, options, callback) returns Promise

Sets the monitoring service of a specific 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 upgrade.

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

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var monitoringService = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  monitoringService: monitoringService,
};
client.setMonitoringService(request)
  .then(responses => {
    var 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

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.

networkPolicy

Object

Configuration options for the NetworkPolicy feature.

This object should have the same structure as NetworkPolicy

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

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

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

setNodePoolAutoscaling

setNodePoolAutoscaling(request, options, callback) returns Promise

Sets the autoscaling settings of a specific node pool.

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

nodePoolId

string

The name of the node pool to upgrade.

autoscaling

Object

Autoscaling configuration for the node pool.

This object should have the same structure as NodePoolAutoscaling

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var nodePoolId = '';
var autoscaling = {};
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
  autoscaling: autoscaling,
};
client.setNodePoolAutoscaling(request)
  .then(responses => {
    var 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

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.

nodePoolId

string

The name of the node pool to update.

management

Object

NodeManagement configuration for the node pool.

This object should have the same structure as NodeManagement

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

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

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

setNodePoolSize

setNodePoolSize(request, options, callback) returns Promise

Sets the size of a specific node pool.

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.

nodePoolId

string

The name of the node pool to update.

nodeCount

number

The desired node count for the pool.

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var nodePoolId = '';
var nodeCount = 0;
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
  nodePoolId: nodePoolId,
  nodeCount: nodeCount,
};
client.setNodePoolSize(request)
  .then(responses => {
    var 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

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.

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

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

var projectId = '';
var zone = '';
var clusterId = '';
var request = {
  projectId: projectId,
  zone: zone,
  clusterId: clusterId,
};
client.startIPRotation(request)
  .then(responses => {
    var 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

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

update

Object

A description of the update.

This object should have the same structure as ClusterUpdate

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

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

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

updateMaster

updateMaster(request, options, callback) returns Promise

Updates the master of a specific 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 upgrade.

masterVersion

string

The Kubernetes version to change the master to. The only valid value is the latest supported version. Use "-" to have the server automatically select the latest version.

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

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

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

updateNodePool

updateNodePool(request, options, callback) returns Promise

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

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

nodePoolId

string

The name of the node pool to upgrade.

nodeVersion

string

The Kubernetes version to change the nodes to (typically an upgrade). Use - to upgrade to the latest version supported by the server.

imageType

string

The desired image type for the node pool.

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

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

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