Skip to main content

global_init_scripts

Operations on a global_init_scripts resource.

Overview

Nameglobal_init_scripts
TypeResource
Iddatabricks_workspace.compute.global_init_scripts

Fields

NameDatatype
namestring
created_atinteger
created_bystring
enabledboolean
positioninteger
scriptstring
script_idstring
updated_atinteger
updated_bystring

Methods

NameAccessible byRequired ParamsDescription
getSELECTscript_id, deployment_nameManage a specific global init script with ID
listSELECTdeployment_nameManages global init scripts for this workspace.
createINSERTdeployment_nameManages global init scripts for this workspace.
deleteDELETEscript_id, deployment_nameManage a specific global init script with ID
updateUPDATEscript_id, deployment_nameManage a specific global init script with ID

SELECT examples

SELECT
name,
created_at,
created_by,
enabled,
position,
script,
script_id,
updated_at,
updated_by
FROM databricks_workspace.compute.global_init_scripts
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.compute.global_init_scripts (
deployment_name,
data__name,
data__script,
data__position,
data__enabled
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ script }}',
'{{ position }}',
'{{ enabled }}'
;

UPDATE example

Updates a global_init_scripts resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.compute.global_init_scripts
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE script_id = '{{ script_id }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a global_init_scripts resource.

/*+ delete */
DELETE FROM databricks_workspace.compute.global_init_scripts
WHERE script_id = '{{ script_id }}' AND
deployment_name = '{{ deployment_name }}';