Back to top

Silverstripe Cloud API

This API conforms to the JSON API specifications.

Using the API

In order to use the API, you will need to acquire an API token by going to the profile section of the Dashboard (at “naut/profile”), and clicking the “API token” button.

In order to authenticate you must use HTTP Basic Authentication with your email as a username and API token as a password.

Caution: protect the “Authorization” header just as you would any password, i.e. do not send it over email or submit it via Service Desk. The secret token is easily recoverable from that header.

All dates and timestamps will be in Pacific/Auckland timezone.

Example request

Example request
GET/naut/meta

Example URI

GET /naut/meta
Request
HideShow
Headers
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
X-Api-Version: 2.0
Authorization: Basic am9lQGV4YW1wbGUuY29tOnRlc3Q=
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "meta": {
    "whoami": "joe@example.com",
    "now": "2017-05-09 11:57:00"
  }
}

Example error

Example error
GET/naut/not-found-example

Example URI

GET /naut/not-found-example
Response  404
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "errors": [
    {
      "status": 404,
      "title": "Action 'not-found-example' isn't available on class DNRoot."
    }
  ]
}

Major releases

All releases introducing backward incompatibilities are documented here.

2.0

Backwards incompatibilities

  • Changed type of the status field in the errors structure to string (was numeric).

  • Changed type of the ID field of the “deployments” resource to string (was numeric).

  • Removed *_ago and *_nice datetime fields on the “deployments” resource, replaced with *_unix.

1.0

Initial release.

Stacks

Stacks collection

List all
GET/naut/projects{?lastedited_from_unix,lastdeployed_from_unix}

Will return a list of all stacks that you have the authority to view, with relevant datapoints.

Example URI

GET /naut/projects?lastedited_from_unix=1267148625&lastdeployed_from_unix=1267148625
URI Parameters
HideShow
lastedited_from_unix
int (optional) Example: 1267148625

Include only Projects/Environments edited after this timestamp

lastdeployed_from_unix
int (optional) Example: 1267148625

Include only Projects where environments had a (started) Deployment after this timestamp

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "stacks",
      "id": "stack1",
      "attributes": {
        "name": "stack1",
        "title": "stack1",
        "created": "2014-07-02 00:00:00",
        "created_unix": 1388534400,
        "repository_url": "https://github.com/mateusz/blank.git",
        "alternative_billing_code": "code123"
      },
      "relationships": {
        "environments": {
          "data": [
            {
              "type": "environments",
              "id": "Production",
              "links": {
                "self": "http://example.com/naut/project/stack1/environment/Production"
              }
            },
            {
              "type": "environments",
              "id": "UAT",
              "links": {
                "self": "http://example.com/naut/project/stack1/environment/UAT"
              }
            }
          ]
        }
      },
      "links": {
        "self": "http://example.com/naut/project/stack1"
      }
    }
  ]
}

Stack

View
GET/naut/project/{project_id}

Example URI

GET /naut/project/stack1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "stacks",
    "id": 1,
    "attributes": {
      "name": "stack1",
      "title": "stack1",
      "created": "2014-07-02 00:00:00",
      "created_unix": 1388534400,
      "repository_url": "https://github.com/mateusz/blank.git",
      "alternative_billing_code": "code123"
    },
    "relationships": {
      "environments": {
        "data": [
          {
            "type": "environments",
            "id": "Production",
            "links": {
              "self": "http://example.com/naut/project/stack1/environment/Production"
            }
          },
          {
            "type": "environments",
            "id": "UAT",
            "links": {
              "self": "http://example.com/naut/project/stack1/environment/UAT"
            }
          }
        ]
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1"
    }
  }
}

Environments

Environment

View
GET/naut/project/{project_id}/environment/{environment_id}

Example URI

