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
Successful response
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. |
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. |
Successful response
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. |
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 | pageSize , pageToken , 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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}';
INSERT
examples
- projects_locations_sessions_create
- Manifest
Create an interactive session asynchronously.
INSERT INTO google.dataproc.sessions (
data__name,
data__jupyterSession,
data__sparkConnectSession,
data__labels,
data__runtimeConfig,
data__environmentConfig,
data__user,
data__sessionTemplate,
projectsId,
locationsId,
sessionId,
requestId
)
SELECT
'{{ name }}',
'{{ jupyterSession }}',
'{{ sparkConnectSession }}',
'{{ labels }}',
'{{ runtimeConfig }}',
'{{ environmentConfig }}',
'{{ user }}',
'{{ sessionTemplate }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ sessionId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: sessions
props:
- name: projectsId
value: string
description: Required parameter for the sessions resource.
- name: locationsId
value: string
description: Required parameter for the sessions resource.
- name: name
value: string
description: >
Identifier. The resource name of the session.
- name: jupyterSession
value: object
description: >
Optional. Jupyter session config.
- name: sparkConnectSession
value: object
description: >
Optional. Spark connect session config.
- name: labels
value: object
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: runtimeConfig
value: object
description: >
Optional. Runtime configuration for the session execution.
- name: environmentConfig
value: object
description: >
Optional. Environment configuration for the session execution.
- name: user
value: string
description: >
Optional. The email address of the user who owns the session.
- name: sessionTemplate
value: string
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: sessionId
value: string
- name: requestId
value: string
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 }}"
}';