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:

Successful response

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.

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, workspacesIdpath, pageSize, pageTokenReturns the contents of a given Workspace directory.
listselectprojectsId, locationsId, repositoriesIdpageSize, pageToken, orderBy, filterLists Workspaces in a given Repository.
createinsertprojectsId, locationsId, repositoriesIdworkspaceIdCreates a new Workspace in a given Repository.
deletedeleteprojectsId, locationsId, repositoriesId, workspacesIdDeletes a single Workspace.
install_npm_packagesexecprojectsId, locationsId, repositoriesId, workspacesIdInstalls dependency NPM packages (inside a Workspace).
pullexecprojectsId, locationsId, repositoriesId, workspacesIdPulls Git commits from the Repository's remote into a Workspace.
pushexecprojectsId, locationsId, repositoriesId, workspacesIdPushes Git commits from a Workspace to the Repository's remote.
commitexecprojectsId, locationsId, repositoriesId, workspacesIdApplies a Git commit for uncommitted files in a Workspace.
resetexecprojectsId, locationsId, repositoriesId, workspacesIdPerforms a Git reset for uncommitted files in a Workspace.
search_filesexecprojectsId, locationsId, repositoriesId, workspacesIdpageSize, pageToken, filterFinds the contents of a given Workspace directory by filter.
make_directoryexecprojectsId, locationsId, repositoriesId, workspacesIdCreates a directory inside a Workspace.
remove_directoryexecprojectsId, locationsId, repositoriesId, workspacesIdDeletes a directory (inside a Workspace) and all of its contents.
move_directoryexecprojectsId, locationsId, repositoriesId, workspacesIdMoves a directory (inside a Workspace), and all of its contents, to a new location.
read_fileexecprojectsId, locationsId, repositoriesId, workspacesIdpath, revisionReturns the contents of a file (inside a Workspace).
remove_fileexecprojectsId, locationsId, repositoriesId, workspacesIdDeletes a file (inside a Workspace).
move_fileexecprojectsId, locationsId, repositoriesId, workspacesIdMoves a file (inside a Workspace) to a new location.
write_fileexecprojectsId, locationsId, repositoriesId, workspacesIdWrites to a file (inside 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
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
;

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

Installs dependency NPM packages (inside a Workspace).

EXEC google.dataform.workspaces.install_npm_packages 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required;