Field | Type | Create | Update | Default | Notes |
---|---|---|---|---|---|
binding | binding | Optional | Yes | - | |
description | string | Optional | Yes | - | |
dockerCompose | string | Optional | - | - | |
environment | map[string] | Optional | - | - | |
externalId | string | Optional | Yes | - | |
group | string | Optional | Yes | - | |
name | string | Yes | Yes | - | |
outputs | map[string] | Optional | Yes | - | |
previousEnvironment | map[string] | Optional | Yes | - | |
previousExternalId | string | Optional | Yes | - | |
rancherCompose | string | Optional | - | - | |
startOnCreate | boolean | Optional | - | - |
Field | Type | Notes |
---|---|---|
healthState | string | |
id | int | The unique identifier for the stack |
serviceIds | array[service] | |
system | boolean |
Please read more about the common resource fields. These fields are read only and applicable to almost every resource. We have segregated them from the list above.
CreatePOST: /v2-beta/projects/${PROJECT_ID}/stacks
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"binding": {
"services": "map[serviceBinding]"
},
"description": "string",
"dockerCompose": "string",
"environment": {
"key": "value-pairs"
},
"externalId": "string",
"group": "string",
"name": "string",
"outputs": {
"key": "value-pairs"
},
"previousEnvironment": {
"key": "value-pairs"
},
"previousExternalId": "string",
"rancherCompose": "string",
"startOnCreate": false
}' 'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks'
DeleteDELETE: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X DELETE \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}'
UpdatePUT: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X PUT \
-H 'Content-Type: application/json' \
-d '{
"binding": {
"services": "map[serviceBinding]"
},
"description": "string",
"externalId": "string",
"group": "string",
"name": "string",
"outputs": {
"key": "value-pairs"
},
"previousEnvironment": {
"key": "value-pairs"
},
"previousExternalId": "string"
}' 'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}'
activateservices
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=activateservices
Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=activateservices'
Output: An updated copy of the stack resource
addoutputs
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=addoutputs
Input: AddOutputsInput
Field | Type | Required | Default | Notes |
---|---|---|---|---|
outputs | map[string] | Yes |
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"outputs": {
"key": "value-pairs"
}
}' 'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=addoutputs'
Output: An updated copy of the stack resource
cancelupgrade
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=cancelupgrade
Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=cancelupgrade'
Output: An updated copy of the stack resource
deactivateservices
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=deactivateservices
Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=deactivateservices'
Output: An updated copy of the stack resource
error
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=error
Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=error'
Output: An updated copy of the stack resource
exportconfig
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=exportconfig
Input: ComposeConfigInput
Field | Type | Required | Default | Notes |
---|---|---|---|---|
serviceIds | array[service] | No |
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"serviceIds": "array[reference[service]]"
}' 'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=exportconfig'
Output: An updated copy of the composeConfig resource
finishupgrade
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=finishupgrade
Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=finishupgrade'
Output: An updated copy of the stack resource
rollback
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=rollback
Input:This action has no inputs
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=rollback'
Output: An updated copy of the stack resource
upgrade
POST: /v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=upgrade
Input: StackUpgrade
Field | Type | Required | Default | Notes |
---|---|---|---|---|
dockerCompose | No | |||
environment | map[string] | No | ||
externalId | No | |||
rancherCompose | No |
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"dockerCompose": "string",
"environment": {
"key": "value-pairs"
},
"externalId": "string",
"rancherCompose": "string"
}' 'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=upgrade'
Output: An updated copy of the stack resource