StackScripts

List StackScripts

get
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 guide: Automate Deployment with StackScripts.

Authorizations

Personal Access Token
OAuth: ( stackscripts:read_only)

Query Parameters

page
integer > = 1
Default: 1

The page of a collection to return.

page_size
integer [25 .. 100]
Default: 100

The number of items to return per page.

Request Samples

curl https://api.linode.com/v4/linode/stackscripts

Response Samples

{
  "data": [
    {
      "id": "",
      "created": "2018-01-01T00:01:01",
      "username": "myuser",
      "label": "a-stackscript",
      "description": "This StackScript installs and configures MySQL\n",
      "is_public": true,
      "updated": "2018-01-01T00:01:01",
      "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"
      ]
    }
  ],
  "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.

data
array of objects
id
integer

The unique ID of this StackScript.

created
string

The date this StackScript was created.

username
string

The User who created the StackScript.

label
Filterable
string

The StackScript's label is for display purposes only.

description
Filterable
string

A description for the StackScript.

is_public
Filterable
boolean

This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.

updated
string

The date this StackScript was last updated.

user_gravatar_id
string

The Gravatar ID for the User who created the StackScript.

images
array

An array of Image IDs. These are the images that can be deployed with this Stackscript.

deployments_total
integer

The total number of times this StackScript has been deployed.

deployments_active
integer

Count of currently active, deployed Linodes created from this StackScript.

rev_note
Filterable
string

This field allows you to add notes for the set of revisions made to this StackScript.

script
string

The script to execute when provisioning a new Linode with this StackScript.

user_defined_fields
array

This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment. See Variables and UDFs for more information.

page
integer
pages
integer
results
integer

default: Error

errors
array of objects
reason
string

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.

field
string

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.

Create StackScript

post
https://api.linode.com/v4/linode/stackscripts

Creates a StackScript in your Account.

Authorizations

Personal Access Token
OAuth: ( stackscripts:read_write)

Request Body Schema

images
Required
array

An array of Image IDs. These are the images that can be deployed with this Stackscript.

label
Required
Filterable
string [3 .. 128] characters

The StackScript's label is for display purposes only.

script
Required
string

The script to execute when provisioning a new Linode with this StackScript.

description
Filterable
string

A description for the StackScript.

is_public
Filterable
boolean

This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.

rev_note
Filterable
string

This field allows you to add notes for the set of revisions made to this StackScript.

Request Samples

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

{
  "id": 1234,
  "label": "a-stackscript",
  "username": "myuser",
  "description": "This StackScript installs and configures MySQL\n",
  "created": "2018-01-01T00:01:01",
  "is_public": true,
  "updated": "2018-01-01T00:01:01",
  "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": ""
    }
  ]
}

Responses

200: StackScript successfully created.

id
integer

The unique ID of this StackScript.

label
Filterable
string [3 .. 128] characters

The StackScript's label is for display purposes only.

username
string

The User who created the StackScript.

description
Filterable
string

A description for the StackScript.

created
string <date-time>

The date this StackScript was created.

is_public
Filterable
boolean

This determines whether other users can use your StackScript. Once a StackScript is made public, it cannot be made private.

updated
string <date-time>

The date this StackScript was last updated.

user_gravatar_id
string

The Gravatar ID for the User who created the StackScript.

images
array of objects

An array of Image IDs. These are the images that can be deployed with this Stackscript.

deployments_total
integer

The total number of times this StackScript has been deployed.

deployments_active
integer

Count of currently active, deployed Linodes created from this StackScript.

rev_note
Filterable
string

This field allows you to add notes for the set of revisions made to this StackScript.

script
string

The script to execute when provisioning a new Linode with this StackScript.

user_defined_fields
array of objects

This is a list of fields defined with a special syntax inside this StackScript that allow for supplying customized parameters during deployment. See Variables and UDFs for more information.

label
string

A human-readable label for the field that will serve as the input prompt for entering the value during deployment.

name
string

The name of the field.

example
string

An example value for the field.

oneOf
string

A list of acceptable single values for the field.

manyOf
string

A list of acceptable values for the field in any quantity, combination or order.

default
string

The default value. If not specified, this value will be used.

default: Error

errors
array of objects
reason
string

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.

field
string

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.