GET /naut/project/stack1/environment/Production
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "environments",
    "id": "prod",
    "attributes": {
      "name": "Production",
      "created": "2014-07-02 00:00:00",
      "created_unix": 1388534400,
      "url": "foo.com",
      "framework_version": "4.3.0",
      "build_sha": "0cf36448607fe900ecbe48c280440be2d7b9385a",
      "build_package": null,
      "build_created_unix": "1388534400",
      "maintenance_day": "Saturday",
      "maintenance_time": "03:00:00",
      "maintenance_duration": "02:00:00",
      "maintenance_tz": "Pacific/Auckland",
      "usage": "Production"
    },
    "relationships": {
      "stack": {
        "data": {
          "type": "stacks",
          "id": "stack1",
          "links": {
            "self": "http://example.com/naut/project/stack1"
          }
        }
      },
      "waf": {
        "data": {
          "type": "waf",
          "id": 4,
          "attributes": {
            "type": "Incapsula",
            "title": "Incapsula Shared Account"
          }
        }
      }
    }
  }
}

Installed modules

Installed modules

View
GET/naut/project/{project_id}/environment/{environment_id}/modules{?filters,require_dev}

Example URI

GET /naut/project/stack1/environment/Production/modules?filters=silverstripe/framework&require_dev=
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

filters
array (optional) Example: silverstripe/framework

Module name as displayed in composer.lock. If not provided data on all modules is returned

require_dev
boolean (optional) 

Include require-dev modules (indicated by a require-dev attribute in the results)

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "module",
      "id": "silverstripe/framework",
      "attributes": {
        "name": "silverstripe/framework",
        "version": "3.6.1",
        "source": {
          "type": "git",
          "url": "https://github.com/silverstripe/silverstripe-framework.git",
          "reference": "ddff7c5dad117e49a40a3cfe1c16db84fd9b5016"
        },
        "require": {
          "composer/installers": "~1.0",
          "php": ">= 5.3.3, <7.2"
        },
        "type": "silverstripe-module"
      },
      "is-require-dev": false
    }
  ],
  "meta": {
    "server_time": "1536898174",
    "status_code": 200
  }
}

Composer scripts

Composer scripts

View
GET/naut/project/{project_id}/environment/{environment_id}/scripts

Lists scripts defined in the composer.json file

Example URI

GET /naut/project/stack1/environment/Production/scripts
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "name": "post-install-cmd",
      "scripts": [
        "@php my-custom-script.php"
      ]
    }
  ],
  "meta": {
    "server_time": "1536898174",
    "status_code": 200
  }
}

Git fetches

Git fetches collection

Create
POST/naut/project/{project_id}/git/fetches

Queues a new “fetch” on the repository associated with this project.

Example URI

POST /naut/project/stack1/git/fetches
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

Response  202
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "fetches",
    "id": 1,
    "attributes": {
      "status": "n/a"
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/git/fetches/1"
    }
  }
}

Git fetch

View
GET/naut/project/{project_id}/git/fetches/{fetch_id}

Example URI

GET /naut/project/stack1/git/fetches/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

fetch_id
number (required) Example: 1

ID of the git fetch

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "fetches",
    "id": 1,
    "attributes": {
      "status": "Complete"
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/git/fetches/1"
    }
  }
}

Deployments

Deployments collection

List all
GET/naut/project/{project_id}/environment/{environment_id}/deploys{?deployer_email,state,lastedited_from_unix,datestarted_from_unix,datestarted_to_unix,summary,title}

Returns a list of deployments associated to the environment.

Example URI

GET /naut/project/stack1/environment/Production/deploys?deployer_email=joe@example.com&state=New&lastedited_from_unix=1267148625&datestarted_from_unix=1267148625&datestarted_to_unix=4075753425&summary=We fixed all the bugs in this deployment&title=Deployment of site v1.0.0
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

deployer_email
string (optional) Example: joe@example.com

Filter by deployer

state
string (optional) Example: New

Filter by state, one of New,Submitted,Invalid,Approved,Rejected,Queued,Deploying,Aborting,Completed,Failed,Deleted

lastedited_from_unix
int (optional) Example: 1267148625

Include only deployments edited after this timestamp

datestarted_from_unix
int (optional) Example: 1267148625

Include only deployments started after this timestamp

datestarted_to_unix
int (optional) Example: 4075753425

