Reference documentation and code samples for the Google Cloud Dataproc V1 Client class Cluster.
Describes the identifying information, config, and status of
a Dataproc cluster
Generated from protobuf messagegoogle.cloud.dataproc.v1.Cluster
Namespace
Google \ Cloud \ Dataproc \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ project_id
string
Required. The Google Cloud Platform project ID that the cluster belongs to.
↳ cluster_name
string
Required. 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.
Optional. The cluster config for a cluster of Compute Engine Instances. Note that Dataproc may set default values, and values may change when clusters are updated. Exactly one of ClusterConfig or VirtualClusterConfig must be specified.
Optional. The virtual cluster config is used when creating a Dataproc cluster that does not directly control the underlying compute resources, for example, when creating aDataproc-on-GKE cluster. Dataproc may set default values, and values may change when clusters are updated. Exactly one ofconfigorvirtual_cluster_configmust be specified.
Optional. The labels to associate with this cluster. Labelkeysmust contain 1 to 63 characters, and must conform toRFC 1035. Labelvaluesmay be empty, but, if present, must contain 1 to 63 characters, and must conform toRFC 1035. No more than 32 labels can be associated with a cluster.
Output only. Contains 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.
getProjectId
Required. The Google Cloud Platform project ID that the cluster belongs to.
Returns
Type
Description
string
setProjectId
Required. The Google Cloud Platform project ID that the cluster belongs to.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getClusterName
Required. 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.
Returns
Type
Description
string
setClusterName
Required. 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.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getConfig
Optional. The cluster config for a cluster of Compute Engine Instances.
Note that Dataproc may set default values, and values may change
when clusters are updated.
Exactly one of ClusterConfig or VirtualClusterConfig must be specified.
Optional. The cluster config for a cluster of Compute Engine Instances.
Note that Dataproc may set default values, and values may change
when clusters are updated.
Exactly one of ClusterConfig or VirtualClusterConfig must be specified.
Optional. The virtual cluster config is used when creating a Dataproc
cluster that does not directly control the underlying compute resources,
for example, when creating aDataproc-on-GKE
cluster.
Dataproc may set default values, and values may change when
clusters are updated. Exactly one ofconfigorvirtual_cluster_configmust be specified.
Optional. The virtual cluster config is used when creating a Dataproc
cluster that does not directly control the underlying compute resources,
for example, when creating aDataproc-on-GKE
cluster.
Dataproc may set default values, and values may change when
clusters are updated. Exactly one ofconfigorvirtual_cluster_configmust be specified.
Optional. The labels to associate with this cluster.
Labelkeysmust contain 1 to 63 characters, and must conform toRFC 1035.
Labelvaluesmay be empty, but, if present, must contain 1 to 63
characters, and must conform toRFC
1035. No more than 32 labels can be
associated with a cluster.
Optional. The labels to associate with this cluster.
Labelkeysmust contain 1 to 63 characters, and must conform toRFC 1035.
Labelvaluesmay be empty, but, if present, must contain 1 to 63
characters, and must conform toRFC
1035. No more than 32 labels can be
associated with a cluster.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dataproc V1 Client - Class Cluster (3.14.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.14.0 (latest)](/php/docs/reference/cloud-dataproc/latest/V1.Cluster)\n- [3.13.4](/php/docs/reference/cloud-dataproc/3.13.4/V1.Cluster)\n- [3.12.0](/php/docs/reference/cloud-dataproc/3.12.0/V1.Cluster)\n- [3.11.0](/php/docs/reference/cloud-dataproc/3.11.0/V1.Cluster)\n- [3.10.1](/php/docs/reference/cloud-dataproc/3.10.1/V1.Cluster)\n- [3.9.0](/php/docs/reference/cloud-dataproc/3.9.0/V1.Cluster)\n- [3.8.1](/php/docs/reference/cloud-dataproc/3.8.1/V1.Cluster)\n- [3.7.1](/php/docs/reference/cloud-dataproc/3.7.1/V1.Cluster)\n- [3.6.1](/php/docs/reference/cloud-dataproc/3.6.1/V1.Cluster)\n- [3.5.1](/php/docs/reference/cloud-dataproc/3.5.1/V1.Cluster)\n- [3.4.0](/php/docs/reference/cloud-dataproc/3.4.0/V1.Cluster)\n- [3.3.0](/php/docs/reference/cloud-dataproc/3.3.0/V1.Cluster)\n- [3.2.2](/php/docs/reference/cloud-dataproc/3.2.2/V1.Cluster)\n- [2.6.1](/php/docs/reference/cloud-dataproc/2.6.1/V1.Cluster)\n- [2.5.0](/php/docs/reference/cloud-dataproc/2.5.0/V1.Cluster)\n- [2.3.0](/php/docs/reference/cloud-dataproc/2.3.0/V1.Cluster)\n- [2.2.3](/php/docs/reference/cloud-dataproc/2.2.3/V1.Cluster)\n- [2.1.0](/php/docs/reference/cloud-dataproc/2.1.0/V1.Cluster)\n- [2.0.0](/php/docs/reference/cloud-dataproc/2.0.0/V1.Cluster) \nReference documentation and code samples for the Google Cloud Dataproc V1 Client class Cluster.\n\nDescribes the identifying information, config, and status of\na Dataproc cluster\n\nGenerated from protobuf message `google.cloud.dataproc.v1.Cluster`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dataproc \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getProjectId\n\nRequired. The Google Cloud Platform project ID that the cluster belongs to.\n\n### setProjectId\n\nRequired. The Google Cloud Platform project ID that the cluster belongs to.\n\n### getClusterName\n\nRequired. The cluster name, which must be unique within a project.\n\nThe name must start with a lowercase letter, and can contain\nup to 51 lowercase letters, numbers, and hyphens. It cannot end\nwith a hyphen. The name of a deleted cluster can be reused.\n\n### setClusterName\n\nRequired. The cluster name, which must be unique within a project.\n\nThe name must start with a lowercase letter, and can contain\nup to 51 lowercase letters, numbers, and hyphens. It cannot end\nwith a hyphen. The name of a deleted cluster can be reused.\n\n### getConfig\n\nOptional. The cluster config for a cluster of Compute Engine Instances.\n\nNote that Dataproc may set default values, and values may change\nwhen clusters are updated.\nExactly one of ClusterConfig or VirtualClusterConfig must be specified.\n\n### hasConfig\n\n### clearConfig\n\n### setConfig\n\nOptional. The cluster config for a cluster of Compute Engine Instances.\n\nNote that Dataproc may set default values, and values may change\nwhen clusters are updated.\nExactly one of ClusterConfig or VirtualClusterConfig must be specified.\n\n### getVirtualClusterConfig\n\nOptional. The virtual cluster config is used when creating a Dataproc\ncluster that does not directly control the underlying compute resources,\nfor example, when creating a [Dataproc-on-GKE\ncluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).\n\nDataproc may set default values, and values may change when\nclusters are updated. Exactly one of\n[config](/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getConfig__) or\n[virtual_cluster_config](/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getVirtualClusterConfig__)\nmust be specified.\n\n### hasVirtualClusterConfig\n\n### clearVirtualClusterConfig\n\n### setVirtualClusterConfig\n\nOptional. The virtual cluster config is used when creating a Dataproc\ncluster that does not directly control the underlying compute resources,\nfor example, when creating a [Dataproc-on-GKE\ncluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).\n\nDataproc may set default values, and values may change when\nclusters are updated. Exactly one of\n[config](/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getConfig__) or\n[virtual_cluster_config](/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getVirtualClusterConfig__)\nmust be specified.\n\n### getLabels\n\nOptional. The labels to associate with this cluster.\n\nLabel **keys** must contain 1 to 63 characters, and must conform to\n[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).\nLabel **values** may be empty, but, if present, must contain 1 to 63\ncharacters, and must conform to [RFC\n1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be\nassociated with a cluster.\n\n### setLabels\n\nOptional. The labels to associate with this cluster.\n\nLabel **keys** must contain 1 to 63 characters, and must conform to\n[RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).\nLabel **values** may be empty, but, if present, must contain 1 to 63\ncharacters, and must conform to [RFC\n1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be\nassociated with a cluster.\n\n### getStatus\n\nOutput only. Cluster status.\n\n### hasStatus\n\n### clearStatus\n\n### setStatus\n\nOutput only. Cluster status.\n\n### getStatusHistory\n\nOutput only. The previous cluster status.\n\n### setStatusHistory\n\nOutput only. The previous cluster status.\n\n### getClusterUuid\n\nOutput only. A cluster UUID (Unique Universal Identifier). Dataproc\ngenerates this value when it creates the cluster.\n\n### setClusterUuid\n\nOutput only. A cluster UUID (Unique Universal Identifier). Dataproc\ngenerates this value when it creates the cluster.\n\n### getMetrics\n\nOutput only. Contains cluster daemon metrics such as HDFS and YARN stats.\n\n**Beta Feature**: This report is available for testing purposes only. It\nmay be changed before final release.\n\n### hasMetrics\n\n### clearMetrics\n\n### setMetrics\n\nOutput only. Contains cluster daemon metrics such as HDFS and YARN stats.\n\n**Beta Feature**: This report is available for testing purposes only. It\nmay be changed before final release."]]