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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the operation resides. This field has been deprecated and replaced by the name field.

operationId string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

cluster Object

A cluster resource

This object should have the same structure as Cluster

parent string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

clusterId string

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

nodePool Object

The node pool to create.

This object should have the same structure as NodePool

parent string <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 (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

name string <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 node pool requested.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

operationId string

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

name string <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 Kubernetes Engine service.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

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

name string <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

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

zone string

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

parent string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the parent field.

clusterId string

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

parent string <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

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

zone string

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

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

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

Roll back the previously Aborted or Failed NodePool upgrade. This will be an no-op 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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

addonsConfig Object

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

This object should have the same structure as AddonsConfig

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

resourceLabels Object.<string, string>

The labels to set for that cluster.

labelFingerprint string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

enabled boolean

Whether ABAC authorization will be enabled in the cluster.

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

locations Array.<string>

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

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

loggingService string

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

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

The Google Developers Console project ID or project number.

zone string

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

clusterId string

The name of the cluster to update.

maintenancePolicy Object

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

This object should have the same structure as MaintenancePolicy

name string <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}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

action number

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

The number should be among the values of Action

update Object

A description of the update.

This object should have the same structure as MasterAuth

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

monitoringService string

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

  • "monitoring.googleapis.com" - the Google Cloud Monitoring service
  • "none" - no metrics will be exported from the cluster
name string <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/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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

networkPolicy Object

Configuration options for the NetworkPolicy feature.

This object should have the same structure as NetworkPolicy

name string <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 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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

autoscaling Object

Autoscaling configuration for the node pool.

This object should have the same structure as NodePoolAutoscaling

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

management Object

NodeManagement configuration for the node pool.

This object should have the same structure as NodeManagement

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

nodeCount number

The desired node count for the pool.

name string <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}

Start master IP rotation.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

update Object

A description of the update.

This object should have the same structure as ClusterUpdate

name string <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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

masterVersion string

The Kubernetes version to change the master to.

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

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

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

zone string

Deprecated. The name of the Google Compute Engine zone in which the cluster resides. This field has been deprecated and replaced by the name field.

clusterId string

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

nodePoolId string

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

nodeVersion string

The Kubernetes version to change the nodes to (typically an upgrade).

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

  • "latest": picks the highest valid Kubernetes version
  • "1.X": picks the highest valid patch+gke.N patch in the 1.X version
  • "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  • "1.X.Y-gke.N": picks an explicit Kubernetes version
  • "-": picks the Kubernetes master version
imageType string

The desired image type for the node pool.

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