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
Successful response
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. 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 | 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) |
Successful response
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. |
Successful response
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. 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 | 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 , path , pageSize , pageToken | Returns the contents of a given Repository directory. The Repository must not have a value for git_remote_settings.url . |
list | select | projectsId , locationsId | pageSize , pageToken , orderBy , 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. |
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 | commitSha , path | Returns the contents of a file (inside a Repository). The Repository must not have a value for git_remote_settings.url . |
compute_access_token_status | exec | projectsId , locationsId , repositoriesId | Computes a Repository's Git access token status. |
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 path = '{{ path }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}';
INSERT
examples
- create
- Manifest
Creates a new Repository in a given project and location.
INSERT INTO google.dataform.repositories (
data__name,
data__displayName,
data__gitRemoteSettings,
data__npmrcEnvironmentVariablesSecretVersion,
data__workspaceCompilationOverrides,
data__labels,
data__setAuthenticatedUserAdmin,
data__serviceAccount,
data__kmsKeyName,
projectsId,
locationsId,
repositoryId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ gitRemoteSettings }}',
'{{ npmrcEnvironmentVariablesSecretVersion }}',
'{{ workspaceCompilationOverrides }}',
'{{ labels }}',
{{ setAuthenticatedUserAdmin }},
'{{ serviceAccount }}',
'{{ kmsKeyName }}',
'{{ 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: name
value: string
description: >
Identifier. The repository's name.
- name: displayName
value: string
description: >
Optional. The repository's user-friendly name.
- name: gitRemoteSettings
value: object
description: >
Optional. If set, configures this repository to be linked to a Git remote.
- 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: 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: 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. To modify access to the created repository later apply setIamPolicy from https://cloud.google.com/dataform/reference/rest#rest-resource:-v1beta1.projects.locations.repositories
- name: serviceAccount
value: string
description: >
Optional. The service account to run workflow invocations under.
- 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: 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__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__gitRemoteSettings = '{{ gitRemoteSettings }}',
data__npmrcEnvironmentVariablesSecretVersion = '{{ npmrcEnvironmentVariablesSecretVersion }}',
data__workspaceCompilationOverrides = '{{ workspaceCompilationOverrides }}',
data__labels = '{{ labels }}',
data__setAuthenticatedUserAdmin = {{ setAuthenticatedUserAdmin }},
data__serviceAccount = '{{ serviceAccount }}',
data__kmsKeyName = '{{ kmsKeyName }}'
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
- commit
- read_file
- compute_access_token_status
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 }}"
}';
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 }}';
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;