Skip to main content

workspaces

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

Overview

Nameworkspaces
TypeResource
Idgoogle.dataform.workspaces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The workspace's name.
createTimestring (google-datetime)Output only. The timestamp of when the workspace was created.
dataEncryptionStateobjectOutput only. A data encryption state of a Git repository if this Workspace is protected by a KMS key. (id: DataEncryptionState)
internalMetadatastringOutput only. All the metadata information that is used internally to serve the resource. For example: timestamps, flags, status fields, etc. The format of this field is a JSON string.
privateResourceMetadataobjectOutput only. Metadata indicating whether this resource is user-scoped. For Workspace resources, the user_scoped field is always true. (id: PrivateResourceMetadata)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, repositoriesId, workspacesIdFetches a single Workspace.
query_directory_contentsselectprojectsId, locationsId, repositoriesId, workspacesIdpageToken, path, pageSizeReturns the contents of a given Workspace directory.
listselectprojectsId, locationsId, repositoriesIdpageToken, filter, orderBy, pageSizeLists Workspaces in a given Repository.
createinsertprojectsId, locationsId, repositoriesIdworkspaceIdCreates a new Workspace in a given Repository.
deletedeleteprojectsId, locationsId, repositoriesId, workspacesIdDeletes a single Workspace.
resetexecprojectsId, locationsId, repositoriesId, workspacesIdPerforms a Git reset for uncommitted files in a Workspace.
install_npm_packagesexecprojectsId, locationsId, repositoriesId, workspacesIdInstalls dependency NPM packages (inside a Workspace).
remove_directoryexecprojectsId, locationsId, repositoriesId, workspacesIdDeletes a directory (inside a Workspace) and all of its contents.
remove_fileexecprojectsId, locationsId, repositoriesId, workspacesIdDeletes a file (inside a Workspace).
make_directoryexecprojectsId, locationsId, repositoriesId, workspacesIdCreates a directory inside a Workspace.
write_fileexecprojectsId, locationsId, repositoriesId, workspacesIdWrites to a file (inside a Workspace).
search_filesexecprojectsId, locationsId, repositoriesId, workspacesIdpageToken, filter, pageSizeFinds the contents of a given Workspace directory by filter.
move_directoryexecprojectsId, locationsId, repositoriesId, workspacesIdMoves a directory (inside a Workspace), and all of its contents, to a new location.
move_fileexecprojectsId, locationsId, repositoriesId, workspacesIdMoves a file (inside a Workspace) to a new location.
read_fileexecprojectsId, locationsId, repositoriesId, workspacesIdrevision, pathReturns the contents of a file (inside a Workspace).
pushexecprojectsId, locationsId, repositoriesId, workspacesIdPushes Git commits from a Workspace to the Repository's remote.
pullexecprojectsId, locationsId, repositoriesId, workspacesIdPulls Git commits from the Repository's remote into a Workspace.
commitexecprojectsId, locationsId, repositoriesId, workspacesIdApplies a Git commit for uncommitted files in a Workspace.

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.

NameDatatypeDescription
locationsIdstring
projectsIdstring
repositoriesIdstring
workspacesIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
pathstring
revisionstring
workspaceIdstring

SELECT examples

Fetches a single Workspace.

SELECT
name,
createTime,
dataEncryptionState,
internalMetadata,
privateResourceMetadata
FROM google.dataform.workspaces
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND workspacesId = '{{ workspacesId }}' -- required
;

INSERT examples

Creates a new Workspace in a given Repository.

INSERT INTO google.dataform.workspaces (
data__name,
projectsId,
locationsId,
repositoriesId,
workspaceId
)
SELECT
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoriesId }}',
'{{ workspaceId }}'
RETURNING
name,
createTime,
dataEncryptionState,
internalMetadata,
privateResourceMetadata
;

DELETE examples

Deletes a single Workspace.

DELETE FROM google.dataform.workspaces
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND workspacesId = '{{ workspacesId }}' --required
;

Lifecycle Methods

Performs a Git reset for uncommitted files in a Workspace.

EXEC google.dataform.workspaces.reset 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"paths": "{{ paths }}",
"clean": {{ clean }}
}'
;