ClusterControllerClient

ClusterControllerClient

The ClusterControllerService provides methods to manage clusters of Compute Engine instances.

Constructor

new ClusterControllerClient(optionsopt)

Construct an instance of ClusterControllerClient.

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.

apiEndpoint string <optional>

The domain name of the API remote host.

Members

(static) apiEndpoint

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

(static) port

The port for this API service.

(static) scopes

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

(static) servicePath

The DNS address for this API service.

Methods

(async) checkCreateClusterProgress(name) → {Promise}

Check the status of the long running operation returned by the createCluster() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkDeleteClusterProgress(name) → {Promise}

Check the status of the long running operation returned by the deleteCluster() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkDiagnoseClusterProgress(name) → {Promise}

Check the status of the long running operation returned by the diagnoseCluster() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkUpdateClusterProgress(name) → {Promise}

Check the status of the long running operation returned by the updateCluster() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

close()

Terminate the GRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

createCluster(request, optionsopt) → {Promise}

Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

cluster google.cloud.dataproc.v1.Cluster

Required. The cluster to create.

requestId string <optional>

Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

It is recommended to always set this value to a UUID.

The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

options object <optional>

Call options. See CallOptions for more details.

deleteCluster(request, optionsopt) → {Promise}

Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

clusterName string

Required. The cluster name.

clusterUuid string <optional>

Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.

requestId string <optional>

Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

It is recommended to always set this value to a UUID.

The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

options object <optional>

Call options. See CallOptions for more details.

diagnoseCluster(request, optionsopt) → {Promise}

Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata. After the operation completes, Operation.response contains DiagnoseClusterResults.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

clusterName string

Required. The cluster name.

options object <optional>

Call options. See CallOptions for more details.

getCluster(request, optionsopt) → {Promise}

Gets the resource representation for a cluster in a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

clusterName string

Required. The cluster name.

options object <optional>

Call options. See CallOptions for more details.

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.

initialize() → {Promise}

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.

listClusters(request, optionsopt) → {Promise}

Lists all regions/{region}/clusters in a project alphabetically.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

filter string <optional>

Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:

field = value [AND [field = value]] ...

where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

pageSize number <optional>

Optional. The standard List page size.

pageToken string <optional>

Optional. The standard List page token.

options object <optional>

Call options. See CallOptions for more details.

listClustersAsync(request, optionsopt) → {Object}

Equivalent to listClusters, but returns an iterable object.

for-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

filter string <optional>

Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:

field = value [AND [field = value]] ...

where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

pageSize number <optional>

Optional. The standard List page size.

pageToken string <optional>

Optional. The standard List page token.

options object <optional>

Call options. See CallOptions for more details.

listClustersStream(request, optionsopt) → {Stream}

Equivalent to listClusters, but returns a NodeJS Stream object.

This fetches the paged responses for listClusters 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
projectId string

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

filter string <optional>

Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:

field = value [AND [field = value]] ...

where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

pageSize number <optional>

Optional. The standard List page size.

pageToken string <optional>

Optional. The standard List page token.

options object <optional>

Call options. See CallOptions for more details.

See:

matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName) → {string}

Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource.

Parameters:
Name Type Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName) → {string}

Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource.

Parameters:
Name Type Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName) → {string}

Parse the location from ProjectLocationAutoscalingPolicy resource.

Parameters:
Name Type Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName) → {string}

Parse the location from ProjectLocationWorkflowTemplate resource.

Parameters:
Name Type Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName) → {string}

Parse the project from ProjectLocationAutoscalingPolicy resource.

Parameters:
Name Type Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName) → {string}

Parse the project from ProjectLocationWorkflowTemplate resource.

Parameters:
Name Type Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName) → {string}

Parse the project from ProjectRegionAutoscalingPolicy resource.

Parameters:
Name Type Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName) → {string}

Parse the project from ProjectRegionWorkflowTemplate resource.

Parameters:
Name Type Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName) → {string}

Parse the region from ProjectRegionAutoscalingPolicy resource.

Parameters:
Name Type Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName) → {string}

Parse the region from ProjectRegionWorkflowTemplate resource.

Parameters:
Name Type Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName) → {string}

Parse the workflow_template from ProjectLocationWorkflowTemplate resource.

Parameters:
Name Type Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName) → {string}

Parse the workflow_template from ProjectRegionWorkflowTemplate resource.

Parameters:
Name Type Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

projectLocationAutoscalingPolicyPath(project, location, autoscaling_policy) → {string}

Return a fully-qualified projectLocationAutoscalingPolicy resource name string.

Parameters:
Name Type Description
project string
location string
autoscaling_policy string

projectLocationWorkflowTemplatePath(project, location, workflow_template) → {string}

Return a fully-qualified projectLocationWorkflowTemplate resource name string.

Parameters:
Name Type Description
project string
location string
workflow_template string

projectRegionAutoscalingPolicyPath(project, region, autoscaling_policy) → {string}

Return a fully-qualified projectRegionAutoscalingPolicy resource name string.

Parameters:
Name Type Description
project string
region string
autoscaling_policy string

projectRegionWorkflowTemplatePath(project, region, workflow_template) → {string}

Return a fully-qualified projectRegionWorkflowTemplate resource name string.

Parameters:
Name Type Description
project string
region string
workflow_template string

updateCluster(request, optionsopt) → {Promise}

Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
projectId string

Required. The ID of the Google Cloud Platform project the cluster belongs to.

region string

Required. The Dataproc region in which to handle the request.

clusterName string

Required. The cluster name.

cluster google.cloud.dataproc.v1.Cluster

Required. The changes to the cluster.

gracefulDecommissionTimeout google.protobuf.Duration <optional>

Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day. (see JSON representation of Duration).

Only supported on Dataproc image versions 1.2 and higher.

updateMask google.protobuf.FieldMask

Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:

  {
    "config":{
      "workerConfig":{
        "numInstances":"5"
      }
    }
  }

Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:

  {
    "config":{
      "secondaryWorkerConfig":{
        "numInstances":"5"
      }
    }
  }

Note: Currently, only the following fields can be updated:

Mask Purpose
labels Update labels
config.worker_config.num_instances Resize primary worker group
config.secondary_worker_config.num_instances Resize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or change autoscaling policies
requestId string <optional>

Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.

It is recommended to always set this value to a UUID.

The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

options object <optional>

Call options. See CallOptions for more details.