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:
- get
- query_directory_contents
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The repository's name. |
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. |
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 |
|---|---|---|
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. |
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. |
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 |
|---|---|---|---|---|
get | select | projectsId, locationsId, repositoriesId | Fetches a single Repository. | |
query_directory_contents | select | projectsId, locationsId, repositoriesId | commitSha, pageToken, pageSize, path | Returns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url. |
list | select | projectsId, locationsId | orderBy, pageSize, pageToken, filter | 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. | |
commit | exec | projectsId, locationsId, repositoriesId | Applies a Git commit to a Repository. The Repository must not have a value for git_remote_settings.url. | |
read_file | exec | projectsId, locationsId, repositoriesId | path, commitSha | Returns the contents of a file (inside 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
- get
- query_directory_contents
- list
Fetches a single Repository.
SELECT
name,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
workspaceCompilationOverrides
FROM google.dataform.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
;
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 pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND path = '{{ path }}'
;
Lists Repositories in a given project and location. Note: This method can return repositories not shown in the Dataform UI.
SELECT
name,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
workspaceCompilationOverrides
FROM google.dataform.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND orderBy = '{{ orderBy }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
;
INSERT examples
- create
- Manifest
Creates a new Repository in a given project and location.
INSERT INTO google.dataform.repositories (
data__workspaceCompilationOverrides,
data__gitRemoteSettings,
data__name,
data__npmrcEnvironmentVariablesSecretVersion,
data__displayName,
data__kmsKeyName,
data__serviceAccount,
data__labels,
data__setAuthenticatedUserAdmin,
projectsId,
locationsId,
repositoryId
)
SELECT
'{{ workspaceCompilationOverrides }}',
'{{ gitRemoteSettings }}',
'{{ name }}',
'{{ npmrcEnvironmentVariablesSecretVersion }}',
'{{ displayName }}',
'{{ kmsKeyName }}',
'{{ serviceAccount }}',
'{{ labels }}',
{{ setAuthenticatedUserAdmin }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoryId }}'
RETURNING
name,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
workspaceCompilationOverrides
;
# Description fields are for documentation purposes
- name: repositories
props:
- name: projectsId
value: string
description: Required parameter for the repositories resource.
- name: locationsId
value: string
description: Required parameter for the repositories resource.
- name: workspaceCompilationOverrides
value: object
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.
- name: gitRemoteSettings
value: object
description: >
Optional. If set, configures this repository to be linked to a Git remote.
- name: name
value: string
description: >
Identifier. The repository's name.
- name: npmrcEnvironmentVariablesSecretVersion
value: string
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: displayName
value: string
description: >
Optional. The repository's user-friendly name.
- name: kmsKeyName
value: string
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: serviceAccount
value: string
description: >
Optional. The service account to run workflow invocations under.
- name: labels
value: object
description: >
Optional. Repository user labels.
- name: setAuthenticatedUserAdmin
value: boolean
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: string
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__workspaceCompilationOverrides = '{{ workspaceCompilationOverrides }}',
data__gitRemoteSettings = '{{ gitRemoteSettings }}',
data__name = '{{ name }}',
data__npmrcEnvironmentVariablesSecretVersion = '{{ npmrcEnvironmentVariablesSecretVersion }}',
data__displayName = '{{ displayName }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__serviceAccount = '{{ serviceAccount }}',
data__labels = '{{ labels }}',
data__setAuthenticatedUserAdmin = {{ setAuthenticatedUserAdmin }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
dataEncryptionState,
displayName,
gitRemoteSettings,
internalMetadata,
kmsKeyName,
labels,
npmrcEnvironmentVariablesSecretVersion,
serviceAccount,
setAuthenticatedUserAdmin,
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
- commit
- read_file
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
;
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 }}",
"fileOperations": "{{ fileOperations }}",
"requiredHeadCommitSha": "{{ requiredHeadCommitSha }}"
}'
;
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,
@path='{{ path }}',
@commitSha='{{ commitSha }}'
;