git_credentials
Operations on a git_credentials
resource.
Overview
Name | git_credentials |
Type | Resource |
Id | databricks_workspace.repos.git_credentials |
Fields
Name | Datatype |
---|---|
credential_id | string |
git_provider | string |
git_username | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | credential_id, deployment_name | Gets the Git credential with the specified credential ID. |
list | SELECT | deployment_name | Lists the calling user's Git credentials. One credential per user is supported. |
create | INSERT | deployment_name | Creates a Git credential entry for the user. Only one Git credential per user is supported, so any attempts to create credentials if an entry already exists will fail. Use the PATCH endpoint to update existing credentials, or the DELETE endpoint to delete existing credentials. |
delete | DELETE | credential_id, deployment_name | Deletes the specified Git credential. |
update | UPDATE | credential_id, deployment_name | Updates the specified Git credential. |
SELECT
examples
- git_credentials (list)
- git_credentials (get)
SELECT
credential_id,
git_provider,
git_username
FROM databricks_workspace.repos.git_credentials
WHERE deployment_name = '{{ deployment_name }}';
SELECT
credential_id,
git_provider,
git_username
FROM databricks_workspace.repos.git_credentials
WHERE credential_id = '{{ credential_id }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new git_credentials
resource.
- git_credentials
- Manifest
/*+ create */
INSERT INTO databricks_workspace.repos.git_credentials (
deployment_name,
data__git_provider,
data__git_username,
data__personal_access_token
)
SELECT
'{{ deployment_name }}',
'{{ git_provider }}',
'{{ git_username }}',
'{{ personal_access_token }}'
;
- name: your_resource_model_name
props:
- name: git_provider
value: gitHub
- name: git_username
value: testuser
- name: personal_access_token
value: something
UPDATE
example
Updates a git_credentials
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.repos.git_credentials
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE credential_id = '{{ credential_id }}' AND
deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a git_credentials
resource.
/*+ delete */
DELETE FROM databricks_workspace.repos.git_credentials
WHERE credential_id = '{{ credential_id }}' AND
deployment_name = '{{ deployment_name }}';