ClusterManagerClient

ClusterManagerClient

Google Kubernetes Engine Cluster Manager v1

Constructor

new ClusterManagerClient(optionsopt)

Construct an instance of ClusterManagerClient.

Parameters:
Name Type Attributes Description
options object <optional>

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

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

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

keyFilename string <optional>

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 number <optional>

The port on which to connect to the remote host.

projectId string <optional>

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 function <optional>

Custom promise module to use instead of native Promises.

apiEndpoint string <optional>

The domain name of the API remote host.

Source:

Members

(static) apiEndpoint

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

Source:

(static) port

The port for this API service.

Source:

(static) scopes

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

Source:

(static) servicePath

The DNS address for this API service.

Source:

Methods

cancelOperation(request, optionsopt, callbackopt) → {Promise}

Cancels the specified operation.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Completes master IP rotation.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {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 Kubelet creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster.

Finally, an entry is added to the project's global metadata indicating which CIDR range the cluster is using.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

Required. A cluster resource

This object should have the same structure as Cluster

parent string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Creates a node pool for a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePool Object

Required. The node pool to create.

This object should have the same structure as NodePool

parent string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {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, such as load balancer resources, are not deleted if they weren't present when the cluster was initially created.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Deletes a node pool from a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Gets the details of a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Retrieves the requested node pool.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Gets the specified operation.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

Source:

getServerConfig(request, optionsopt, callbackopt) → {Promise}

Returns configuration info about the Google Kubernetes Engine service.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Required. Deprecated. The name of the Google Compute Engine zone to return operations for. This field has been deprecated and replaced by the name field.

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Required. Deprecated. The name of the Google Compute Engine zone in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field.

parent string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Lists the node pools for a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

parent string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Required. Deprecated. The name of the Google Compute Engine zone to return operations for, or - for all zones. This field has been deprecated and replaced by the parent field.

parent string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

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

listUsableSubnetworks(request, optionsopt, callbackopt) → {Promise}

Lists subnetworks that are usable for creating clusters in a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string <optional>

The parent project where subnetworks are usable. Specified in the format 'projects/*'.

filter string <optional>

Filtering currently only supports equality on the networkProjectId and must be in the form: "networkProjectId=[PROJECTID]", where networkProjectId is the project which owns the listed subnetworks. This defaults to the parent project ID.

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

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

callback function <optional>

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

The second parameter to the callback is Array of UsableSubnetwork.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListUsableSubnetworksResponse.

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

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

// Iterate over all elements.
client.listUsableSubnetworks({})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.

const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listUsableSubnetworks(nextRequest, options).then(callback);
  }
}
client.listUsableSubnetworks({}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

listUsableSubnetworksStream(request, optionsopt) → {Stream}

Equivalent to listUsableSubnetworks, but returns a NodeJS Stream object.

This fetches the paged responses for listUsableSubnetworks continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string <optional>

The parent project where subnetworks are usable. Specified in the format 'projects/*'.

filter string <optional>

Filtering currently only supports equality on the networkProjectId and must be in the form: "networkProjectId=[PROJECTID]", where networkProjectId is the project which owns the listed subnetworks. This defaults to the parent project ID.

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

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

Source:
See:
Example
const container = require('@google-cloud/container');

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


client.listUsableSubnetworksStream({})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

rollbackNodePoolUpgrade(request, optionsopt, callbackopt) → {Promise}

Rolls back a previously Aborted or Failed NodePool upgrade. This makes no changes if the last upgrade successfully completed.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the addons for a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

addonsConfig Object

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

This object should have the same structure as AddonsConfig

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets labels on a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

resourceLabels Object.<string, string>

Required. The labels to set for that cluster.

labelFingerprint string

Required. The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Kubernetes Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make a get() request to the resource to get the latest fingerprint.

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Enables or disables the ABAC authorization mechanism on a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

enabled boolean

Required. Whether ABAC authorization will be enabled in the cluster.

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the locations for a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

locations Array.<string>

Required. The desired list of Google Compute Engine zones in which the cluster's nodes should be located. Changing the locations a cluster is in will result in nodes being either created or removed from the cluster, depending on whether locations are being added or removed.

This list must always include the cluster's primary zone.

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the logging service for a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

loggingService string

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

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

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the maintenance policy for a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

Required. The Google Developers Console project ID or project number.

zone string

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

clusterId string

Required. The name of the cluster to update.

maintenancePolicy Object

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

This object should have the same structure as MaintenancePolicy

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets master auth materials. Currently supports changing the admin password or a specific cluster, either via password generation or explicitly setting the password.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

action number

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

The number should be among the values of Action

update Object

Required. A description of the update.

This object should have the same structure as MasterAuth

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the monitoring service for a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

monitoringService string

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

  • "monitoring.googleapis.com/kubernetes" - the Google Cloud Monitoring service with Kubernetes-native resource model
  • "monitoring.googleapis.com" - the Google Cloud Monitoring service
  • "none" - no metrics will be exported from the cluster
name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Enables or disables Network Policy for a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

networkPolicy Object

Required. Configuration options for the NetworkPolicy feature.

This object should have the same structure as NetworkPolicy

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the autoscaling settings for the specified node pool.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

autoscaling Object

Required. Autoscaling configuration for the node pool.

This object should have the same structure as NodePoolAutoscaling

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the NodeManagement options for a node pool.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

management Object

Required. NodeManagement configuration for the node pool.

This object should have the same structure as NodeManagement

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Sets the size for a specific node pool.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

nodeCount number

Required. The desired node count for the pool.

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Starts master IP rotation.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

name string <optional>

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

rotateCredentials boolean <optional>

Whether to rotate credentials during IP rotation.

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Updates the settings of a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

update Object

Required. A description of the update.

This object should have the same structure as ClusterUpdate

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

Updates the master for a specific cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

masterVersion string

Required. The Kubernetes version to change the master to.

Users may specify either explicit versions offered by Kubernetes Engine or version aliases, which have the following behavior:

  • "latest": picks the highest valid Kubernetes version
  • "1.X": picks the highest valid patch+gke.N patch in the 1.X version
  • "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  • "1.X.Y-gke.N": picks an explicit Kubernetes version
  • "-": picks the default Kubernetes version
name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

Source:
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(request, optionsopt, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

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

nodePoolId string

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

nodeVersion string

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

Required. The desired image type for the node pool.

name string <optional>

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

options Object <optional>

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

callback function <optional>

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

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

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