repositories
Creates, updates, deletes, gets or lists a repositories
resource.
Overview
Name | repositories |
Type | Resource |
Id | google.dataform.repositories |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The repository's name. |
createTime | string | Output only. The timestamp of when the repository was created. |
dataEncryptionState | object | Describes encryption state of a resource. |
displayName | string | Optional. The repository's user-friendly name. |
gitRemoteSettings | object | Controls Git remote configuration for a repository. |
kmsKeyName | string | Optional. 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] |
labels | object | Optional. Repository user labels. |
npmrcEnvironmentVariablesSecretVersion | string | Optional. 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. |
serviceAccount | string | Optional. The service account to run workflow invocations under. |
setAuthenticatedUserAdmin | boolean | Optional. 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 |
workspaceCompilationOverrides | object | Configures 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | locationsId, projectsId, repositoriesId | Fetches a single Repository. |
list | SELECT | locationsId, projectsId | Lists Repositories in a given project and location. |
query_directory_contents | SELECT | locationsId, projectsId, repositoriesId | Returns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url . |
create | INSERT | locationsId, projectsId | Creates a new Repository in a given project and location. |
delete | DELETE | locationsId, projectsId, repositoriesId | Deletes a single Repository. |
patch | UPDATE | locationsId, projectsId, repositoriesId | Updates a single Repository. |
commit | EXEC | locationsId, projectsId, repositoriesId | Applies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url . |
compute_access_token_status | EXEC | locationsId, projectsId, repositoriesId | Computes a Repository's Git access token status. |
read_file | EXEC | locationsId, projectsId, repositoriesId | Returns 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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: createTime
value: string
- name: displayName
value: string
- name: gitRemoteSettings
value:
- name: url
value: string
- name: defaultBranch
value: string
- name: authenticationTokenSecretVersion
value: string
- name: sshAuthenticationConfig
value:
- name: userPrivateKeySecretVersion
value: string
- name: hostPublicKey
value: string
- name: tokenStatus
value: string
- name: npmrcEnvironmentVariablesSecretVersion
value: string
- name: workspaceCompilationOverrides
value:
- name: defaultDatabase
value: string
- name: schemaSuffix
value: string
- name: tablePrefix
value: string
- name: labels
value: object
- name: setAuthenticatedUserAdmin
value: boolean
- name: serviceAccount
value: string
- name: kmsKeyName
value: string
- name: dataEncryptionState
value:
- name: kmsKeyVersionName
value: string
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 }}';