# Method: projects.regions.clusters.diagnose

- [HTTP request](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#body.aspect)
- [TarballAccess](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#TarballAccess)
- [Interval](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#Interval)
  - [JSON representation](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#Interval.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#try-it)

Gets cluster diagnostic information. The returned `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.operations#Operation.FIELDS.metadata` will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.operations#Operation.FIELDS.response` contains [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).

### HTTP request

`POST https://dataproc.googleapis.com/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `projectId` | `string` Required. The ID of the Google Cloud Platform project that the cluster belongs to. |
| `region` | `string` Required. The region in which to handle the request. |
| `clusterName` | `string` Required. The cluster name. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `clusterName`: - `dataproc.clusters.diagnose` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "tarballGcsDir": string, "tarballAccess": enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#TarballAccess`), "diagnosisInterval": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#Interval`) }, "jobs": [ string ], "yarnApplicationIds": [ string ] } ``` |

| Fields ||
|---|---|
| `tarballGcsDir` | `string` Optional. (Optional) The output Cloud Storage directory for the diagnostic tarball. If not specified, a task-specific directory in the cluster's staging bucket will be used. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `tarballGcsDir`: - `dataproc.clusters.diagnose` |
| `tarballAccess` | ``enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#TarballAccess`)`` Optional. (Optional) The access type to the diagnostic tarball. If not specified, falls back to default access of the bucket Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `tarballAccess`: - `dataproc.clusters.diagnose` |
| `diagnosisInterval` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.regions.clusters/diagnose#Interval`)`` Optional. Time interval in which diagnosis should be carried out on the cluster. |
| `jobs[]` | `string` Optional. Specifies a list of jobs on which diagnosis is to be performed. Format: projects/{project}/regions/{region}/jobs/{job} |
| `yarnApplicationIds[]` | `string` Optional. Specifies a list of yarn applications on which diagnosis is to be performed. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.operations#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/dataproc`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## TarballAccess

Defines who has access to the diagnostic tarball

| Enums ||
|---|---|
| `TARBALL_ACCESS_UNSPECIFIED` | Tarball Access unspecified. Falls back to default access of the bucket |
| `GOOGLE_CLOUD_SUPPORT` | Google Cloud Support group has read access to the diagnostic tarball |
| `GOOGLE_DATAPROC_DIAGNOSE` | The diagnose service account has read access to the diagnostic tarball |

## Interval

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).

The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

| JSON representation |
|---|
| ``` { "startTime": string, "endTime": string } ``` |

| Fields ||
|---|---|
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `endTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |