Create Stack

Create a new stack.

Requires the stacks-manage permission.

Arguments
  • name
    string

    The name of the stack.

  • source
    object

    An object detailing the stack's source.

    Show child fields

Returns

Returns a stack resource (the one you just created), otherwise returns an Error.

POST /v1/stacks

Example Request
$ curl https://api.cycle.io/v1/stacks \
-H
'Authorization: Bearer API_KEY'
\
-H
'X-Hub-Id: HUB_ID'
\
-H 'Content-Type: application/json'
-d '{"name":"Test Stack","source":{"repo":{"url":"https://github.com/JakeWarner/cycle-test.git"}}}'
-X POST
Example Response
{
"data": {
"id": "5a98710df231a500017f9aa4",
"name": "Test",
"creator": {
"id": "5a662f3bf231a50001acbc1a",
"type": "account"
},
"hub_id": "5a6b6f3df231a50001c2317c",
"source": {
"type": "git-repo",
"details": {
"url": "https://demo.url.git/reponame.extension"
}
},
"state": {
"changed": "2018-03-01T21:31:19.793Z",
"current": "live"
},
"events": {
"created": "2018-03-01T21:30:53.296Z",
"updated": "0001-01-01T00:00:00Z",
"deleted": "0001-01-01T00:00:00Z",
"last_build": "0001-01-01T00:00:00Z"
},
"meta": {
"containers_count": 3,
"builds_count": 2
}
}
}