Create a server group via API (templates)
This method allows you to add a new server group to an existing template.
URL
/templates/<permalink>/server_groups
- Replace
<permalink>
with the permalink of your template.
HTTP Method
POST
Supported Parameters
name
- A name for your server group (required)auto_deploy
- Should this server group be deployed automatically - eithertrue
orfalse
(required)email_notify_on
- When do you want to receive email notifications, eithernever
,failure
oralways
(required)notification_email
- An email address to send notifications totransfer_order
- The transfer order for the server group,parallel
orsequential
(required).
Example cURL request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user adam@atechmedia.com:my-api-key \
-X POST \
-d { \
"server_group":{ \
"name":"Created via the API", \
"auto_deploy":true, \
"email_notify_on":"failure", \
"notification_email":"adamw@atech.media", \
"transfer_order":"parallel" \
} \
} \
https://atech.deployhq.com/templates/api-created/server_groups
Example response
{
"identifier":"4e62a8fd-8708-466b-b79f-59365c31e0d1",
"name":"Created via the API",
"servers":[],
"preferred_branch":null,
"last_revision":null
}