# Google Cloud Dataproc V1 Client - Class Cluster (3.14.0)

3.14.0 (latest) 3.13.4 3.12.0 3.11.0 3.10.1 3.9.0 3.8.1 3.7.1 3.6.1 3.5.1 3.4.0 3.3.0 3.2.2 2.12.0 2.11.0 2.10.0 2.9.1 2.8.2 2.7.0 2.6.1 2.5.0 2.3.0 2.2.3 2.1.0 2.0.0 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 message `google.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. |
| `↳ config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterConfig` 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. |
| `↳ virtual_cluster_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.VirtualClusterConfig` 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 a [Dataproc-on-GKE cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). Dataproc may set default values, and values may change when clusters are updated. Exactly one of [config](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getConfig__) or [virtual_cluster_config](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getVirtualClusterConfig__) must be specified. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. 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. |
| `↳ status` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterStatus` Output only. Cluster status. |
| `↳ status_history` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterStatus>` Output only. The previous cluster status. |
| `↳ cluster_uuid` | `string` Output only. A cluster UUID (Unique Universal Identifier). Dataproc generates this value when it creates the cluster. |
| `↳ metrics` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterMetrics` 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterConfig|null` |   |

### hasConfig

### clearConfig

### setConfig

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVirtualClusterConfig

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 a [Dataproc-on-GKE
cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).

Dataproc may set default values, and values may change when
clusters are updated. Exactly one of
[config](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getConfig__) or
[virtual_cluster_config](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getVirtualClusterConfig__)
must be specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.VirtualClusterConfig|null` |   |

### hasVirtualClusterConfig

### clearVirtualClusterConfig

### setVirtualClusterConfig

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 a [Dataproc-on-GKE
cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).

Dataproc may set default values, and values may change when
clusters are updated. Exactly one of
[config](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getConfig__) or
[virtual_cluster_config](https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.Cluster#_Google_Cloud_Dataproc_V1_Cluster__getVirtualClusterConfig__)
must be specified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.VirtualClusterConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

Optional. 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Optional. 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatus

Output only. Cluster status.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterStatus|null` |   |

### hasStatus

### clearStatus

### setStatus

Output only. Cluster status.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterStatus` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStatusHistory

Output only. The previous cluster status.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setStatusHistory

Output only. The previous cluster status.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterStatus>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getClusterUuid

Output only. A cluster UUID (Unique Universal Identifier). Dataproc
generates this value when it creates the cluster.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setClusterUuid

Output only. A cluster UUID (Unique Universal Identifier). Dataproc
generates this value when it creates the cluster.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMetrics

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterMetrics|null` |   |

### hasMetrics

### clearMetrics

### setMetrics

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dataproc/latest/V1.ClusterMetrics` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |