Skip to main content

git_credentials

Operations on a git_credentials resource.

Overview

Namegit_credentials
TypeResource
Iddatabricks_workspace.repos.git_credentials

Fields

NameDatatype
credential_idstring
git_providerstring
git_usernamestring

Methods

NameAccessible byRequired ParamsDescription
getSELECTcredential_id, deployment_nameGets the Git credential with the specified credential ID.
listSELECTdeployment_nameLists the calling user's Git credentials. One credential per user is supported.
createINSERTdeployment_nameCreates 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.
deleteDELETEcredential_id, deployment_nameDeletes the specified Git credential.
updateUPDATEcredential_id, deployment_nameUpdates the specified Git credential.

SELECT examples

SELECT
credential_id,
git_provider,
git_username
FROM databricks_workspace.repos.git_credentials
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new git_credentials resource.

/*+ 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 }}'
;

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 }}';