Stack

Resource Fields

Writeable Fields

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 - -  

Read Only Fields

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.

Operations

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}'

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: A 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: A 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: A 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: A 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: A 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: A 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: A 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: A 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: A stack resource

Edit this page