Include only deployments started before this timestamp

title
string (optional) Example: Deployment of site v1.0.0

Filter by title

summary
string (optional) Example: We fixed all the bugs in this deployment

Filter by summary

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "deployments",
      "id": 1,
      "attributes": {
        "id": 1,
        "date_created_unix": 1388534400,
        "date_started_unix": 1388534400,
        "date_requested_unix": 1388534400,
        "date_approved_unix": 1388534400,
        "date_updated_unix": 1388534400,
        "title": "Deployment of site v1.0.0",
        "summary": "We fixed all the bugs in this deployment",
        "deployment_type": "code-only",
        "deployment_estimate": "2",
        "sha": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
        "short_sha": "257e0c0",
        "commit_subject": "Update README.md",
        "commit_message": "Update README.md",
        "commit_url": "https://github.com/mateusz/blank/commit/257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
        "decision": "fast",
        "options": [],
        "messages": [
          {
            "text": "Code-only deployment has been forced. No infrastructure changes will be made.",
            "code": "warning"
          }
        ],
        "deployer": {
          "id": 1,
          "email": "joe@example.com",
          "role": "Stack Manager",
          "name": "Joe Bloggs"
        },
        "approver": {
          "id": 1,
          "email": "jane@example.com",
          "role": "Stack Manager",
          "name": "Jane Bloggs"
        },
        "bypasser": null,
        "state": "Completed",
        "is_current_build": false
      },
      "relationships": {
        "environment": {
          "data": {
            "type": "environments",
            "id": "prod",
            "links": {
              "self": "http://example.com/naut/project/stack1/environment/Production"
            }
          }
        },
        "stack": {
          "data": {
            "type": "stacks",
            "id": "stack1",
            "links": {
              "self": "http://example.com/naut/project/stack1"
            }
          }
        }
      },
      "links": {
        "self": "http://example.com/naut/project/stack1/environment/Production/deploys/1"
      }
    }
  ]
}

Deployment creation

Create
POST/naut/project/{project_id}/environment/{environment_id}/deploys

Create a deployment.

If ref_type is set to “promote_from_uat” or “redeploy”, pass empty ref - otherwise it takes precedence, deploying potentially something unexpected.

Example URI

POST /naut/project/stack1/environment/Production/deploys
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Request
HideShow
Body
{
  "ref": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
  "ref_type": "sha",
  "title": "Deployment of site v1.0.0",
  "summary": "We fixed all the bugs in this deployment",
  "bypass": false,
  "bypass_and_start": true,
  "schedule_start_unix": 1511830104,
  "schedule_end_unix": 1511837304,
  "locked": false
}
Schema
{
  "type": "object",
  "properties": {
    "ref": {
      "type": "string",
      "description": "Reference of the code to be deployed. Can be a branch, tag, SHA or reference to hosted tar.gz package"
    },
    "ref_type": {
      "enum": [
        "promote_from_uat",
        "sha",
        "branch",
        "tag",
        "redeploy",
        "package"
      ],
      "description": "Type of commit reference"
    },
    "title": {
      "type": "string",
      "description": "Title of the deployment"
    },
    "summary": {
      "type": "string",
      "description": "Summary of the deployment in more detail"
    },
    "bypass": {
      "type": "boolean",
      "description": "Bypass approval of deployment. Only possible if user has permission to do so"
    },
    "bypass_and_start": {
      "type": "boolean",
      "description": "Bypass approval of deployment and start immediately. Only possible if user has permission to do so"
    },
    "schedule_start_unix": {
      "type": "integer",
      "description": "Scheduled start time for deployment. Currently only used internally"
    },
    "schedule_end_unix": {
      "type": "integer",
      "description": "Scheduled end time for deployment. Currently only used internally"
    },
    "locked": {
      "type": "boolean",
      "description": "Prevent deployment from being deleted or changed by other users"
    }
  },
  "required": [
    "ref_type"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  201
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deployments",
    "id": 1,
    "attributes": {
      "id": 1,
      "date_created_unix": 1388534400,
      "date_started_unix": 1388534400,
      "date_requested_unix": 1388534400,
      "date_approved_unix": 1388534400,
      "date_updated_unix": 1388534400,
      "title": "Deployment of site v1.0.0",
      "summary": "We fixed all the bugs in this deployment",
      "changes": {
        "Code version": {
          "from": "-",
          "to": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5"
        }
      },
      "deployment_type": "code-only",
      "deployment_estimate": "2",
      "sha": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "short_sha": "257e0c0",
      "commit_subject": "Update README.md",
      "commit_message": "Update README.md",
      "commit_url": "https://github.com/mateusz/blank/commit/257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "decision": "fast",
      "options": [],
      "messages": [
        {
          "text": "Code-only deployment has been forced. No infrastructure changes will be made.",
          "code": "warning"
        }
      ],
      "deployer": {
        "id": 1,
        "email": "joe@example.com",
        "role": "Stack Manager",
        "name": "Joe Bloggs"
      },
      "approver": null,
      "bypasser": {
        "id": 1,
        "email": "joe@example.com",
        "role": "Stack Manager",
        "name": "Joe Bloggs"
      },
      "state": "Queued",
      "is_current_build": true
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/Production/deploys/1"
    }
  }
}

