Skip to main content

Get a Service belonging to a Stack

GET/v2/stacks/{stackId}/services/{serviceId}/
v2
GET
container-get-service

Request

  • stackIdstring (uuid)
    required

    ID of the Stack the Service belongs to. ID of the default Stack equals the ID of the Project.

  • serviceIdstring
    required

    ID of the Service to be retrieved.

Responses

application/json

OK

  • deployobject
    • resourcesobject
      • limits
        • cpusstring

          CPU limit for the container. The value can be specified as a decimal number, where 1 corresponds to one full CPU core. For example, 0.5 means that the container is limited to using half of a CPU core.

        • memorystring

          Memory limit for the container. The value can be specified in bytes or using a suffix to indicate the unit.

          The format matches the one used by Docker Compose:

          Values express a byte value as a string in {amount}{byte unit} format: The supported units are b (bytes), k or kb (kilo bytes), m or mb (mega bytes) and g or gb (giga bytes).

  • deployedStateobject
    required

    The actual state of the container that is currently deployed.

    • commandarray of string

      The container command (equivalent to the Docker cmd). When omitted, this defaults to the command defined in the image.

      • Array[
        • *string
        ]
    • entrypointarray of string

      The container entrypoint (equivalent to the Docker entrypoint). When omitted, this defaults to the entrypoint defined in the image.

      • Array[
        • *string
        ]
    • envsobject

      Key-value map of environment variables that should be passed into the container.

      • *string
    • imagestring
      required

      The image to run, in the usual format also used by docker run and docker compose. When the image is pulled from a private registry, make sure to create it first, using the container-create-registry endpoint. The appropriate registry is matched by hostname.

    • imageDigeststring

      The digest of the image that is currently deployed.

    • portsarray of string

      Exposed ports. Follows the format <public-port>:<container-port>/<protocol>. Exposed ports can be accessed from other containers (or managed apps) within the same project. To expose a port publicly, connect it with an ingress resource.

      • Array[
        • *string
        ]
    • volumesarray of string

      Volume mounts for this container. These items always follow the format <volume>:<mountpoint>. The <volume> may either be a named volume, or a file path in the (always present) project file system (which is shared among containers and managed apps within a project).

      • Array[
        • *string
        ]
  • descriptionstring
    required
  • idstring (uuid)
    required
  • messagestring

    Message explaining the current state of the container. This may contain information about the current state of the container, or errors that occurred during deployment.

  • pendingStateobject
    required

    The desired state that is waiting to be reconciled.

    • commandarray of string

      The container command (equivalent to the Docker cmd). When omitted, this defaults to the command defined in the image.

      • Array[
        • *string
        ]
    • entrypointarray of string

      The container entrypoint (equivalent to the Docker entrypoint). When omitted, this defaults to the entrypoint defined in the image.

      • Array[
        • *string
        ]
    • envsobject

      Key-value map of environment variables that should be passed into the container.

      • *string
    • imagestring
      required

      The image to run, in the usual format also used by docker run and docker compose. When the image is pulled from a private registry, make sure to create it first, using the container-create-registry endpoint. The appropriate registry is matched by hostname.

    • imageDigeststring

      The digest of the image that is currently deployed.

    • portsarray of string

      Exposed ports. Follows the format <public-port>:<container-port>/<protocol>. Exposed ports can be accessed from other containers (or managed apps) within the same project. To expose a port publicly, connect it with an ingress resource.

      • Array[
        • *string
        ]
    • volumesarray of string

      Volume mounts for this container. These items always follow the format <volume>:<mountpoint>. The <volume> may either be a named volume, or a file path in the (always present) project file system (which is shared among containers and managed apps within a project).

      • Array[
        • *string
        ]
  • requiresRecreateboolean
    required
  • serviceNamestring
    required
  • shortIdstring
    required

    A short ID of the container. This is a unique identifier for the container within the project, and can be used to reference it in other API calls, or for SSH connections.

  • statusstring (one of: running, stopped, restarting, error, creating, starting)
    required
  • statusSetAtstring (date-time)
    required

Usage examples

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/stacks/f0f86186-0a5a-45b2-aa33-502777496347/services/string