Skip to main content

global_init_scripts

Creates, updates, deletes, gets or lists a global_init_scripts resource.

Overview

Nameglobal_init_scripts
TypeResource
Iddatabricks_workspace.compute.global_init_scripts

Fields

The following fields are returned by SELECT queries:

Response indicating that the script was retrieved successfully.

NameDatatypeDescription
namestring
script_idstring
created_atinteger
created_bystring
enabledboolean
positioninteger
scriptstring
updated_atinteger
updated_bystring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameManage a specific global init script with ID
listselectdeployment_nameManages global init scripts for this workspace.
createinsertdeployment_nameManages global init scripts for this workspace.
updateupdatedeployment_nameManage a specific global init script with ID
deletedeletedeployment_nameManage a specific global init script with ID

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.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Manage a specific global init script with ID

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

INSERT examples

Manages global init scripts for this workspace.

INSERT INTO databricks_workspace.compute.global_init_scripts (
data__name,
data__script,
data__position,
data__enabled,
deployment_name
)
SELECT
'{{ name }}',
'{{ script }}',
'{{ position }}',
'{{ enabled }}',
'{{ deployment_name }}'
RETURNING
script_id
;

UPDATE examples

Manage a specific global init script with ID

UPDATE databricks_workspace.compute.global_init_scripts
SET
data__name = '{{ name }}',
data__script = '{{ script }}',
data__position = '{{ position }}',
data__enabled = '{{ enabled }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Manage a specific global init script with ID

DELETE FROM databricks_workspace.compute.global_init_scripts
WHERE deployment_name = '{{ deployment_name }}' --required;