Deployment

View
GET/naut/project/{project_id}/environment/{environment_id}/deploys/{deployment_id}

Obtain information about a deployment.

Example URI

GET /naut/project/stack1/environment/Production/deploys/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

deployment_id
number (required) Example: 1

ID of the deployment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deployments",
    "id": 1,
    "attributes": {
      "id": 1,
      "date_created_unix": 1388534400,
      "date_started_unix": 1388534400,
      "date_requested_unix": 1388534400,
      "date_approved_unix": 1388534400,
      "date_updated_unix": 1388534400,
      "title": "Deployment of site v1.0.0",
      "summary": "We fixed all the bugs in this deployment",
      "deployment_type": "code-only",
      "deployment_estimate": "2",
      "sha": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "short_sha": "257e0c0",
      "commit_subject": "Update README.md",
      "commit_message": "Update README.md",
      "commit_url": "https://github.com/mateusz/blank/commit/257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "decision": "fast",
      "options": [],
      "messages": [
        {
          "text": "Code-only deployment has been forced. No infrastructure changes will be made.",
          "code": "warning"
        }
      ],
      "deployer": {
        "id": 1,
        "email": "joe@example.com",
        "role": "Stack Manager",
        "name": "Joe Bloggs"
      },
      "approver": {
        "id": 1,
        "email": "jane@example.com",
        "role": "Stack Manager",
        "name": "Jane Bloggs"
      },
      "bypasser": null,
      "state": "Completed",
      "is_current_build": false
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/Production/deploys/1"
    }
  }
}

Delete
DELETE/naut/project/{project_id}/environment/{environment_id}/deploys/{deployment_id}

Delete the deployment. This operation is irreversible.

Example URI

DELETE /naut/project/stack1/environment/Production/deploys/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

deployment_id
number (required) Example: 1

ID of the deployment

Response  204

Start deployment

Start
POST/naut/project/{project_id}/environment/{environment_id}/deploys/start

Example URI

POST /naut/project/stack1/environment/Production/deploys/start
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Request
HideShow
Body
{
  "id": 2
}
Schema
{
  "type": "string",
  "properties": {
    "id": {
      "type": "integer",
      "description": "ID of deployment"
    }
  },
  "required": [
    "id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deployments",
    "id": 2,
    "attributes": {
      "id": 2,
      "date_created_unix": 1388534400,
      "date_started_unix": 1388534400,
      "date_requested_unix": 1388534400,
      "date_approved_unix": 1388534400,
      "date_updated_unix": 1388534400,
      "title": "Deployment of site v1.0.0",
      "summary": "We fixed all the bugs in this deployment",
      "changes": {
        "Code version": {
          "from": "-",
          "to": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5"
        }
      },
      "deployment_type": "code-only",
      "deployment_estimate": "2",
      "sha": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "short_sha": "257e0c0",
      "commit_subject": "Update README.md",
      "commit_message": "Update README.md",
      "commit_url": "https://github.com/mateusz/blank/commit/257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "decision": "fast",
      "options": [],
      "messages": [
        {
          "text": "Code-only deployment has been forced. No infrastructure changes will be made.",
          "code": "warning"
        }
      ],
      "deployer": {
        "id": 1,
        "email": "joe@example.com",
        "role": "Stack Manager",
        "name": "Joe Bloggs"
      },
      "approver": {
        "id": 1,
        "email": "jane@example.com",
        "role": "Stack Manager",
        "name": "Jane Bloggs"
      },
      "bypasser": null,
      "state": "Queued",
      "is_current_build": true
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/Production/deploys/1"
    }
  }
}

