Skip to main content

stack_scripts

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

Overview

Namestack_scripts
TypeResource
Idlinode.linode.stack_scripts

Fields

The following fields are returned by SELECT queries:

A single StackScript.

NameDatatypeDescription
idintegerRead-only The unique ID of this StackScript.
user_gravatar_idstringRead-only The Gravatar ID for the User who created the StackScript. (example: a445b305abda30ebc766bc7fda037c37)
createdstring (date-time)Read-only The date this StackScript was created. (example: 2018-01-01T00:01:01)
deployments_activeintegerRead-only Count of currently active, deployed Linodes created from this StackScript.
deployments_totalintegerFilterable, Read-only The total number of times this StackScript has been deployed.
descriptionstringFilterable A description for the StackScript. (example: This StackScript installs and configures MySQL)
imagesarrayAn array of Image IDs. These are the Images that can be deployed with this StackScript. any/all indicates that all available Images, including private Images, are accepted.
is_publicbooleanFilterable This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
labelstringFilterable The StackScript's label is for display purposes only. (example: a-stackscript)
minebooleanFilterable, Read-only Returns true if this StackScript is owned by the account of the user making the request, and the user making the request is unrestricted or has access to this StackScript.
rev_notestringFilterable This field allows you to add notes for the set of revisions made to this StackScript. (example: Set up MySQL)
scriptstringThe script to execute when provisioning a new Linode with this StackScript. (example: "#!/bin/bash", x-linode-cli-format: file)
updatedstring (date-time)Read-only The date this StackScript was last updated. (example: 2018-01-01T00:01:01)
user_defined_fieldsarrayRead-only This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment. See Declare User-Defined Fields (UDFs) for more information.
usernamestringRead-only The User who created the StackScript. (example: myuser)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_stack_scriptselectReturns all of the information about a specified StackScript, including the contents of the script.

Learn more...

Learn more...
get_stack_scriptsselectpage, page_sizeIf the request is not authenticated, only public StackScripts are returned.

For more information on StackScripts, please read our StackScripts documentation.

Learn more...

Learn more...
post_add_stack_scriptinsertdata__script, data__label, data__imagesCreates a StackScript in your Account.

Learn more...

Learn more...
put_stack_scriptreplaceUpdates a StackScript.

Once a StackScript is made public, it cannot be made private.

Learn more...

Learn more...
delete_stack_scriptdeleteDeletes a private StackScript you have permission to read_write. You cannot delete a public StackScript.

Learn more...

Learn more...

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
pageintegerThe page of a collection to return.
page_sizeintegerThe number of items to return per page.

SELECT examples

Returns all of the information about a specified StackScript, including the contents of the script.

Learn more...

Learn more...

SELECT
id,
user_gravatar_id,
created,
deployments_active,
deployments_total,
description,
images,
is_public,
label,
mine,
rev_note,
script,
updated,
user_defined_fields,
username
FROM linode.linode.stack_scripts;

INSERT examples

Creates a StackScript in your Account.

Learn more...

Learn more...

INSERT INTO linode.linode.stack_scripts (
data__description,
data__images,
data__is_public,
data__label,
data__rev_note,
data__script
)
SELECT
'{{ description }}',
'{{ images }}' --required,
{{ is_public }},
'{{ label }}' --required,
'{{ rev_note }}',
'{{ script }}' --required
RETURNING
id,
user_gravatar_id,
created,
deployments_active,
deployments_total,
description,
images,
is_public,
label,
mine,
rev_note,
script,
updated,
user_defined_fields,
username
;

REPLACE examples

Updates a StackScript.

Once a StackScript is made public, it cannot be made private.

Learn more...

Learn more...

REPLACE linode.linode.stack_scripts
SET
data__description = '{{ description }}',
data__images = '{{ images }}',
data__is_public = {{ is_public }},
data__label = '{{ label }}',
data__rev_note = '{{ rev_note }}',
data__script = '{{ script }}'
WHERE

RETURNING
id,
user_gravatar_id,
created,
deployments_active,
deployments_total,
description,
images,
is_public,
label,
mine,
rev_note,
script,
updated,
user_defined_fields,
username;

DELETE examples

Deletes a private StackScript you have permission to read_write. You cannot delete a public StackScript.

Learn more...

Learn more...

DELETE FROM linode.linode.stack_scripts;