Skip to main content

sessions

Creates, updates, deletes, gets or lists a sessions resource.

Overview

Namesessions
TypeResource
Idgoogle.dataproc.sessions

Fields

NameDatatypeDescription
namestringRequired. The resource name of the session.
createTimestringOutput only. The time when the session was created.
creatorstringOutput only. The email address of the user who created the session.
environmentConfigobjectEnvironment configuration for a workload.
jupyterSessionobjectJupyter configuration for an interactive session.
labelsobjectOptional. 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.
runtimeConfigobjectRuntime configuration for a workload.
runtimeInfoobjectRuntime information about workload execution.
sessionTemplatestringOptional. 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.
sparkConnectSessionobjectSpark connect configuration for an interactive session.
statestringOutput only. A state of the session.
stateHistoryarrayOutput only. Historical state information for the session.
stateMessagestringOutput only. Session state details, such as the failure description if the state is FAILED.
stateTimestringOutput only. The time when the session entered the current state.
userstringOptional. The email address of the user who owns the session.
uuidstringOutput only. A session UUID (Unique Universal Identifier). The service generates this value when it creates the session.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_sessions_getSELECTlocationsId, projectsId, sessionsIdGets the resource representation for an interactive session.
projects_locations_sessions_listSELECTlocationsId, projectsIdLists interactive sessions.
projects_locations_sessions_createINSERTlocationsId, projectsIdCreate an interactive session asynchronously.
projects_locations_sessions_deleteDELETElocationsId, projectsId, sessionsIdDeletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
projects_locations_sessions_terminateEXEClocationsId, projectsId, sessionsIdTerminates the interactive session.

SELECT examples

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 locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new sessions resource.

/*+ create */
INSERT INTO google.dataproc.sessions (
locationsId,
projectsId,
name,
jupyterSession,
sparkConnectSession,
labels,
runtimeConfig,
environmentConfig,
user,
sessionTemplate
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ jupyterSession }}',
'{{ sparkConnectSession }}',
'{{ labels }}',
'{{ runtimeConfig }}',
'{{ environmentConfig }}',
'{{ user }}',
'{{ sessionTemplate }}'
;

DELETE example

Deletes the specified sessions resource.

/*+ delete */
DELETE FROM google.dataproc.sessions
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND sessionsId = '{{ sessionsId }}';