Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Idgoogle.dataform.repositories

Fields

NameDatatypeDescription
namestringIdentifier. The repository's name.
createTimestringOutput only. The timestamp of when the repository was created.
dataEncryptionStateobjectDescribes encryption state of a resource.
displayNamestringOptional. The repository's user-friendly name.
gitRemoteSettingsobjectControls Git remote configuration for a repository.
kmsKeyNamestringOptional. The reference to a KMS encryption key. If provided, it will be used to encrypt user data in the repository and all child resources. It is not possible to add or update the encryption key after the repository is created. Example: projects/[kms_project_id]/locations/[region]/keyRings/[key_region]/cryptoKeys/[key]
labelsobjectOptional. Repository user labels.
npmrcEnvironmentVariablesSecretVersionstringOptional. The name of the Secret Manager secret version to be used to interpolate variables into the .npmrc file for package installation operations. Must be in the format projects/*/secrets/*/versions/*. The file itself must be in a JSON format.
serviceAccountstringOptional. The service account to run workflow invocations under.
setAuthenticatedUserAdminbooleanOptional. Input only. If set to true, the authenticated user will be granted the roles/dataform.admin role on the created repository. To modify access to the created repository later apply setIamPolicy from https://cloud.google.com/dataform/reference/rest#rest-resource:-v1beta1.projects.locations.repositories
workspaceCompilationOverridesobjectConfigures workspace compilation overrides for a repository. Primarily used by the UI (console.cloud.google.com). schema_suffix and table_prefix can have a special expression - ${workspaceName}, which refers to the workspace name from which the compilation results will be created. API callers are expected to resolve the expression in these overrides and provide them explicitly in code_compilation_config (https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories.compilationResults#codecompilationconfig) when creating workspace-scoped compilation results.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, repositoriesIdFetches a single Repository.
listSELECTlocationsId, projectsIdLists Repositories in a given project and location.
query_directory_contentsSELECTlocationsId, projectsId, repositoriesIdReturns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url.
createINSERTlocationsId, projectsIdCreates a new Repository in a given project and location.
deleteDELETElocationsId, projectsId, repositoriesIdDeletes a single Repository.
patchUPDATElocationsId, projectsId, repositoriesIdUpdates a single Repository.
commitEXEClocationsId, projectsId, repositoriesIdApplies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url.
compute_access_token_statusEXEClocationsId, projectsId, repositoriesIdComputes a Repository's Git access token status.
read_fileEXEClocationsId, projectsId, repositoriesIdReturns the contents of a file (inside a Repository). The Repository must not have a value for git_remote_settings.url.

SELECT examples

Lists Repositories in a given project and location.

SELECT
name,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
workspaceCompilationOverrides
FROM google.dataform.repositories
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.dataform.repositories (
locationsId,
projectsId,
name,
displayName,
gitRemoteSettings,
npmrcEnvironmentVariablesSecretVersion,
workspaceCompilationOverrides,
labels,
setAuthenticatedUserAdmin,
serviceAccount,
kmsKeyName
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ displayName }}',
'{{ gitRemoteSettings }}',
'{{ npmrcEnvironmentVariablesSecretVersion }}',
'{{ workspaceCompilationOverrides }}',
'{{ labels }}',
{{ setAuthenticatedUserAdmin }},
'{{ serviceAccount }}',
'{{ kmsKeyName }}'
;

UPDATE example

Updates a repositories resource.

/*+ update */
UPDATE google.dataform.repositories
SET
name = '{{ name }}',
displayName = '{{ displayName }}',
gitRemoteSettings = '{{ gitRemoteSettings }}',
npmrcEnvironmentVariablesSecretVersion = '{{ npmrcEnvironmentVariablesSecretVersion }}',
workspaceCompilationOverrides = '{{ workspaceCompilationOverrides }}',
labels = '{{ labels }}',
setAuthenticatedUserAdmin = true|false,
serviceAccount = '{{ serviceAccount }}',
kmsKeyName = '{{ kmsKeyName }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';

DELETE example

Deletes the specified repositories resource.

/*+ delete */
DELETE FROM google.dataform.repositories
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';