Invalidate deployment

Mark an approved deployment as invalid. This is useful for marking an older submitted, or approved deployment as no longer relevant if there is a new one that supersedes it.

Invalidate
POST/naut/project/{project_id}/environment/{environment_id}/deploys/invalidate

Example URI

POST /naut/project/stack1/environment/Production/deploys/invalidate
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Request
HideShow
Body
{
  "id": 2
}
Schema
{
  "type": "string",
  "properties": {
    "id": {
      "type": "integer",
      "description": "ID of deployment"
    }
  },
  "required": [
    "id"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "deployments",
    "id": 2,
    "attributes": {
      "id": 2,
      "date_created_unix": 1388534400,
      "date_started_unix": 1388534400,
      "date_requested_unix": 1388534400,
      "date_approved_unix": 1388534400,
      "date_updated_unix": 1388534400,
      "title": "Deployment of site v1.0.0",
      "summary": "We fixed all the bugs in this deployment",
      "changes": {
        "Code version": {
          "from": "-",
          "to": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5"
        }
      },
      "deployment_type": "code-only",
      "deployment_estimate": "2",
      "sha": "257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "short_sha": "257e0c0",
      "commit_subject": "Update README.md",
      "commit_message": "Update README.md",
      "commit_url": "https://github.com/mateusz/blank/commit/257e0c0a2441e6c2d52b654cf70d819b4ed79de5",
      "decision": "fast",
      "options": [],
      "messages": [
        {
          "text": "Code-only deployment has been forced. No infrastructure changes will be made.",
          "code": "warning"
        }
      ],
      "deployer": {
        "id": 1,
        "email": "joe@example.com",
        "role": "Stack Manager",
        "name": "Joe Bloggs"
      },
      "approver": null,
      "bypasser": null,
      "state": "Invalid",
      "is_current_build": true
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/Production/deploys/1"
    }
  }
}

Snapshots

Snapshots collection

List all
GET/naut/project/{project_id}/snapshots

Returns a list of snapshots associated with a stack. This will include snapshots in progress - which will be identifiable by the snapshot_status of ‘pending’ and empty values for download_link and size.

Example URI

GET /naut/project/stack1/snapshots
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "snapshots",
      "id": 1,
      "attributes": {
        "created": "2014-07-02 00:00:00",
        "mode": "db",
        "can_download": "true",
        "can_delete": "true",
        "size": "2096",
        "snapshot_status": "complete"
      },
      "relationships": {
        "source": {
          "data": [
            {
              "type": "environments",
              "id": "Production",
              "links": {
                "self": "http://example.com/naut/project/stack1/environment/Production"
              }
            }
          ]
        },
        "owner": {
          "data": [
            {
              "type": "environments",
              "id": "UAT",
              "links": {
                "self": "http://example.com/naut/project/stack1/environment/UAT"
              }
            }
          ]
        }
      },
      "links": {
        "download_link": "https://nz.silverstripe.cloud/path/to/snapshot.sspak"
      }
    }
  ]
}

Create
POST/naut/project/{project_id}/snapshots

Create a snapshot of an environment associated with a stack. This will return a HTTP 202, and link to an interim transfer object representing snapshotting operation in progress. As soon as the task is completed, a link to snapshot will be provided in data.relationships.snapshot - see “Transfer” GET operation for further information.

