Skip to main content

Declaratively create, update or delete Services or Volumes belonging to a Stack

PUT/stacks/{stackId}/
v2
PUT
container-declare-stack

This command can be used to declare the desired state of a container stack.

Usage

Obtaining the default stack

Every mStudio project comes with a default stack named default. You can obtain the default stack by using the unknown operation container-list-stack operation.

Creating new stacks

Creating new stacks is not supported at this time. You can only manage the default stack.

Request

  • stackIdstring (uuid)
    required

    ID of the Stack to create, update or delete Services or Volumes for.

Responses

application/json

OK

  • descriptionstring
    required
  • disabledboolean
    required
  • idstring (uuid)
    required
  • prefixstring
    required

    Prefix for all service-names in this stack.

  • projectIdstring (uuid)
    required
  • servicesarray of object
    • Array[
    • *object
      • deployedStateobject
        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
    • ]
  • 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
      • namestring
        required
      • orphanedboolean
        required

        Whether the Volume is attached to a Stack.

      • stackIdstring (uuid)
        required
      • storageUsageInBytesinteger
        required
      • storageUsageInBytesSetAtstring (date-time)
        required
    • ]
  • Usage examples

    $ curl \
    --fail \
    --location \
    -X PUT \
    -d '{"services":{"string":{"command":["mysqld"],"description":"MySQL DB","entrypoint":["docker-entrypoint.sh"],"envs":{"MYSQL_DATABASE":"my_db","MYSQL_PASSWORD":"my_password","MYSQL_ROOT_PASSWORD":"my_root_password","MYSQL_USER":"my_user"},"image":"mysql","ports":["3306:3306/tcp"],"volumes":["data:/var/lib/mysql"]}},"volumes":{"string":{"name":"mysql-volume"}}}' \
    -H "Authorization: Bearer $MITTWALD_API_TOKEN" \
    -H 'Content-Type: application/json' \
    https://api.mittwald.de/v2/stacks/f0f86186-0a5a-45b2-aa33-502777496347