StackScripts
StackScripts List
https://api.linode.com/v4/linode/stackscripts
If the request is not authenticated, only public StackScripts are returned.
For more information on StackScripts, please read our StackScripts documentation.
Query Parameters
The page of a collection to return.
The number of items to return per page.
Request Samples
- Shell
- CLI
curl https://api.linode.com/v4/linode/stackscripts
Response Samples
- 200
- default
{
"data": [
{
"id": "",
"created": "2018-01-01T00:01:01",
"username": "myuser",
"label": "a-stackscript",
"updated": "2018-01-01T00:01:01",
"description": "This StackScript installs and configures MySQL\n",
"is_public": true,
"user_gravatar_id": "a445b305abda30ebc766bc7fda037c37",
"images": [
"linode/debian9",
"linode/debian8"
],
"deployments_total": 12,
"deployments_active": 1,
"rev_note": "Set up MySQL",
"script": "\"#!/bin/bash\"\n",
"user_defined_fields": [
"Enter the DB password",
"DB_PASSWORD",
"hunter2"
],
"mine": true
}
],
"page": 1,
"pages": 1,
"results": 1
}
Responses
200: A list of StackScripts available to the User, including private StackScripts owned by the User if the request is authenticated.
The unique ID of this StackScript.
The date this StackScript was created.
The User who created the StackScript.
The StackScript's label is for display purposes only.
The date this StackScript was last updated.
A description for the StackScript.
This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
The Gravatar ID for the User who created the StackScript.
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.
The total number of times this StackScript has been deployed.
Count of currently active, deployed Linodes created from this StackScript.
This field allows you to add notes for the set of revisions made to this StackScript.
The script to execute when provisioning a new Linode with this StackScript.
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.
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.
The current page.
The total number of pages.
The total number of results.
default: Error
What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.
The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.
StackScript Create
https://api.linode.com/v4/linode/stackscripts
Creates a StackScript in your Account.
Request Body Schema
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.
The StackScript's label is for display purposes only.
The script to execute when provisioning a new Linode with this StackScript.
A description for the StackScript.
This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
This field allows you to add notes for the set of revisions made to this StackScript.
Request Samples
- Shell
- CLI
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"label": "a-stackscript",
"description": "This StackScript installs and configures MySQL",
"images": [
"linode/debian9",
"linode/debian8"
],
"is_public": true,
"rev_note": "Set up MySQL",
"script": "#!/bin/bash"
}' \
https://api.linode.com/v4/linode/stackscripts
Response Samples
- 200
- default
{
"created": "2018-01-01T00:01:01",
"updated": "2018-01-01T00:01:01",
"id": 1234,
"label": "a-stackscript",
"description": "This StackScript installs and configures MySQL\n",
"username": "myuser",
"is_public": true,
"user_gravatar_id": "a445b305abda30ebc766bc7fda037c37",
"images": [],
"deployments_total": 12,
"deployments_active": 1,
"rev_note": "Set up MySQL",
"script": "\"#!/bin/bash\"\n",
"user_defined_fields": [
{
"label": "Enter the password",
"name": "DB_PASSWORD",
"example": "hunter2",
"oneOf": "avalue,anothervalue,thirdvalue",
"manyOf": "avalue,anothervalue,thirdvalue",
"default": ""
}
],
"mine": true
}
Responses
200: StackScript successfully created.
The date this StackScript was created.
The date this StackScript was last updated.
The unique ID of this StackScript.
The StackScript's label is for display purposes only.
A description for the StackScript.
The User who created the StackScript.
This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.
The Gravatar ID for the User who created the StackScript.
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.
The total number of times this StackScript has been deployed.
Count of currently active, deployed Linodes created from this StackScript.
This field allows you to add notes for the set of revisions made to this StackScript.
The script to execute when provisioning a new Linode with this StackScript.
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.
A human-readable label for the field that will serve as the input prompt for entering the value during deployment.
The name of the field.
An example value for the field.
A list of acceptable single values for the field.
A list of acceptable values for the field in any quantity, combination or order.
The default value. If not specified, this value will be used.
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.
default: Error
What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.
The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.