Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Idgoogle.dataform.repositories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
directoryEntriesarrayList of entries in the directory.
nextPageTokenstringA token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
query_directory_contentsselectprojectsId, locationsId, repositoriesIdcommitSha, path, pageToken, pageSizeReturns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url.
getselectprojectsId, locationsId, repositoriesIdFetches a single Repository.
listselectprojectsId, locationsIdorderBy, filter, pageToken, pageSizeLists Repositories in a given project and location. Note: This method can return repositories not shown in the Dataform UI.
createinsertprojectsId, locationsIdrepositoryIdCreates a new Repository in a given project and location.
patchupdateprojectsId, locationsId, repositoriesIdupdateMaskUpdates a single Repository. Note: This method does not fully implement AIP/134. The wildcard entry (*) is treated as a bad request, and when the field_mask is omitted, the request is treated as a full update on all modifiable fields.
deletedeleteprojectsId, locationsId, repositoriesIdforceDeletes a single Repository.
compute_access_token_statusexecprojectsId, locationsId, repositoriesIdComputes a Repository's Git access token status.
moveexecprojectsId, locationsId, repositoriesIdMoves a Repository to a new location.
read_fileexecprojectsId, locationsId, repositoriesIdcommitSha, pathReturns the contents of a file (inside a Repository). The Repository must not have a value for git_remote_settings.url.
commitexecprojectsId, locationsId, repositoriesIdApplies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url.

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
commitShastring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
pathstring
repositoryIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Returns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url.

SELECT
directoryEntries,
nextPageToken
FROM google.dataform.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND commitSha = '{{ commitSha }}'
AND path = '{{ path }}'
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;

INSERT examples

Creates a new Repository in a given project and location.

INSERT INTO google.dataform.repositories (
data__displayName,
data__containingFolder,
data__npmrcEnvironmentVariablesSecretVersion,
data__workspaceCompilationOverrides,
data__kmsKeyName,
data__name,
data__gitRemoteSettings,
data__labels,
data__serviceAccount,
data__setAuthenticatedUserAdmin,
projectsId,
locationsId,
repositoryId
)
SELECT
'{{ displayName }}',
'{{ containingFolder }}',
'{{ npmrcEnvironmentVariablesSecretVersion }}',
'{{ workspaceCompilationOverrides }}',
'{{ kmsKeyName }}',
'{{ name }}',
'{{ gitRemoteSettings }}',
'{{ labels }}',
'{{ serviceAccount }}',
{{ setAuthenticatedUserAdmin }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoryId }}'
RETURNING
name,
containingFolder,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
teamFolderName,
workspaceCompilationOverrides
;

UPDATE examples

Updates a single Repository. Note: This method does not fully implement AIP/134. The wildcard entry (*) is treated as a bad request, and when the field_mask is omitted, the request is treated as a full update on all modifiable fields.

UPDATE google.dataform.repositories
SET
data__displayName = '{{ displayName }}',
data__containingFolder = '{{ containingFolder }}',
data__npmrcEnvironmentVariablesSecretVersion = '{{ npmrcEnvironmentVariablesSecretVersion }}',
data__workspaceCompilationOverrides = '{{ workspaceCompilationOverrides }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__name = '{{ name }}',
data__gitRemoteSettings = '{{ gitRemoteSettings }}',
data__labels = '{{ labels }}',
data__serviceAccount = '{{ serviceAccount }}',
data__setAuthenticatedUserAdmin = {{ setAuthenticatedUserAdmin }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
containingFolder,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
teamFolderName,
workspaceCompilationOverrides;

DELETE examples

Deletes a single Repository.

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

Lifecycle Methods

Computes a Repository's Git access token status.

EXEC google.dataform.repositories.compute_access_token_status
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
;