Example URI

POST /naut/project/stack1/snapshots
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

Request
HideShow
Body
{
  "environment": "Production",
  "mode": "all",
  "include_resampled": true,
  "notes": "before feature X"
}
Schema
{
    "type": "object",
    "properties": {
        "environment": {
            "type": "string",
            "description": "Name of the environment"
        },
        "mode": {
            "enum": [
                "all",
                "db",
                "assets"
            ],
            "description": "Type of the snapshot to make"
        }
        "include_resampled": {
            "type": "boolean",
            "description": "Whether or not to include directories starting with an underscore, such as _resampled. Defaults to false"
        },
        "notes": {
            "type": "string",
            "description": "Name of the environment"
        },
    },
    "required": [
        "environment",
        "mode"
    ],
    "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  202
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "transfers",
    "id": 1,
    "attributes": {
      "status": "n/a",
      "direction": "create",
      "mode": "db",
      "include_resampled": false
    },
    "relationships": {
      "snapshot": {
        "data": null
      },
      "environment": {
        "data": {
          "type": "environments",
          "id": "UAT",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/UAT"
          }
        }
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/snapshots/transfer/1"
    }
  }
}

Snapshot

View
GET/naut/project/{project_id}/snapshots/{snapshot_id}

Obtain information about a snapshot.

Example URI

GET /naut/project/stack1/snapshots/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

snapshot_id
number (required) Example: 1

ID of the snapshot

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "snapshots",
    "id": 1,
    "attributes": {
      "created": "2014-07-02 00:00:00",
      "mode": "db",
      "can_download": "true",
      "can_delete": "true",
      "size": "2096",
      "snapshot_status": "complete",
      "is_backup": false,
      "is_manual_upload": false,
      "notes": null
    },
    "relationships": {
      "source": {
        "data": [
          {
            "type": "environments",
            "id": "Production",
            "links": {
              "self": "http://example.com/naut/project/stack1/environment/Production"
            }
          }
        ]
      },
      "owner": {
        "data": [
          {
            "type": "environments",
            "id": "UAT",
            "links": {
              "self": "http://example.com/naut/project/stack1/environment/UAT"
            }
          }
        ]
      }
    },
    "links": {
      "download_link": "https://nz.silverstripe.cloud/path/to/snapshot.sspak"
    }
  }
}

Restore
POST/naut/project/{project_id}/snapshots/{snapshot_id}

Restore snapshot onto an environment. This will return a HTTP 202, and link to an interim transfer object representing snapshotting operation in progress.

Example URI

POST /naut/project/stack1/snapshots/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

snapshot_id
number (required) Example: 1

ID of the snapshot

Request
HideShow
Body
{
  "environment": "Production",
  "mode": "all",
  "skip_build": false,
  "backup_existing_data": false
}
Schema
{
  "type": "object",
  "properties": {
    "environment": {
      "type": "string",
      "description": "Name of the environment"
    },
    "mode": {
      "enum": [
        "all",
        "db",
        "assets"
      ],
      "description": "Type of the snapshot to make"
    },
    "skip_build": {
      "type": "boolean",
      "description": "Skip dev/build after restoring snapshot. Defaults to false"
    },
    "backup_existing_data": {
      "type": "boolean",
      "description": "Backup existing data before restoring. Defaults to true for production environments"
    }
  },
  "required": [
    "environment",
    "mode"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  202
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "transfers",
    "id": 2,
    "attributes": {
      "status": "n/a",
      "direction": "restore",
      "mode": "db",
      "skip_build": false
    },
    "relationships": {
      "snapshot": {
        "data": {
          "type": "snapshots",
          "id": 1,
          "links": {
            "self": "http://example.com/naut/project/stack1/snapshots/1"
          }
        }
      },
      "environment": {
        "data": {
          "type": "environments",
          "id": "UAT",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/UAT"
          }
        }
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/snapshots/transfer/1"
    }
  }
}

Delete
DELETE/naut/project/{project_id}/snapshots/{snapshot_id}

