stack_scripts
Creates, updates, deletes, gets or lists a stack_scripts
resource.
Overview
Name | stack_scripts |
Type | Resource |
Id | linode.linode.stack_scripts |
Fields
The following fields are returned by SELECT
queries:
- get_stack_script
- get_stack_scripts
A single StackScript.
Name | Datatype | Description |
---|---|---|
id | integer | Read-only The unique ID of this StackScript. |
user_gravatar_id | string | Read-only The Gravatar ID for the User who created the StackScript. (example: a445b305abda30ebc766bc7fda037c37) |
created | string (date-time) | Read-only The date this StackScript was created. (example: 2018-01-01T00:01:01) |
deployments_active | integer | Read-only Count of currently active, deployed Linodes created from this StackScript. |
deployments_total | integer | Filterable, Read-only The total number of times this StackScript has been deployed. |
description | string | Filterable A description for the StackScript. (example: This StackScript installs and configures MySQL) |
images | array | An 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_public | boolean | Filterable This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private. |
label | string | Filterable The StackScript's label is for display purposes only. (example: a-stackscript) |
mine | boolean | Filterable, 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_note | string | Filterable This field allows you to add notes for the set of revisions made to this StackScript. (example: Set up MySQL) |
script | string | The script to execute when provisioning a new Linode with this StackScript. (example: "#!/bin/bash", x-linode-cli-format: file) |
updated | string (date-time) | Read-only The date this StackScript was last updated. (example: 2018-01-01T00:01:01) |
user_defined_fields | array | Read-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. |
username | string | Read-only The User who created the StackScript. (example: myuser) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_stack_script | select | Returns all of the information about a specified StackScript, including the contents of the script. Learn more... Learn more... | ||
get_stack_scripts | select | page , page_size | If 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_script | insert | data__script , data__label , data__images | Creates a StackScript in your Account. Learn more... Learn more... | |
put_stack_script | replace | Updates a StackScript. Once a StackScript is made public, it cannot be made private. Learn more... Learn more... | ||
delete_stack_script | delete | Deletes 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.
Name | Datatype | Description |
---|---|---|
page | integer | The page of a collection to return. |
page_size | integer | The number of items to return per page. |
SELECT
examples
- get_stack_script
- get_stack_scripts
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;
If the request is not authenticated, only public StackScripts are returned.
For more information on StackScripts, please read our StackScripts documentation.
Learn more...
Learn more...
SELECT
data,
page,
pages,
results
FROM linode.linode.stack_scripts
WHERE page = '{{ page }}'
AND page_size = '{{ page_size }}';
INSERT
examples
- post_add_stack_script
- Manifest
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
;
# Description fields are for documentation purposes
- name: stack_scripts
props:
- name: description
value: string
description: >
__Filterable__ A description for the StackScript.
- name: images
value: array
description: >
An 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.
- name: is_public
value: boolean
description: >
__Filterable__ This determines whether other users can use your StackScript. __Once a StackScript is made public, it cannot be made private.__
- name: label
value: string
description: >
__Filterable__ The StackScript's label is for display purposes only.
- name: rev_note
value: string
description: >
__Filterable__ This field allows you to add notes for the set of revisions made to this StackScript.
- name: script
value: string
description: >
The script to execute when provisioning a new Linode with this StackScript.
REPLACE
examples
- put_stack_script
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
- delete_stack_script
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;