Stack

Resource Fields

Writeable Fields

Field Type Create Update Default Notes
answers map[json] Optional - -  
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 - -  
templates map[string] Optional - -  

Read Only Fields

Field Type Notes
data map[json]  
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.

Actions

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](/docs/rancher/v1.6/en/api/v2-beta/api-resources/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 ---|---|---|---|--- answers | map[json] | No | | dockerCompose | | No | | environment | map[string] | No | | externalId | | No | | rancherCompose | | No | | templates | map[string] | No | |
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Content-Type: application/json' \
-d '{
	"answers": {
		"key": "value-pairs"
	},
	"dockerCompose": "string",
	"environment": {
		"key": "value-pairs"
	},
	"externalId": "string",
	"rancherCompose": "string",
	"templates": {
		"key": "value-pairs"
	}
}' 'http://${RANCHER_URL}:8080/v2-beta/projects/${PROJECT_ID}/stacks/${ID}?action=upgrade'

Output: An updated copy of the stack resource
Edit this page