Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview

Nameclusters
TypeResource
Idgoogle.dataproc.clusters

Fields

NameDatatypeDescription
clusterNamestringRequired. The cluster name, which must be unique within a project. The name must start with a lowercase letter, and can contain up to 51 lowercase letters, numbers, and hyphens. It cannot end with a hyphen. The name of a deleted cluster can be reused.
clusterUuidstringOutput only. A cluster UUID (Unique Universal Identifier). Dataproc generates this value when it creates the cluster.
configobjectThe cluster config.
labelsobjectOptional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster.
metricsobjectContains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release.
projectIdstringRequired. The Google Cloud Platform project ID that the cluster belongs to.
statusobjectThe status of a cluster and its instances.
statusHistoryarrayOutput only. The previous cluster status.
virtualClusterConfigobjectThe Dataproc cluster config for a cluster that does not directly control the underlying compute resources, such as a Dataproc-on-GKE cluster (https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).

Methods

NameAccessible byRequired ParamsDescription
projects_regions_clusters_getSELECTclusterName, projectId, regionGets the resource representation for a cluster in a project.
projects_regions_clusters_listSELECTprojectId, regionLists all regions/{region}/clusters in a project alphabetically.
projects_regions_clusters_createINSERTprojectId, regionCreates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
projects_regions_clusters_deleteDELETEclusterName, projectId, regionDeletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
projects_regions_clusters_patchUPDATEclusterName, projectId, regionUpdates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). The cluster must be in a RUNNING state or an error is returned.
projects_regions_clusters_diagnoseEXECclusterName, projectId, regionGets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
projects_regions_clusters_inject_credentialsEXECclustersId, projectsId, regionsIdInject encrypted credentials into all of the VMs in a cluster.The target cluster must be a personal auth cluster assigned to the user who is issuing the RPC.
projects_regions_clusters_repairEXECclusterName, projectId, regionRepairs a cluster.
projects_regions_clusters_startEXECclusterName, projectId, regionStarts a cluster in a project.
projects_regions_clusters_stopEXECclusterName, projectId, regionStops a cluster in a project.

SELECT examples

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

SELECT
clusterName,
clusterUuid,
config,
labels,
metrics,
projectId,
status,
statusHistory,
virtualClusterConfig
FROM google.dataproc.clusters
WHERE projectId = '{{ projectId }}'
AND region = '{{ region }}';

INSERT example

Use the following StackQL query and manifest file to create a new clusters resource.

/*+ create */
INSERT INTO google.dataproc.clusters (
projectId,
region,
projectId,
clusterName,
config,
virtualClusterConfig,
labels
)
SELECT
'{{ projectId }}',
'{{ region }}',
'{{ projectId }}',
'{{ clusterName }}',
'{{ config }}',
'{{ virtualClusterConfig }}',
'{{ labels }}'
;

UPDATE example

Updates a clusters resource.

/*+ update */
UPDATE google.dataproc.clusters
SET
projectId = '{{ projectId }}',
clusterName = '{{ clusterName }}',
config = '{{ config }}',
virtualClusterConfig = '{{ virtualClusterConfig }}',
labels = '{{ labels }}'
WHERE
clusterName = '{{ clusterName }}'
AND projectId = '{{ projectId }}'
AND region = '{{ region }}';

DELETE example

Deletes the specified clusters resource.

/*+ delete */
DELETE FROM google.dataproc.clusters
WHERE clusterName = '{{ clusterName }}'
AND projectId = '{{ projectId }}'
AND region = '{{ region }}';