Skip to main content

Global Init Script

View as Markdown

Get an init script GA

GET /api/2.0/global-init-scripts/{script_id}

Gets all the details of a script, including its Base64-encoded contents.

API scopes: global-init-scripts

Parameters

script_idstringRequiredpath

The ID of the global init script.

Example: 714B166709FBD56F

Response

script_idstring

The global init script ID.

Example: 714B166709FBD56F

namestring[ 1 .. 100 ] characters^[a-zA-Z0-9_\\-\\. ]*$

The name of the script

Example: My example script name

positionint32integer

The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.

Example: 0

enabledboolean

Specifies whether the script is enabled. The script runs only if enabled.

Example: false

created_bystringemail

The username of the user who created the script.

Example: john.doe@databricks.com

created_atint64integer

Time when the script was created, represented as a Unix timestamp in milliseconds.

Example: 1594437249910

updated_bystringemail

The username of the user who last updated the script

Example: jane.smith@example.com

updated_atint64integer

Time when the script was updated, represented as a Unix timestamp in milliseconds.

Example: 1594444684786

Get init scripts GA

GET /api/2.0/global-init-scripts

Get a list of all global init scripts for this workspace. This returns all properties for each script but not the script contents. To retrieve the contents of a script, use the get a global init script operation.

API scopes: global-init-scripts

Response

scriptsarray of object
Show child attributesHide child attributes
script_idstring

The global init script ID.

Example: 714B166709FBD56F

namestring[ 1 .. 100 ] characters^[a-zA-Z0-9_\\-\\. ]*$

The name of the script

Example: My example script name

positionint32integer

The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.

Example: 0

enabledboolean

Specifies whether the script is enabled. The script runs only if enabled.

Example: false

created_bystringemail

The username of the user who created the script.

Example: john.doe@databricks.com

created_atint64integer

Time when the script was created, represented as a Unix timestamp in milliseconds.

Example: 1594437249910

updated_bystringemail

The username of the user who last updated the script

Example: jane.smith@example.com

updated_atint64integer

Time when the script was updated, represented as a Unix timestamp in milliseconds.

Example: 1594444684786

Create init script GA

POST /api/2.0/global-init-scripts

Creates a new global init script in this workspace.

API scopes: global-init-scripts

Request body

namestring[ 1 .. 100 ] characters^[a-zA-Z0-9_\\-\\. ]*$Required

The name of the script

Example: My example script name

scriptstringbyteRequired

The Base64-encoded content of the script.

Example: ZWNobyBoZWxsbw==

positionint32integer

The position of a global init script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.

If you omit the numeric position for a new global init script, it defaults to last position. It will run after all current scripts. Setting any value greater than the position of the last script is equivalent to the last position. Example: Take three existing scripts with positions 0, 1, and 2. Any position of (3) or greater puts the script in the last position. If an explicit position value conflicts with an existing script value, your request succeeds, but the original script at that position and all later scripts have their positions incremented by 1.

Example: 0

enabledboolean

Specifies whether the script is enabled. The script runs only if enabled.

Default: false

Example: false

Response

script_idstring

The global init script ID.

Example: 714B166709FBD56F

Update init script GA

PATCH /api/2.0/global-init-scripts/{script_id}

Updates a global init script, specifying only the fields to change. All fields are optional. Unspecified fields retain their current value.

API scopes: global-init-scripts

Parameters

script_idstringRequiredpath

The ID of the global init script.

Example: 714B166709FBD56F

Request body

namestring[ 1 .. 100 ] characters^[a-zA-Z0-9_\\-\\. ]*$Required

The name of the script

Example: My example script name

scriptstringbyteRequired

The Base64-encoded content of the script.

Example: ZWNobyBoZWxsbw==

positionint32integer

The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order. To move the script to run first, set its position to 0.

To move the script to the end, set its position to any value greater or equal to the position of the last script. Example, three existing scripts with positions 0, 1, and 2. Any position value of 2 or greater puts the script in the last position (2).

If an explicit position value conflicts with an existing script, your request succeeds, but the original script at that position and all later scripts have their positions incremented by 1.

Example: 0

enabledboolean

Specifies whether the script is enabled. The script runs only if enabled.

Example: false

Delete init script GA

DELETE /api/2.0/global-init-scripts/{script_id}

Deletes a global init script.

API scopes: global-init-scripts

Parameters

script_idstringRequiredpath

The ID of the global init script.

Example: 714B166709FBD56F