Skip to main content

workstations

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

Overview

Nameworkstations
TypeResource
Idgoogle.workstations.workstations

Fields

NameDatatypeDescription
namestringIdentifier. Full name of this workstation.
annotationsobjectOptional. Client-specified annotations.
createTimestringOutput only. Time when this workstation was created.
deleteTimestringOutput only. Time when this workstation was soft-deleted.
displayNamestringOptional. Human-readable name for this workstation.
envobjectOptional. Environment variables passed to the workstation container's entrypoint.
etagstringOptional. Checksum computed by the server. May be sent on update and delete requests to make sure that the client has an up-to-date value before proceeding.
hoststringOutput only. Host to which clients can send HTTPS traffic that will be received by the workstation. Authorized traffic will be received to the workstation as HTTP on port 80. To send traffic to a different port, clients may prefix the host with the destination port in the format {port}-{host}.
kmsKeystringOutput only. The name of the Google Cloud KMS encryption key used to encrypt this workstation. The KMS key can only be configured in the WorkstationConfig. The expected format is projects/*/locations/*/keyRings/*/cryptoKeys/*.
labelsobjectOptional. Labels that are applied to the workstation and that are also propagated to the underlying Compute Engine resources.
reconcilingbooleanOutput only. Indicates whether this workstation is currently being updated to match its intended state.
startTimestringOutput only. Time when this workstation was most recently successfully started, regardless of the workstation's initial state.
statestringOutput only. Current state of the workstation.
uidstringOutput only. A system-assigned unique identifier for this workstation.
updateTimestringOutput only. Time when this workstation was most recently updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, workstationClustersId, workstationConfigsId, workstationsIdReturns the requested workstation.
listSELECTlocationsId, projectsId, workstationClustersId, workstationConfigsIdReturns all Workstations using the specified workstation configuration.
createINSERTlocationsId, projectsId, workstationClustersId, workstationConfigsIdCreates a new workstation.
deleteDELETElocationsId, projectsId, workstationClustersId, workstationConfigsId, workstationsIdDeletes the specified workstation.
patchUPDATElocationsId, projectsId, workstationClustersId, workstationConfigsId, workstationsIdUpdates an existing workstation.
generate_access_tokenEXEClocationsId, projectsId, workstationClustersId, workstationConfigsId, workstationsIdReturns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation.
startEXEClocationsId, projectsId, workstationClustersId, workstationConfigsId, workstationsIdStarts running a workstation so that users can connect to it.
stopEXEClocationsId, projectsId, workstationClustersId, workstationConfigsId, workstationsIdStops running a workstation, reducing costs.

SELECT examples

Returns all Workstations using the specified workstation configuration.

SELECT
name,
annotations,
createTime,
deleteTime,
displayName,
env,
etag,
host,
kmsKey,
labels,
reconciling,
startTime,
state,
uid,
updateTime
FROM google.workstations.workstations
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND workstationClustersId = '{{ workstationClustersId }}'
AND workstationConfigsId = '{{ workstationConfigsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.workstations.workstations (
locationsId,
projectsId,
workstationClustersId,
workstationConfigsId,
name,
displayName,
annotations,
labels,
etag,
env
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ workstationClustersId }}',
'{{ workstationConfigsId }}',
'{{ name }}',
'{{ displayName }}',
'{{ annotations }}',
'{{ labels }}',
'{{ etag }}',
'{{ env }}'
;

UPDATE example

Updates a workstations resource.

/*+ update */
UPDATE google.workstations.workstations
SET
name = '{{ name }}',
displayName = '{{ displayName }}',
annotations = '{{ annotations }}',
labels = '{{ labels }}',
etag = '{{ etag }}',
env = '{{ env }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND workstationClustersId = '{{ workstationClustersId }}'
AND workstationConfigsId = '{{ workstationConfigsId }}'
AND workstationsId = '{{ workstationsId }}';

DELETE example

Deletes the specified workstations resource.

/*+ delete */
DELETE FROM google.workstations.workstations
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND workstationClustersId = '{{ workstationClustersId }}'
AND workstationConfigsId = '{{ workstationConfigsId }}'
AND workstationsId = '{{ workstationsId }}';