Delete the snapshot. This operation is irreversible.

Example URI

DELETE /naut/project/stack1/snapshots/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

snapshot_id
number (required) Example: 1

ID of the snapshot

Response  204

Transfer

Transfers represent snapshotting operations in progress.

View
GET/naut/project/{project_id}/snapshots/transfer/{transfer_id}

Obtain information about a transfer.

Example URI

GET /naut/project/stack1/snapshots/transfer/1
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

transfer_id
number (required) Example: 1

ID of the transfer

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "transfers",
    "id": 1,
    "attributes": {
      "status": "Finished",
      "direction": "restore",
      "mode": "db",
      "skip_build": true
    },
    "relationships": {
      "snapshot": {
        "data": {
          "type": "snapshots",
          "id": 1,
          "links": {
            "self": "http://example.com/naut/project/stack1/snapshots/1"
          }
        }
      },
      "environment": {
        "data": {
          "type": "environments",
          "id": "UAT",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/UAT"
          }
        }
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/snapshots/transfer/1"
    }
  }
}

Environment lock

Environment lock

Lock
POST/naut/project/{project_id}/environment/{environment_id}/lock

Lock an environment so that deployments and snapshots cannot be performed.

Example URI

POST /naut/project/stack1/environment/Production/lock
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Request
HideShow
Body
{
  "lock_message": "This environment is currently under maintenance"
}
Schema
{
  "type": "object",
  "properties": {
    "lock_message": {
      "type": "string",
      "description": "Reason for lock"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  202
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "environmentlock",
    "id": "stack1:Production",
    "attributes": {
      "locked": true,
      "lock_message": "This environment is currently under maintenance"
    }
  }
}

Unlock
DELETE/naut/project/{project_id}/environment/{environment_id}/lock

Removes an existing environment lock.

Example URI

DELETE /naut/project/stack1/environment/Production/lock
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: Production

Name of the environment

Response  204

Team

Team collection

List all
GET/naut/project/{project_id}/team

Return a list of all users on the stack.

Example URI

GET /naut/project/stack1/team
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "users",
      "id": "1",
      "attributes": {
        "username": "jbloggs",
        "first_name": "Joe",
        "surname": "Bloggs",
        "email": "joe@example.com",
        "role": "Stack Manager",
        "mfa": true
      },
      "relationships": {
        "stack": {
          "data": {
            "type": "stacks",
            "id": "stack1",
            "links": {
              "self": "http://example.com/naut/project/stack1"
            }
          }
        }
      }
    }
  ]
}

Domains

Domains collection

List all
GET/naut/project/{project_id}/environment/{environment_id}/domains

Return a list of all domains configured on the environment.

Example URI

GET /naut/project/stack1/environment/production/domains
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "domains",
      "id": "foo.com",
      "attributes": {
        "name": "foo.com",
        "ssl": false,
        "www": true,
        "primary": false
      },
      "relationships": {
        "environment": {
          "data": {
            "type": "environments",
            "id": "production",
            "links": {
              "self": "http://example.com/naut/project/stack1/environment/production"
            }
          }
        }
      }
    }
  ]
}

Configuration

Configuration collection

List all
GET/naut/project/{project_id}/environment/{environment_id}/configuration

Return a list of all configuration variables on the environment, and whether there are pending changes that require a full deployment.

Example URI

GET /naut/project/stack1/environment/production/configuration
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "configuration",
    "id": "493f0873ff39c21b0b13924bfd14b54d288f320a",
    "attributes": {
      "pending_changes": false,
      "configuration": {
        "SS_ENVIRONMENT_TYPE": "live",
        "SS_SEND_ALL_EMAILS_FROM": "no-reply@stack1-prod.example.com"
      }
    },
    "relationships": {
      "environment": {
        "data": {
          "type": "environments",
          "id": "production",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/production"
          }
        }
      }
    }
  }
}

Manifest Releases

Manifest Releases collection

List all
GET/naut/manifestreleases

Returns a list of infrastructure manifest releases.

Example URI

