workspaces
Creates, updates, deletes, gets or lists a workspaces
resource.
Overview
Name | workspaces |
Type | Resource |
Id | google.dataform.workspaces |
Fields
The following fields are returned by SELECT
queries:
- get
- query_directory_contents
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The workspace's name. |
createTime | string (google-datetime) | Output only. The timestamp of when the workspace was created. |
dataEncryptionState | object | Output only. A data encryption state of a Git repository if this Workspace is protected by a KMS key. (id: DataEncryptionState) |
internalMetadata | string | Output 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. |
Successful response
Name | Datatype | Description |
---|---|---|
directoryEntries | array | List of entries in the directory. |
nextPageToken | string | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The workspace's name. |
createTime | string (google-datetime) | Output only. The timestamp of when the workspace was created. |
dataEncryptionState | object | Output only. A data encryption state of a Git repository if this Workspace is protected by a KMS key. (id: DataEncryptionState) |
internalMetadata | string | Output 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , repositoriesId , workspacesId | Fetches a single Workspace. | |
query_directory_contents | select | projectsId , locationsId , repositoriesId , workspacesId | path , pageSize , pageToken | Returns the contents of a given Workspace directory. |
list | select | projectsId , locationsId , repositoriesId | pageSize , pageToken , orderBy , filter | Lists Workspaces in a given Repository. |
create | insert | projectsId , locationsId , repositoriesId | workspaceId | Creates a new Workspace in a given Repository. |
delete | delete | projectsId , locationsId , repositoriesId , workspacesId | Deletes a single Workspace. | |
install_npm_packages | exec | projectsId , locationsId , repositoriesId , workspacesId | Installs dependency NPM packages (inside a Workspace). | |
pull | exec | projectsId , locationsId , repositoriesId , workspacesId | Pulls Git commits from the Repository's remote into a Workspace. | |
push | exec | projectsId , locationsId , repositoriesId , workspacesId | Pushes Git commits from a Workspace to the Repository's remote. | |
commit | exec | projectsId , locationsId , repositoriesId , workspacesId | Applies a Git commit for uncommitted files in a Workspace. | |
reset | exec | projectsId , locationsId , repositoriesId , workspacesId | Performs a Git reset for uncommitted files in a Workspace. | |
search_files | exec | projectsId , locationsId , repositoriesId , workspacesId | pageSize , pageToken , filter | Finds the contents of a given Workspace directory by filter. |
make_directory | exec | projectsId , locationsId , repositoriesId , workspacesId | Creates a directory inside a Workspace. | |
remove_directory | exec | projectsId , locationsId , repositoriesId , workspacesId | Deletes a directory (inside a Workspace) and all of its contents. | |
move_directory | exec | projectsId , locationsId , repositoriesId , workspacesId | Moves a directory (inside a Workspace), and all of its contents, to a new location. | |
read_file | exec | projectsId , locationsId , repositoriesId , workspacesId | path , revision | Returns the contents of a file (inside a Workspace). |
remove_file | exec | projectsId , locationsId , repositoriesId , workspacesId | Deletes a file (inside a Workspace). | |
move_file | exec | projectsId , locationsId , repositoriesId , workspacesId | Moves a file (inside a Workspace) to a new location. | |
write_file | exec | projectsId , locationsId , repositoriesId , workspacesId | Writes 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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
repositoriesId | string | |
workspacesId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
path | string | |
revision | string | |
workspaceId | string |
SELECT
examples
- get
- query_directory_contents
- list
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;
Returns the contents of a given Workspace directory.
SELECT
directoryEntries,
nextPageToken
FROM google.dataform.workspaces
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND workspacesId = '{{ workspacesId }}' -- required
AND path = '{{ path }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
Lists Workspaces in a given Repository.
SELECT
name,
createTime,
dataEncryptionState,
internalMetadata
FROM google.dataform.workspaces
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: workspaces
props:
- name: projectsId
value: string
description: Required parameter for the workspaces resource.
- name: locationsId
value: string
description: Required parameter for the workspaces resource.
- name: repositoriesId
value: string
description: Required parameter for the workspaces resource.
- name: name
value: string
description: >
Identifier. The workspace's name.
- name: workspaceId
value: string
DELETE
examples
- delete
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
- install_npm_packages
- pull
- push
- commit
- reset
- search_files
- make_directory
- remove_directory
- move_directory
- read_file
- remove_file
- move_file
- write_file
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;
Pulls Git commits from the Repository's remote into a Workspace.
EXEC google.dataform.workspaces.pull
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"remoteBranch": "{{ remoteBranch }}",
"author": "{{ author }}"
}';
Pushes Git commits from a Workspace to the Repository's remote.
EXEC google.dataform.workspaces.push
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"remoteBranch": "{{ remoteBranch }}"
}';
Applies a Git commit for uncommitted files in a Workspace.
EXEC google.dataform.workspaces.commit
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"author": "{{ author }}",
"commitMessage": "{{ commitMessage }}",
"paths": "{{ paths }}"
}';
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 }}
}';
Finds the contents of a given Workspace directory by filter.
EXEC google.dataform.workspaces.search_files
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required,
@pageSize='{{ pageSize }}',
@pageToken='{{ pageToken }}',
@filter='{{ filter }}';
Creates a directory inside a Workspace.
EXEC google.dataform.workspaces.make_directory
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"path": "{{ path }}"
}';
Deletes a directory (inside a Workspace) and all of its contents.
EXEC google.dataform.workspaces.remove_directory
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"path": "{{ path }}"
}';
Moves a directory (inside a Workspace), and all of its contents, to a new location.
EXEC google.dataform.workspaces.move_directory
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"path": "{{ path }}",
"newPath": "{{ newPath }}"
}';
Returns the contents of a file (inside a Workspace).
EXEC google.dataform.workspaces.read_file
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required,
@path='{{ path }}',
@revision='{{ revision }}';
Deletes a file (inside a Workspace).
EXEC google.dataform.workspaces.remove_file
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"path": "{{ path }}"
}';
Moves a file (inside a Workspace) to a new location.
EXEC google.dataform.workspaces.move_file
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"path": "{{ path }}",
"newPath": "{{ newPath }}"
}';
Writes to a file (inside a Workspace).
EXEC google.dataform.workspaces.write_file
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@workspacesId='{{ workspacesId }}' --required
@@json=
'{
"path": "{{ path }}",
"contents": "{{ contents }}"
}';