Stack
A stack is the unit of deployment in Run-App. It holds one or more services and the environment shared between them.
All requests go to the Run-App gateway and need
the authentication headers. Every argument
table lists subscriptionId as optional because it is optional in the schema;
the frontend always sends it. The productId / appCode arguments belong to
the Pay As You Go flow and are not sent by the
frontend.
Stack mutations only report that the request was accepted (for example
"Stack is being processed"). The result arrives through the
container_stackActionReceived subscription — see
Real-time Events. Status codes are
listed on the overview.
Create Stack
Mutation · container_createStack
Creates a run-app stack.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | ID of subscription. Optional in the schema; always sent by the frontend |
input | container_CreateStackInput! | Yes | Stack configuration |
productId | String | No | Pay As You Go only; not sent by the frontend |
appCode | container_AppCode | No | Pay As You Go only; not sent by the frontend |
input
container_CreateStackInput
| Field | Type | Required | Description |
|---|---|---|---|
stackName | String! | Yes | Name of the stack being created |
deployNow | Boolean | No | Deploy the stack right after saving it |
pullImage | Boolean | No | Pull the images when deploying. The frontend always sends the same value as deployNow |
serviceReferenceId | String | No | Not sent by the frontend |
environments | [container_EnvironmentInput!] | No | Stack-level environment variables |
services | [container_ServiceInput!]! | Yes | Services belonging to the stack |
environments
container_EnvironmentInput — used both at stack level and at service level.
| Field | Type | Required | Description |
|---|---|---|---|
envKey | String | No | The key for the environment variable |
envValue | String | No | The value for the environment variable |
services
container_ServiceInput
| Field | Type | Required | Description |
|---|---|---|---|
serviceName | String! | Yes | Name of the service |
image | String! | Yes | Container image to use for the service |
domainName | String | No | Domain name associated with the service |
port | Int | No | Container port for the service. The frontend sends null when no port is published |
entrypoint | String | No | Command to execute when the container starts |
isPrivateRegistry | Boolean | No | Specifies if the image is from a private registry |
containerRegistryId | String | No | ID of the container registry. The frontend sends "" for public images |
environments | [container_EnvironmentInput!] | No | Service-level environment variables |
restartPolicy | container_RestartPolicyInput! | Yes | Restart behaviour — see below |
resources | container_ResourceInput! | Yes | CPU and memory allocation — see below |
replicas | Int | No | Number of copies of the service. The frontend sends 1 by default |
mountVolume | [container_MountVolumeInput!] | No | Not sent by the frontend — see below |
dependsOn | [String!] | No | Not sent by the frontend |
restartPolicy
container_RestartPolicyInput
| Field | Type | Required | Description |
|---|---|---|---|
maxAttempt | Int! | Yes | Maximum number of restart attempts, e.g. 5 |
restartWindow | String! | Yes | Time window for restarts, e.g. 120s |
delay | String! | Yes | Delay between restart attempts, e.g. 5s |
condition | container_RestartPolicyCondition! | Yes | Enum: NONE, ON_FAILURE, ANY. The frontend defaults to ANY |
condition takes the enum spelling (ON_FAILURE).
Restart Conditions and the
service responses return lowercase values (on-failure); the frontend converts
them before sending. This was checked against the frontend and the schema.
resources
container_ResourceInput
| Field | Type | Required | Description |
|---|---|---|---|
cpu | Float! | Yes | CPU allocation per replica, e.g. 0.5, 1 |
memory | Float! | Yes | Memory allocation per replica, e.g. 512, 1024 |
Earlier versions of these docs flagged the source's resource vs resources
contradiction and typed cpu / memory as String. Verified against the
frontend and the schema: the input field is resources with Float! values;
responses return the same data under resource.
mountVolume
container_MountVolumeInput
| Field | Type | Required | Description |
|---|---|---|---|
volumeId | String | No | |
containerPath | String | No | |
readOnly | Boolean | No |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"input": {
"stackName": "app_01",
"deployNow": true,
"pullImage": true,
"environments": [
{
"envValue": "http:192.189.1.1/graphql",
"envKey": "api"
}
],
"services": [
{
"serviceName": "service_01",
"restartPolicy": {
"maxAttempt": 5,
"restartWindow": "120s",
"delay": "5s",
"condition": "NONE"
},
"resources": {
"memory": 512,
"cpu": 0.5
},
"replicas": 1,
"port": 80,
"isPrivateRegistry": true,
"image": "node:11",
"entrypoint": "entrypoint",
"domainName": "test01.com",
"containerRegistryId": "66d7ca042d67cb0ada9d8408",
"environments": [
{
"envValue": "127.1.1.1/graphql",
"envKey": "url"
}
]
}
]
}
}
Request
mutation Container_createStack($input: container_CreateStackInput!, $subscriptionId: String) {
container_createStack(input: $input, subscriptionId: $subscriptionId) {
id
serviceCode
serviceReferenceId
subscriptionId
productId
mysabayUserId
stackName
status
environment {
envKey
envValue
}
numberOfService
serviceReference
services {
id
stackId
containerName
serviceName
image
status
replicas
restartPolicy {
condition
delay
maxAttempt
restartWindow
}
dependsOn
resource {
cpu
memory
}
entrypoint
domain {
domainName
containerPort
domainVerified
domainGenerated
}
containerRegistry {
containerRegistryId
containerRegistryProvider
portainerRegistryId
}
isPrivateRegistry
}
}
}
Response
Trimmed: the selection above also requests serviceCode,
serviceReferenceId, productId, mysabayUserId, serviceReference and
services.
{
"data": {
"container_createStack": {
"id": "622c782e68cba9e68b2c3989",
"subscriptionId": "672c73b2b4858f255a3657fc",
"stackName": "app_01",
"status": 3,
"environment": [
{
"envValue": "http:192.189.1.1/graphql",
"envKey": "api"
}
],
"numberOfService": 1
}
}
}
Update Stack
Mutation · container_updateStack
Updates an existing run-app stack.
A stack is saved whole: there is no mutation that edits a single service.
Adding or editing a service in the frontend sends container_updateStack with
all the stack's other services unchanged plus the new or edited one. A service
left out of services is dropped. container_UpdateStackInput has no
stackName field.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | ID of subscription. Optional in the schema; always sent by the frontend |
input | container_UpdateStackInput! | Yes | Stack configuration |
productId | String | No | Pay As You Go only; not sent by the frontend |
appCode | container_AppCode | No | Pay As You Go only; not sent by the frontend |
input
container_UpdateStackInput
| Field | Type | Required | Description |
|---|---|---|---|
stackId | String! | Yes | ID of the stack to update |
deployNow | Boolean | No | Indicates whether the stack should be deployed immediately |
pullImage | Boolean | No | Pull the images when deploying. The frontend sends the same value as deployNow |
environments | [container_EnvironmentInput!] | No | Stack-level environment variables |
services | [container_ServiceInput!]! | Yes | The full list of services |
The environments, services,
restartPolicy, resources and
mountVolume structures are the same as for Create Stack.
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"input": {
"stackId": "67501d3de6d872adef006ff6",
"deployNow": true,
"pullImage": true,
"services": [
{
"serviceName": "service_01",
"restartPolicy": {
"restartWindow": "120s",
"maxAttempt": 5,
"delay": "5s",
"condition": "NONE"
},
"resources": {
"memory": 512,
"cpu": 0.5
},
"replicas": 1,
"port": 80,
"isPrivateRegistry": true,
"image": "node:11",
"environments": [
{
"envValue": "127.1.1.1/graphql",
"envKey": "url"
}
],
"entrypoint": "entrypoint",
"domainName": "test01.com",
"containerRegistryId": "66d7ca042d67cb0ada9d8408"
}
],
"environments": [
{
"envValue": "http:192.189.1.1/graphql",
"envKey": "api"
}
]
}
}
Request
mutation Container_updateStack($input: container_UpdateStackInput!, $subscriptionId: String) {
container_updateStack(input: $input, subscriptionId: $subscriptionId) {
message
success
}
}
Response
{
"data": {
"container_updateStack": {
"message": "Stack updated successfully",
"success": true
}
}
}
Stack List
Query · container_listStack
Lists the stacks of a subscription.
The frontend uses it on the stack list page with the page's pager, and on the
CMS page with { page: 1, limit: 1 } to read the status of the
subscription's stack. It is not called while the subscription is pending
suspend or suspended.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | The ID of subscription. Optional in the schema; always sent by the frontend |
pager | container_PagerInput | No | Pagination options |
productId | String | No | Pay As You Go only; not sent by the frontend |
pager
container_PagerInput
| Field | Type | Required | Description |
|---|---|---|---|
page | Int! | Yes | The number of current page |
limit | Int! | Yes | The number of items per page |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"pager": {
"page": 1,
"limit": 10
}
}
Request
query Container_listStack($subscriptionId: String, $pager: container_PagerInput) {
container_listStack(subscriptionId: $subscriptionId, pager: $pager) {
stacks {
id
stackId
serviceCode
subscriptionId
mysabayUserId
stackName
status
environment {
envKey
envValue
}
numberOfService
serviceReference
services {
id
stackId
containerName
}
}
pagination {
currentPage
lastPage
from
perPage
to
total
}
}
}
Response
The source has no sample response; this structure is generated from the schema, and the values show field types.
{
"data": {
"container_listStack": {
"stacks": [
{
"id": "ID",
"stackId": "Int",
"serviceCode": "String",
"subscriptionId": "String",
"mysabayUserId": "Float",
"stackName": "String",
"status": "Int",
"environment": [
{
"envKey": "String",
"envValue": "String"
}
],
"numberOfService": "Int",
"serviceReference": "container_JSON",
"services": [
{
"id": "ID",
"stackId": "ID",
"containerName": "String"
}
]
}
],
"pagination": {
"currentPage": "Int",
"lastPage": "Int",
"from": "Int",
"perPage": "Int",
"to": "Int",
"total": "Int"
}
}
}
}
Stack Information
Query · container_getStackById
Returns details for a single stack. To list the services inside it, see Service List.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | ID of subscription. Optional in the schema; always sent by the frontend |
stackId | String! | Yes | The ID of stack |
productId | String | No | Pay As You Go only; not sent by the frontend |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"stackId": "67501d3de6d872adef006ff6"
}
Request
query Container_getStackById($stackId: String!, $subscriptionId: String) {
container_getStackById(stackId: $stackId, subscriptionId: $subscriptionId) {
id
stackId
serviceCode
serviceReferenceId
subscriptionId
productId
mysabayUserId
stackName
planType
status
environment {
envKey
envValue
}
createdAt
updatedAt
numberOfService
serviceReference
services {
id
stackId
containerName
serviceName
image
mountVolume {
volumeId
volumePath
containerPath
readOnly
volumeName
}
status
replicas
restartPolicy {
condition
delay
maxAttempt
restartWindow
}
dependsOn
resource {
cpu
memory
}
entrypoint
domain {
domainName
containerPort
domainVerified
domainGenerated
}
containerRegistry {
containerRegistryId
containerRegistryProvider
portainerRegistryId
}
isPrivateRegistry
createdAt
updatedAt
}
}
}
Response
Trimmed: the selection above also requests stackId, serviceCode,
serviceReferenceId, productId, mysabayUserId, planType,
serviceReference and services.
{
"data": {
"container_getStackById": {
"id": "672c7b16a0deed3f1f3d6961",
"subscriptionId": "66d7c0fef0b997c90679b0b3",
"stackName": "app_02",
"status": 1,
"environment": [
{
"envKey": "api",
"envValue": "/http:192.189.1.1/graphql"
}
],
"createdAt": 1730968342568,
"updatedAt": 1733210386593,
"numberOfService": 1
}
}
}
Remove Stack
Mutation · container_deleteStackById
Removes a stack.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | The ID of subscription. Optional in the schema; always sent by the frontend |
stackId | String! | Yes | The ID of stack |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"stackId": "67501d3de6d872adef006ff6"
}
Request
mutation Container_deleteStackById($subscriptionId: String, $stackId: String!) {
container_deleteStackById(subscriptionId: $subscriptionId, stackId: $stackId) {
message
success
}
}
Response
{
"data": {
"container_deleteStackById": {
"message": "Stack is being processed",
"success": true
}
}
}
Stop Stack
Mutation · container_stopStackById
Stops a running stack.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | The ID of subscription. Optional in the schema; always sent by the frontend |
stackId | String! | Yes | The ID of stack |
Variables
{
"stackId": "67501d3de6d872adef006ff6",
"subscriptionId": "67ab067f092e8f8c2beb2df5"
}
Request
mutation Container_stopStackById($subscriptionId: String, $stackId: String!) {
container_stopStackById(subscriptionId: $subscriptionId, stackId: $stackId) {
message
success
}
}
Response
{
"data": {
"container_stopStackById": {
"message": "Stack is being processed",
"success": true
}
}
}
Start Stack
Mutation · container_startStackById
Starts a stopped stack, without re-pulling images.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | The ID of subscription. Optional in the schema; always sent by the frontend |
stackId | String! | Yes | The ID of stack |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"stackId": "67501d3de6d872adef006ff6"
}
Request
mutation Container_startStackById($subscriptionId: String, $stackId: String!) {
container_startStackById(subscriptionId: $subscriptionId, stackId: $stackId) {
message
success
}
}
Response
{
"data": {
"container_startStackById": {
"message": "Stack is being processed",
"success": true
}
}
}
Restart Stack
Mutation · container_updateStack
Restarts a stack (the Pull & Restart action in the frontend). This reuses the Update Stack mutation with a dedicated payload.
There is no dedicated restart mutation. The frontend sends an update that
changes nothing but re-pulls the images: services: [] means "leave the
services as they are" (the field is required by the schema) and
pullImage: true brings the containers back on the latest tag. The frontend
disables it while the stack is Processing or has never been deployed (status
4).
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | ID of subscription. Optional in the schema; always sent by the frontend |
input | container_UpdateStackInput! | Yes | Restart payload |
input
| Field | Type | Required | Description |
|---|---|---|---|
stackId | String! | Yes | The ID of stack |
services | [container_ServiceInput!]! | Yes | Value of [] |
pullImage | Boolean | No | Optional in the schema. Value of true |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"input": {
"pullImage": true,
"services": [],
"stackId": "67501d3de6d872adef006ff6"
}
}
Request
mutation Container_updateStack($input: container_UpdateStackInput!, $subscriptionId: String) {
container_updateStack(input: $input, subscriptionId: $subscriptionId) {
message
success
}
}
Response
{
"data": {
"container_updateStack": {
"message": "Stack updated successfully",
"success": true
}
}
}
Pull & Deploy Stack
Mutation · container_deployStackById
Pulls the latest images and deploys the stack. In the frontend this is the Deploy action for a stack that was never deployed, and Rebuild Stack otherwise: it recreates the stack on the latest images, and services are down until it finishes.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
subscriptionId | String | No | ID of subscription. Optional in the schema; always sent by the frontend |
stackId | String! | Yes | The ID of stack |
productId | String | No | Pay As You Go only; not sent by the frontend |
appCode | container_AppCode | No | Pay As You Go only; not sent by the frontend |
Variables
{
"subscriptionId": "67ab067f092e8f8c2beb2df5",
"stackId": "67501d3de6d872adef006ff6"
}
Request
mutation Container_deployStackById($subscriptionId: String, $stackId: String!) {
container_deployStackById(subscriptionId: $subscriptionId, stackId: $stackId) {
message
success
}
}
Response
{
"data": {
"container_deployStackById": {
"message": "Stack is being processed",
"success": true
}
}
}