- [Resource: Session](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#Session)
  - [JSON representation](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#Session.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#State)
- [SessionStateHistory](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#SessionStateHistory)
  - [JSON representation](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#SessionStateHistory.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#METHODS_SUMMARY)

## Resource: Session

A representation of a session.

| JSON representation |
|---|
| ``` { "name": string, "uuid": string, "createTime": string, "runtimeInfo": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/RuntimeInfo`) }, "state": enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#State`), "stateMessage": string, "stateTime": string, "creator": string, "labels": { string: string, ... }, "runtimeConfig": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/RuntimeConfig`) }, "environmentConfig": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/EnvironmentConfig`) }, "user": string, "stateHistory": [ { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#SessionStateHistory`) } ], "sessionTemplate": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "jupyterSession": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/JupyterConfig`) }, "sparkConnectSession": { object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/SparkConnectConfig`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of the session. |
| `uuid` | `string` Output only. A session UUID (Unique Universal Identifier). The service generates this value when it creates the session. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the session was created. 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"`. |
| `runtimeInfo` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/RuntimeInfo`)`` Output only. Runtime information about session execution. |
| `state` | ``enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#State`)`` Output only. A state of the session. |
| `stateMessage` | `string` Output only. Session state details, such as the failure description if the state is `FAILED`. |
| `stateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the session entered the current state. 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"`. |
| `creator` | `string` Output only. The email address of the user who created the session. |
| `labels` | `map (key: string, value: string)` Optional. The labels to associate with the session. 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 session. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `runtimeConfig` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/RuntimeConfig`)`` Optional. Runtime configuration for the session execution. |
| `environmentConfig` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/EnvironmentConfig`)`` Optional. Environment configuration for the session execution. |
| `user` | `string` Optional. The email address of the user who owns the session. |
| `stateHistory[]` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#SessionStateHistory`)`` Output only. Historical state information for the session. |
| `sessionTemplate` | `string` Optional. The session template used by the session. Resource names and short template IDs are valid. Examples: \* `projects/[projectId]/locations/[dataproc_region]/sessionTemplates/[template_id]` \* `[template_id]` The template must be in the same project and Dataproc region as the session. |
| The session configuration. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `jupyterSession` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/JupyterConfig`)`` Optional. Jupyter session config. |
| `sparkConnectSession` | ``object (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/SparkConnectConfig`)`` Optional. Spark connect session config. |
| End of mutually exclusive fields. ||

## State

The session state.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The session state is unknown. |
| `CREATING` | The session is created prior to running. |
| `ACTIVE` | The session is running. |
| `TERMINATING` | The session is terminating. |
| `TERMINATED` | The session is terminated successfully. |
| `FAILED` | The session is no longer running due to an error. |

## SessionStateHistory

Historical state information.

| JSON representation |
|---|
| ``` { "state": enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#State`), "stateMessage": string, "stateStartTime": string } ``` |

| Fields ||
|---|---|
| `state` | ``enum (`https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions#State`)`` Output only. The state of the session at this point in the session history. |
| `stateMessage` | `string` Output only. Details about the state at this point in the session history. |
| `stateStartTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when the session entered the historical state. 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"`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions/create` | Create an interactive session asynchronously. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions/delete` | Deletes the interactive session resource. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions/get` | Gets the resource representation for an interactive session. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions/list` | Lists interactive sessions. |
| ### `https://docs.cloud.google.com/managed-spark/docs/reference/rest/v1/projects.locations.sessions/terminate` | Terminates the interactive session. |