Deployments
Preview

Save a template

Saves version 1 of a new template. A template is a named setup that starts a deployment: its apps, services, settings, a default place, the name pattern of a pull request's deployment and the defaults of the pull request options.

POST
/deployment-templates
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

Idempotency-Key?string

Makes retries safe. A repeated key with the same request returns the first result and sets Idempotent-Replayed: true. The same key with a different request answers 409 idempotency.key_reused, and while the first request is still running 409 idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack of sign-in or permission are not kept, so a retry runs again.

Match^[A-Za-z0-9_.:-]+$
Length1 <= length <= 255
application/json
  1. body
name*string
description?string
content*
autoAdd?

Adds a deployment of the template to every cluster whose labels hold all of these.

summary?string

What the version changes. Worked out from the difference when left out.

Response Body

The template.

application/json
  1. response
id*string
Formatuuid
name*string
description*string
latestVersion*integer
content*
autoAdd*

Adds a deployment of the template to every cluster whose labels hold all of these.

usedBy*integer

How many deployments came from the template.

updatedAt*string
Formatdate-time
updatedByName*string
Example Request
curl -X POST 'https://wardn.example.com/api/v1/deployment-templates' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "content": {    "apps": [      {        "appId": "28c365d5-df94-4a54-8217-3ce51d068868",        "follow": {          "kind": "branch",          "ref": "string"        },        "valuesFiles": [          "string"        ]      }    ],    "services": [      {        "serviceId": "8f8bb40f-b96b-40fe-9064-5031fbe483f9",        "mode": "shared"      }    ],    "settings": {      "arrival": "branch"    },    "namePattern": "string",    "pullRequests": {      "status": true,      "button": true,      "comment": true,      "graceMinutes": 0    }  }}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "description": "string",  "latestVersion": 0,  "content": {    "apps": [      {        "appId": "28c365d5-df94-4a54-8217-3ce51d068868",        "follow": {          "kind": "branch",          "ref": "string"        },        "valuesFiles": [          "string"        ]      }    ],    "services": [      {        "serviceId": "8f8bb40f-b96b-40fe-9064-5031fbe483f9",        "mode": "shared"      }    ],    "settings": {      "arrival": "branch",      "healthWatchSeconds": 0    },    "environmentId": "19f5cc2e-7657-437a-9268-83cd3d563563",    "clusterId": "a3d24843-7014-4490-bdd3-b7cb39b400c8",    "namePattern": "string",    "pullRequests": {      "status": true,      "button": true,      "comment": true,      "graceMinutes": 0    }  },  "autoAdd": {    "enabled": true,    "labels": {      "property1": "string",      "property2": "string"    }  },  "usedBy": 0,  "updatedAt": "2019-08-24T14:15:22Z",  "updatedByName": "string"}