sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | google.dataproc.sessions |
Fields
The following fields are returned by SELECT queries:
- projects_locations_sessions_get
- projects_locations_sessions_list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the session. |
createTime | string (google-datetime) | Output only. The time when the session was created. |
creator | string | Output only. The email address of the user who created the session. |
environmentConfig | object | Optional. Environment configuration for the session execution. (id: EnvironmentConfig) |
jupyterSession | object | Optional. Jupyter session config. (id: JupyterConfig) |
labels | object | 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. |
runtimeConfig | object | Optional. Runtime configuration for the session execution. (id: RuntimeConfig) |
runtimeInfo | object | Output only. Runtime information about session execution. (id: RuntimeInfo) |
sessionTemplate | string | Optional. The session template used by the session.Only resource names, including project ID and location, are valid.Example: * https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id] * projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]The template must be in the same project and Dataproc region as the session. |
sparkConnectSession | object | Optional. Spark connect session config. (id: SparkConnectConfig) |
state | string | Output only. A state of the session. (STATE_UNSPECIFIED, CREATING, ACTIVE, TERMINATING, TERMINATED, FAILED) |
stateHistory | array | Output only. Historical state information for the session. |
stateMessage | string | Output only. Session state details, such as the failure description if the state is FAILED. |
stateTime | string (google-datetime) | Output only. The time when the session entered the current state. |
user | string | Optional. The email address of the user who owns the session. |
uuid | string | Output only. A session UUID (Unique Universal Identifier). The service generates this value when it creates the session. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the session. |
createTime | string (google-datetime) | Output only. The time when the session was created. |
creator | string | Output only. The email address of the user who created the session. |
environmentConfig | object | Optional. Environment configuration for the session execution. (id: EnvironmentConfig) |
jupyterSession | object | Optional. Jupyter session config. (id: JupyterConfig) |
labels | object | 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. |
runtimeConfig | object | Optional. Runtime configuration for the session execution. (id: RuntimeConfig) |
runtimeInfo | object | Output only. Runtime information about session execution. (id: RuntimeInfo) |
sessionTemplate | string | Optional. The session template used by the session.Only resource names, including project ID and location, are valid.Example: * https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id] * projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]The template must be in the same project and Dataproc region as the session. |
sparkConnectSession | object | Optional. Spark connect session config. (id: SparkConnectConfig) |
state | string | Output only. A state of the session. (STATE_UNSPECIFIED, CREATING, ACTIVE, TERMINATING, TERMINATED, FAILED) |
stateHistory | array | Output only. Historical state information for the session. |
stateMessage | string | Output only. Session state details, such as the failure description if the state is FAILED. |
stateTime | string (google-datetime) | Output only. The time when the session entered the current state. |
user | string | Optional. The email address of the user who owns the session. |
uuid | string | Output only. A session UUID (Unique Universal Identifier). The service generates this value when it creates the session. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_sessions_get | select | projectsId, locationsId, sessionsId | Gets the resource representation for an interactive session. | |
projects_locations_sessions_list | select | projectsId, locationsId | pageToken, pageSize, filter | Lists interactive sessions. |
projects_locations_sessions_create | insert | projectsId, locationsId | sessionId, requestId | Create an interactive session asynchronously. |
projects_locations_sessions_delete | delete | projectsId, locationsId, sessionsId | requestId | Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted. |
projects_locations_sessions_terminate | exec | projectsId, locationsId, sessionsId | Terminates the interactive session. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
locationsId | string | |
projectsId | string | |
sessionsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
sessionId | string |
SELECT examples
- projects_locations_sessions_get
- projects_locations_sessions_list
Gets the resource representation for an interactive session.
SELECT
name,
createTime,
creator,
environmentConfig,
jupyterSession,
labels,
runtimeConfig,
runtimeInfo,
sessionTemplate,
sparkConnectSession,
state,
stateHistory,
stateMessage,
stateTime,
user,
uuid
FROM google.dataproc.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND sessionsId = '{{ sessionsId }}' -- required
;
Lists interactive sessions.
SELECT
name,
createTime,
creator,
environmentConfig,
jupyterSession,
labels,
runtimeConfig,
runtimeInfo,
sessionTemplate,
sparkConnectSession,
state,
stateHistory,
stateMessage,
stateTime,
user,
uuid
FROM google.dataproc.sessions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
;
INSERT examples
- projects_locations_sessions_create
- Manifest
Create an interactive session asynchronously.
INSERT INTO google.dataproc.sessions (
data__user,
data__jupyterSession,
data__name,
data__runtimeConfig,
data__environmentConfig,
data__sparkConnectSession,
data__sessionTemplate,
data__labels,
projectsId,
locationsId,
sessionId,
requestId
)
SELECT
'{{ user }}',
'{{ jupyterSession }}',
'{{ name }}',
'{{ runtimeConfig }}',
'{{ environmentConfig }}',
'{{ sparkConnectSession }}',
'{{ sessionTemplate }}',
'{{ labels }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ sessionId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: sessions
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the sessions resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the sessions resource.
- name: user
value: "{{ user }}"
description: |
Optional. The email address of the user who owns the session.
- name: jupyterSession
description: |
Optional. Jupyter session config.
value:
displayName: "{{ displayName }}"
kernel: "{{ kernel }}"
- name: name
value: "{{ name }}"
description: |
Identifier. The resource name of the session.
- name: runtimeConfig
description: |
Optional. Runtime configuration for the session execution.
value:
properties: "{{ properties }}"
version: "{{ version }}"
repositoryConfig:
pypiRepositoryConfig:
pypiRepository: "{{ pypiRepository }}"
autotuningConfig:
scenarios:
- "{{ scenarios }}"
containerImage: "{{ containerImage }}"
cohort: "{{ cohort }}"
- name: environmentConfig
description: |
Optional. Environment configuration for the session execution.
value:
peripheralsConfig:
metastoreService: "{{ metastoreService }}"
sparkHistoryServerConfig:
dataprocCluster: "{{ dataprocCluster }}"
executionConfig:
idleTtl: "{{ idleTtl }}"
authenticationConfig:
userWorkloadAuthenticationType: "{{ userWorkloadAuthenticationType }}"
subnetworkUri: "{{ subnetworkUri }}"
kmsKey: "{{ kmsKey }}"
networkTags:
- "{{ networkTags }}"
ttl: "{{ ttl }}"
serviceAccount: "{{ serviceAccount }}"
networkUri: "{{ networkUri }}"
resourceManagerTags: "{{ resourceManagerTags }}"
stagingBucket: "{{ stagingBucket }}"
- name: sparkConnectSession
value: "{{ sparkConnectSession }}"
description: |
Optional. Spark connect session config.
- name: sessionTemplate
value: "{{ sessionTemplate }}"
description: |
Optional. The session template used by the session.Only resource names, including project ID and location, are valid.Example: * https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id] * projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]The template must be in the same project and Dataproc region as the session.
- name: labels
value: "{{ labels }}"
description: |
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.
- name: sessionId
value: "{{ sessionId }}"
- name: requestId
value: "{{ requestId }}"
DELETE examples
- projects_locations_sessions_delete
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
DELETE FROM google.dataproc.sessions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND sessionsId = '{{ sessionsId }}' --required
AND requestId = '{{ requestId }}'
;
Lifecycle Methods
- projects_locations_sessions_terminate
Terminates the interactive session.
EXEC google.dataproc.sessions.projects_locations_sessions_terminate
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@sessionsId='{{ sessionsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}"
}'
;