GET /naut/manifestreleases
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": [
    {
      "type": "manifestreleases",
      "id": "1",
      "attributes": {
        "sha": "3.17.3",
        "released_unix": 1513006144
      }
    }
  ]
}

Whitelist

List
GET/naut/project/{project_id}/environment/{environment_id}/whitelist

Return the status of the whitelist, and the list of all IP addresses whitelisted for the environment.

Example URI

GET /naut/project/stack1/environment/production/whitelist
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "whitelist",
    "id": "2c5b7c821ef596c69b3c85f2550c596326e9342b",
    "attributes": {
      "enabled": true,
      "pending_changes": true,
      "items": {
        "127.0.0.1": "Home"
      }
    },
    "relationships": {
      "environment": {
        "data": {
          "type": "environments",
          "id": "prod",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/production"
          }
        }
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/production/whitelist"
    }
  },
  "meta": {
    "server_time": "1550716233",
    "status_code": 200
  }
}

Update
PUT/naut/project/{project_id}/environment/{environment_id}/whitelist

Updates the IP addresses and their comments for the environment whitelist. This endpoint will replace the existing whitelist with the whitelist you specify and will turn the whitelist on.

Example URI

PUT /naut/project/stack1/environment/production/whitelist
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: production

Name of the environment

Request
HideShow
Body
{
  "123.123.123.123": "Home",
  "123.123.123.124/32": "Work"
}
Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "whitelist",
    "id": "2c5b7c821ef596c69b3c85f2550c596326e9342b",
    "attributes": {
      "enabled": true,
      "pending_changes": true,
      "items": {
        "123.123.123.123": "Home",
        "123.123.123.124/32": "Work"
      }
    },
    "relationships": {
      "environment": {
        "data": {
          "type": "environments",
          "id": "prod",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/production"
          }
        }
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/production/whitelist"
    }
  },
  "meta": {
    "server_time": "1550716233",
    "status_code": 200
  }
}

Disable
DELETE/naut/project/{project_id}/environment/{environment_id}/whitelist

Disables the whitelist for the environment, and clears any whitelisted IP addresses.

Example URI

DELETE /naut/project/stack1/environment/production/whitelist
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of the stack

environment_id
string (required) Example: production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "whitelist",
    "id": "2c5b7c821ef596c69b3c85f2550c596326e9342b",
    "attributes": {
      "enabled": false,
      "pending_changes": true,
      "items": []
    },
    "relationships": {
      "environment": {
        "data": {
          "type": "environments",
          "id": "prod",
          "links": {
            "self": "http://example.com/naut/project/stack1/environment/production"
          }
        }
      }
    },
    "links": {
      "self": "http://example.com/naut/project/stack1/environment/production/whitelist"
    }
  },
  "meta": {
    "server_time": "1550716233",
    "status_code": 200
  }
}

SSL certificates

SSL certificates collection

Show
GET/naut/project/{project_id}/environment/{environment_id}/ssl-certificates

Returns the SSL certificate provisioned for the specified environment

Example URI

GET /naut/project/stack1/environment/Production/ssl-certificates
URI Parameters
HideShow
project_id
string (required) Example: stack1

Name of stack

environment_id
string (required) Example: Production

Name of the environment

Response  200
HideShow
Headers
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "certificate",
    "id": "1",
    "attributes": {
      "issuer": "Let's Encrypt X1",
      "algorithm": "sha1WithRSAEncryption",
      "fingerprint": "7a:45:8e:f8:b5:2f:44:0f:6f:c1:1a:08:9b:bd:d6:a0",
      "domains": [
        "www.foo.com"
      ],
      "status": "Active",
      "issue_date": 1583121960,
      "expiry_date": 1898481960,
      "created": 1583206911,
      "last_edited": 1583265094
    },
    "relationships": {
      "environment": {
        "data": {
          "type": "environments",
          "id": "production",
          "links": {
            "self": "http://localhost/naut/project/stack1/environment/prod"
          }
        }
      }
    }
  }
}

Generated by aglio on 13 Dec 2021