repositories
Creates, updates, deletes, gets or lists a repositories resource.
Overview
| Name | repositories |
| Type | Resource |
| Id | google.dataform.repositories |
Fields
The following fields are returned by SELECT queries:
- query_directory_contents
- get
- list
| 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. |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The repository's name. |
containingFolder | string | Optional. The name of the containing folder of the repository. The field is immutable and it can be modified via a MoveRepository operation. Format: projects/*/locations/*/folders/*. or projects/*/locations/*/teamFolders/*. |
createTime | string (google-datetime) | Output only. The timestamp of when the repository was created. |
dataEncryptionState | object | Output only. A data encryption state of a Git repository if this Repository is protected by a KMS key. (id: DataEncryptionState) |
displayName | string | Optional. The repository's user-friendly name. |
gitRemoteSettings | object | Optional. If set, configures this repository to be linked to a Git remote. (id: GitRemoteSettings) |
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. |
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}/locations/{location}/keyRings/{key_location}/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. |
teamFolderName | string | Output only. The resource name of the TeamFolder that this Repository is associated with. This should take the format: projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this is not set, the Repository is not associated with a TeamFolder. |
workspaceCompilationOverrides | object | Optional. If set, fields of workspace_compilation_overrides override the default compilation settings that are specified in dataform.json when creating workspace-scoped compilation results. See documentation for WorkspaceCompilationOverrides for more information. (id: WorkspaceCompilationOverrides) |
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The repository's name. |
containingFolder | string | Optional. The name of the containing folder of the repository. The field is immutable and it can be modified via a MoveRepository operation. Format: projects/*/locations/*/folders/*. or projects/*/locations/*/teamFolders/*. |
createTime | string (google-datetime) | Output only. The timestamp of when the repository was created. |
dataEncryptionState | object | Output only. A data encryption state of a Git repository if this Repository is protected by a KMS key. (id: DataEncryptionState) |
displayName | string | Optional. The repository's user-friendly name. |
gitRemoteSettings | object | Optional. If set, configures this repository to be linked to a Git remote. (id: GitRemoteSettings) |
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. |
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}/locations/{location}/keyRings/{key_location}/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. |
teamFolderName | string | Output only. The resource name of the TeamFolder that this Repository is associated with. This should take the format: projects/{project}/locations/{location}/teamFolders/{teamFolder}. If this is not set, the Repository is not associated with a TeamFolder. |
workspaceCompilationOverrides | object | Optional. If set, fields of workspace_compilation_overrides override the default compilation settings that are specified in dataform.json when creating workspace-scoped compilation results. See documentation for WorkspaceCompilationOverrides for more information. (id: WorkspaceCompilationOverrides) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
query_directory_contents | select | projectsId, locationsId, repositoriesId | commitSha, path, pageToken, pageSize | Returns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url. |
get | select | projectsId, locationsId, repositoriesId | Fetches a single Repository. | |
list | select | projectsId, locationsId | orderBy, filter, pageToken, pageSize | Lists Repositories in a given project and location. Note: This method can return repositories not shown in the Dataform UI. |
create | insert | projectsId, locationsId | repositoryId | Creates a new Repository in a given project and location. |
patch | update | projectsId, locationsId, repositoriesId | updateMask | 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. |
delete | delete | projectsId, locationsId, repositoriesId | force | Deletes a single Repository. |
compute_access_token_status | exec | projectsId, locationsId, repositoriesId | Computes a Repository's Git access token status. | |
move | exec | projectsId, locationsId, repositoriesId | Moves a Repository to a new location. | |
read_file | exec | projectsId, locationsId, repositoriesId | commitSha, path | Returns the contents of a file (inside a Repository). The Repository must not have a value for git_remote_settings.url. |
commit | exec | projectsId, locationsId, repositoriesId | Applies 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.
| Name | Datatype | Description |
|---|---|---|
locationsId | string | |
projectsId | string | |
repositoriesId | string | |
commitSha | string | |
filter | string | |
force | boolean | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
path | string | |
repositoryId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- query_directory_contents
- get
- list
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 }}'
;
Fetches a single Repository.
SELECT
name,
containingFolder,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
teamFolderName,
workspaceCompilationOverrides
FROM google.dataform.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
;
Lists Repositories in a given project and location. Note: This method can return repositories not shown in the Dataform UI.
SELECT
name,
containingFolder,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
teamFolderName,
workspaceCompilationOverrides
FROM google.dataform.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: repositories
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the repositories resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the repositories resource.
- name: displayName
value: "{{ displayName }}"
description: |
Optional. The repository's user-friendly name.
- name: containingFolder
value: "{{ containingFolder }}"
description: |
Optional. The name of the containing folder of the repository. The field is immutable and it can be modified via a MoveRepository operation. Format: `projects/*/locations/*/folders/*`. or `projects/*/locations/*/teamFolders/*`.
- name: npmrcEnvironmentVariablesSecretVersion
value: "{{ npmrcEnvironmentVariablesSecretVersion }}"
description: |
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.
- name: workspaceCompilationOverrides
description: |
Optional. If set, fields of `workspace_compilation_overrides` override the default compilation settings that are specified in dataform.json when creating workspace-scoped compilation results. See documentation for `WorkspaceCompilationOverrides` for more information.
value:
schemaSuffix: "{{ schemaSuffix }}"
defaultDatabase: "{{ defaultDatabase }}"
tablePrefix: "{{ tablePrefix }}"
- name: kmsKeyName
value: "{{ kmsKeyName }}"
description: |
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}/locations/{location}/keyRings/{key_location}/cryptoKeys/{key}`
- name: name
value: "{{ name }}"
description: |
Identifier. The repository's name.
- name: gitRemoteSettings
description: |
Optional. If set, configures this repository to be linked to a Git remote.
value:
defaultBranch: "{{ defaultBranch }}"
url: "{{ url }}"
effectiveDefaultBranch: "{{ effectiveDefaultBranch }}"
gitRepositoryLink: "{{ gitRepositoryLink }}"
tokenStatus: "{{ tokenStatus }}"
sshAuthenticationConfig:
userPrivateKeySecretVersion: "{{ userPrivateKeySecretVersion }}"
hostPublicKey: "{{ hostPublicKey }}"
authenticationTokenSecretVersion: "{{ authenticationTokenSecretVersion }}"
- name: labels
value: "{{ labels }}"
description: |
Optional. Repository user labels.
- name: serviceAccount
value: "{{ serviceAccount }}"
description: |
Optional. The service account to run workflow invocations under.
- name: setAuthenticatedUserAdmin
value: {{ setAuthenticatedUserAdmin }}
description: |
Optional. Input only. If set to true, the authenticated user will be granted the roles/dataform.admin role on the created repository.
- name: repositoryId
value: "{{ repositoryId }}"
UPDATE examples
- patch
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
- delete
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
- compute_access_token_status
- move
- read_file
- commit
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
;
Moves a Repository to a new location.
EXEC google.dataform.repositories.move
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
@@json=
'{
"destinationContainingFolder": "{{ destinationContainingFolder }}"
}'
;
Returns the contents of a file (inside a Repository). The Repository must not have a value for git_remote_settings.url.
EXEC google.dataform.repositories.read_file
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required,
@commitSha='{{ commitSha }}',
@path='{{ path }}'
;
Applies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url.
EXEC google.dataform.repositories.commit
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
@@json=
'{
"commitMetadata": "{{ commitMetadata }}",
"requiredHeadCommitSha": "{{ requiredHeadCommitSha }}",
"fileOperations": "{{ fileOperations }}"
}'
;