List Stacks belonging to a Project
GET/projects/ {projectId}/ stacks/
v2
GET
container-list-stacks
Request
- projectIdstring (uuid)required
ID of the Project to list Stacks for.
Responses
application/json
OK
- Schema-Dokumentation
- Beispiel
- JSON Schema
- Array[
- *object
- descriptionstringrequired
- disabledbooleanrequired
- idstring (uuid)required
- prefixstringrequired
Prefix for all service-names in this stack.
- projectIdstring (uuid)required
- servicesarray of object
- Array[
- *object
- deployedStateobjectrequired
- commandarray of string
- Array[
- *string
]
- entrypointarray of string
- Array[
- *string
]
- envsobject
- *string
- imagestringrequired
- portsarray of string
- Array[
- *string
]
- volumesarray of string
- Array[
- *string
]
descriptionstring
required
idstring (uuid)
required
pendingStateobject
required
- commandarray of string
- Array[
- *string
]
entrypointarray of string
- Array[
- *string
]
envsobject
- *string
imagestring
required
portsarray of string
- Array[
- *string
]
volumesarray of string
- Array[
- *string
]
projectIdstring (uuid)
required
serviceNamestring
required
stackIdstring (uuid)
required
statusstring (one of: running, stopped, restarting, error, creating, starting)
required
]
volumesarray of object
- Array[
- *object
- idstring (uuid)required
- namestringrequired
- orphanedbooleanrequired
Whether the Volume is attached to a Stack.
- stackIdstring (uuid)required
- storageUsageInBytesintegerrequired
- storageUsageInBytesSetAtstring (date-time)required
]
]
[
{
"description": "string",
"disabled": true,
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"prefix": "string",
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347",
"services": [
{
"deployedState": {
"command": [
"string"
],
"entrypoint": [
"string"
],
"envs": {
"string": "string"
},
"image": "string",
"ports": [
"string"
],
"volumes": [
"string"
]
},
"description": "MySQL DB",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"pendingState": {
"command": [
"string"
],
"entrypoint": [
"string"
],
"envs": {
"string": "string"
},
"image": "string",
"ports": [
"string"
],
"volumes": [
"string"
]
},
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347",
"serviceName": "mysql-db",
"stackId": "f0f86186-0a5a-45b2-aa33-502777496347",
"status": "running"
}
],
"volumes": [
{
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"name": "string",
"orphaned": true,
"stackId": "f0f86186-0a5a-45b2-aa33-502777496347",
"storageUsageInBytes": 123,
"storageUsageInBytesSetAt": "2024-11-08T18:11:32.709Z"
}
]
}
]
{
"items": {
"properties": {
"description": {
"type": "string"
},
"disabled": {
"type": "boolean"
},
"id": {
"format": "uuid",
"type": "string"
},
"prefix": {
"description": "Prefix for all service-names in this stack.",
"type": "string"
},
"projectId": {
"format": "uuid",
"type": "string"
},
"services": {
"items": {
"properties": {
"deployedState": {
"properties": {
"command": {
"items": {
"type": "string"
},
"type": "array"
},
"entrypoint": {
"items": {
"type": "string"
},
"type": "array"
},
"envs": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"image": {
"type": "string"
},
"ports": {
"items": {
"type": "string"
},
"type": "array"
},
"volumes": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"image"
],
"type": "object"
},
"description": {
"example": "MySQL DB",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"pendingState": {
"properties": {
"command": {
"items": {
"type": "string"
},
"type": "array"
},
"entrypoint": {
"items": {
"type": "string"
},
"type": "array"
},
"envs": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"image": {
"type": "string"
},
"ports": {
"items": {
"type": "string"
},
"type": "array"
},
"volumes": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"image"
],
"type": "object"
},
"projectId": {
"format": "uuid",
"type": "string"
},
"serviceName": {
"example": "mysql-db",
"type": "string"
},
"stackId": {
"format": "uuid",
"type": "string"
},
"status": {
"enum": [
"running",
"stopped",
"restarting",
"error",
"creating",
"starting"
],
"type": "string"
}
},
"required": [
"id",
"stackId",
"projectId",
"description",
"serviceName",
"pendingState",
"deployedState",
"status"
],
"type": "object"
},
"type": "array"
},
"volumes": {
"items": {
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
},
"orphaned": {
"description": "Whether the Volume is attached to a Stack.",
"type": "boolean"
},
"stackId": {
"format": "uuid",
"type": "string"
},
"storageUsageInBytes": {
"type": "integer"
},
"storageUsageInBytesSetAt": {
"format": "date-time",
"type": "string"
}
},
"required": [
"id",
"stackId",
"name",
"orphaned",
"storageUsageInBytes",
"storageUsageInBytesSetAt"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"id",
"projectId",
"description",
"disabled",
"prefix"
],
"type": "object"
},
"type": "array"
}
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/projects/f0f86186-0a5a-45b2-aa33-502777496347/stacks
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.container.listStacks({
"projectId": "f0f86186-0a5a-45b2-aa33-502777496347"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Container\ListStacks\ListStacksRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new ListStacksRequest(
projectId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->container()->listStacks($request);
var_dump($response->getBody();