The configuration object.
The options accepted by the constructor are described in detail
in this document.
The common options are:
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.
apiEndpoint
string
<optional>
The domain name of the
API remote host.
clientConfig
gax.ClientConfig
<optional>
Client configuration override.
Follows the structure of gapicConfig.
fallback
boolean
<optional>
Use HTTP fallback mode.
In fallback mode, a special browser-compatible transport implementation is used
instead of gRPC transport. In browser context (if the window object is defined)
the fallback mode is enabled automatically; set options.fallback to false
if you need to override this behavior.
Members
apiEndpoint
The DNS address for this API service - same as servicePath(),
exists for compatibility reasons.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined
in this service.
servicePath
The DNS address for this API service.
Methods
cancelOperation(request, optionsopt) → {Promise}
Cancels the specified operation.
Parameters:
Name
Type
Attributes
Description
request
Object
The request object that will be sent.
Properties
Name
Type
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
The name (project, location, operation id) of the operation to cancel.
Specified in the format projects/* /locations/* /operations/*.
The promise which resolves to an array.
The first element of the array is an object representing Empty.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
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.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
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
The name (project, location, cluster) of the cluster to delete.
Specified in the format projects/* /locations/* /clusters/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
The name (project, location, cluster, node pool id) of the node pool to
delete. Specified in the format
projects/* /locations/* /clusters/* /nodePools/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Cluster.
Please see the
documentation
for more details and examples.
Gets the public component of the cluster signing keys in
JSON Web Key format.
This API is not yet intended for general use, and is not available for all
clusters.
Parameters:
Name
Type
Attributes
Description
request
Object
The request object that will be sent.
Properties
Name
Type
Description
parent
string
The cluster (project, location, cluster id) to get keys for. Specified in
the format projects/* /locations/* /clusters/*.
The promise which resolves to an array.
The first element of the array is an object representing GetJSONWebKeysResponse.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing NodePool.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing ServerConfig.
Please see the
documentation
for more details and examples.
Initialize the client.
Performs asynchronous operations (such as authentication) and prepares the client.
This function will be called automatically when any class method is called for the
first time, but if you need to initialize it before calling an actual method,
feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns:
Type
Description
Promise
A promise that resolves to an authenticated service stub.
listClusters(request, optionsopt) → {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
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
The parent (project and location) where the clusters will be listed.
Specified in the format projects/* /locations/*.
Location "-" matches all zones and all regions.
The promise which resolves to an array.
The first element of the array is an object representing ListClustersResponse.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing ListNodePoolsResponse.
Please see the
documentation
for more details and examples.
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
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
The parent (project and location) where the operations will be listed.
Specified in the format projects/* /locations/*.
Location "-" matches all zones and all regions.
The promise which resolves to an array.
The first element of the array is an object representing ListOperationsResponse.
Please see the
documentation
for more details and examples.
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
Description
parent
string
The parent project where subnetworks are usable.
Specified in the format projects/*.
filter
string
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
The max number of results per page that should be returned. If the number
of available results is larger than page_size, a next_page_token is
returned which can be used to get the next page of results in subsequent
requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
pageToken
string
Specifies a page token to use. Set this to the nextPageToken returned by
previous list requests to get the next page of results.
The promise which resolves to an array.
The first element of the array is Array of UsableSubnetwork.
The client library will perform auto-pagination by default: it will call the API as many
times as needed and will merge results from all the pages into this array.
Note that it can affect your quota.
We recommend using listUsableSubnetworksAsync()
method described below for async iteration which you can stop as needed.
Please see the
documentation
for more details and examples.
Equivalent to listUsableSubnetworks, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Parameters:
Name
Type
Attributes
Description
request
Object
The request object that will be sent.
Properties
Name
Type
Description
parent
string
The parent project where subnetworks are usable.
Specified in the format projects/*.
filter
string
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
The max number of results per page that should be returned. If the number
of available results is larger than page_size, a next_page_token is
returned which can be used to get the next page of results in subsequent
requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
pageToken
string
Specifies a page token to use. Set this to the nextPageToken returned by
previous list requests to get the next page of results.
An iterable Object that allows async iteration.
When you iterate the returned iterable, each element will be an object representing
UsableSubnetwork. The API will be called under the hood as needed, once per the page,
so you can stop the iteration when you don't need more results.
Please see the
documentation
for more details and examples.
Example
const iterable = client.listUsableSubnetworksAsync(request);
for await (const response of iterable) {
// process response
}
Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.
Parameters:
Name
Type
Attributes
Description
request
Object
The request object that will be sent.
Properties
Name
Type
Description
parent
string
The parent project where subnetworks are usable.
Specified in the format projects/*.
filter
string
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
The max number of results per page that should be returned. If the number
of available results is larger than page_size, a next_page_token is
returned which can be used to get the next page of results in subsequent
requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
pageToken
string
Specifies a page token to use. Set this to the nextPageToken returned by
previous list requests to get the next page of results.
An object stream which emits an object representing UsableSubnetwork on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using listUsableSubnetworksAsync()
method described below for async iteration which you can stop as needed.
Please see the
documentation
for more details and examples.
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
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
The name (project, location, cluster, node pool id) of the node poll to
rollback upgrade.
Specified in the format projects/* /locations/* /clusters/* /nodePools/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
Array.<number>
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
The name (project, location, cluster id) of the cluster to set labels.
Specified in the format projects/* /locations/* /clusters/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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>
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
The name (project, location, cluster) of the cluster to set locations.
Specified in the format projects/* /locations/* /clusters/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
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.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
Required. Autoscaling configuration for the node pool.
name
string
The name (project, location, cluster, node pool) of the node pool to set
autoscaler settings. Specified in the format
projects/* /locations/* /clusters/* /nodePools/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
Required. NodeManagement configuration for the node pool.
name
string
The name (project, location, cluster, node pool id) of the node pool to set
management properties. Specified in the format
projects/* /locations/* /clusters/* /nodePools/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
Required. The desired node count for the pool.
name
string
The name (project, location, cluster, node pool id) of the node pool to set
size.
Specified in the format projects/* /locations/* /clusters/* /nodePools/*.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.
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
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
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
The name (project, location, cluster, node pool) of the node pool to
update. Specified in the format
projects/* /locations/* /clusters/* /nodePools/*.
locations
Array.<string>
The desired list of Google Compute Engine
zones in which the
node pool's nodes should be located. Changing the locations for a node pool
will result in nodes being either created or removed from the node pool,
depending on whether locations are being added or removed.
The promise which resolves to an array.
The first element of the array is an object representing Operation.
Please see the
documentation
for more details and examples.