---
title: "List services"
method: GET
path: "/services"
tags: ["Service"]
---

# List services

`GET /services`

## Query parameters

- `filters` string

## Response `200`

no error

- Service[]
  - `CreatedAt` string, dateTime
  - `Endpoint` object
    - `Ports` EndpointPortConfig[]
      - `Name` string
      - `Protocol` 'tcp' | 'udp'
      - `PublishedPort` integer — The port on the swarm hosts.
      - `TargetPort` integer — The port inside the container.
    - `Spec` EndpointSpec — Properties that can be configured to access and load balance a service.
      - `Mode` 'vip' | 'dnsrr' — The mode of resolution to use for internal load balancing between tasks.
      - `Ports` EndpointPortConfig[] — List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used.
        - `Name` string
        - `Protocol` 'tcp' | 'udp'
        - `PublishedPort` integer — The port on the swarm hosts.
        - `TargetPort` integer — The port inside the container.
    - `VirtualIPs` object[]
      - `Addr` string
      - `NetworkID` string
  - `ID` string
  - `Spec` ServiceSpec — User modifiable configuration for a service.
    - `EndpointSpec` EndpointSpec — Properties that can be configured to access and load balance a service.
      - `Mode` 'vip' | 'dnsrr' — The mode of resolution to use for internal load balancing between tasks.
      - `Ports` EndpointPortConfig[] — List of exposed ports that this service is accessible on from the outside. Ports can only be provided if `vip` resolution mode is used.
        - `Name` string
        - `Protocol` 'tcp' | 'udp'
        - `PublishedPort` integer — The port on the swarm hosts.
        - `TargetPort` integer — The port inside the container.
    - `Labels` object — User-defined key/value metadata.
    - `Mode` object — Scheduling mode for the service.
      - `Global` object
      - `Replicated` object
        - `Replicas` integer
    - `Name` string — Name of the service.
    - `Networks` object[] — Array of network names or IDs to attach the service to.
      - `Aliases` string[]
      - `Target` string
    - `RollbackConfig` object — Specification for the rollback strategy of the service.
      - `Delay` integer — Amount of time between rollback iterations, in nanoseconds.
      - `FailureAction` 'continue' | 'pause' — Action to take if an rolled back task fails to run, or stops running during the rollback.
      - `MaxFailureRatio` number — The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1.
      - `Monitor` integer — Amount of time to monitor each rolled back task for failures, in nanoseconds.
      - `Order` 'stop-first' | 'start-first' — The order of operations when rolling back a task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down.
      - `Parallelism` integer — Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism).
    - `TaskTemplate` TaskSpec — User modifiable task configuration.
      - `ContainerSpec` object — Invalid when specified with `PluginSpec`.
        - `Args` string[] — Arguments to the command.
        - `Command` string[] — The command to be run in the image.
        - `Configs` object[] — Configs contains references to zero or more configs that will be exposed to the service.
          - `ConfigID` string — ConfigID represents the ID of the specific config that we're referencing.
          - `ConfigName` string — ConfigName is the name of the config that this references, but this is just provided for lookup/display purposes. The config in the reference will be identified by its ID.
          - `File` object — File represents a specific target that is backed by a file.
            - `GID` string — GID represents the file GID.
            - `Mode` integer — Mode represents the FileMode of the file.
            - `Name` string — Name represents the final filename in the filesystem.
            - `UID` string — UID represents the file UID.
        - `DNSConfig` object — Specification for DNS related configurations in resolver configuration file (`resolv.conf`).
          - `Nameservers` string[] — The IP addresses of the name servers.
          - `Options` string[] — A list of internal resolver variables to be modified (e.g., `debug`, `ndots:3`, etc.).
          - `Search` string[] — A search list for host-name lookup.
        - `Dir` string — The working directory for commands to run in.
        - `Env` string[] — A list of environment variables in the form `VAR=value`.
        - `Groups` string[] — A list of additional groups that the container process will run as.
        - `HealthCheck` HealthConfig — A test to perform to check that the container is healthy.
          - `Interval` integer — The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
          - `Retries` integer — The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit.
          - `StartPeriod` integer — Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
          - `Test` string[] — The test to perform. Possible values are: - `[]` inherit healthcheck from image or parent image - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell
          - `Timeout` integer — The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit.
        - `Hostname` string — The hostname to use for the container, as a valid RFC 1123 hostname.
        - `Hosts` string[] — A list of hostname/IP mappings to add to the container's `hosts` file. The format of extra hosts is specified in the [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) man page: IP_address canonical_hostname [aliases...]
        - `Image` string — The image name to use for the container
        - `Labels` object — User-defined key/value data.
        - `Mounts` Mount[] — Specification for mounts to be added to containers created as part of the service.
          - `BindOptions` object — Optional configuration for the `bind` type.
            - `Propagation` 'private' | 'rprivate' | 'shared' | 'rshared' | 'slave' | 'rslave' — A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
          - `Consistency` string — The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`.
          - `ReadOnly` boolean — Whether the mount should be read-only.
          - `Source` string — Mount source (e.g. a volume name, a host path).
          - `Target` string — Container path.
          - `TmpfsOptions` object — Optional configuration for the `tmpfs` type.
            - `Mode` integer — The permission mode for the tmpfs mount in an integer.
            - `SizeBytes` integer — The size for the tmpfs mount in bytes.
          - `Type` 'bind' | 'volume' | 'tmpfs' — The mount type. Available types: - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs.
          - `VolumeOptions` object — Optional configuration for the `volume` type.
            - `DriverConfig` object — Map of driver specific options
              - …
            - `Labels` object — User-defined key/value metadata.
            - `NoCopy` boolean — Populate volume with data from the target.
        - `OpenStdin` boolean — Open `stdin`
        - `Privileges` object — Security options for the container
          - `CredentialSpec` object — CredentialSpec for managed service account (Windows only)
            - `File` string — Load credential spec from this file. The file is read by the daemon, and must be present in the `CredentialSpecs` subdirectory in the docker data directory, which defaults to `C:\ProgramData\Docker\` on Windows. For example, specifying `spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`. <p><br /></p> > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.
            - `Registry` string — Load credential spec from this value in the Windows registry. The specified registry value must be located in: `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` <p><br /></p> > **Note**: `CredentialSpec.File` and `CredentialSpec.Registry` are mutually exclusive.
          - `SELinuxContext` object — SELinux labels of the container
            - `Disable` boolean — Disable SELinux
            - `Level` string — SELinux level label
            - `Role` string — SELinux role label
            - `Type` string — SELinux type label
            - `User` string — SELinux user label
        - `ReadOnly` boolean — Mount the container's root filesystem as read only.
        - `Secrets` object[] — Secrets contains references to zero or more secrets that will be exposed to the service.
          - `File` object — File represents a specific target that is backed by a file.
            - `GID` string — GID represents the file GID.
            - `Mode` integer — Mode represents the FileMode of the file.
            - `Name` string — Name represents the final filename in the filesystem.
            - `UID` string — UID represents the file UID.
          - `SecretID` string — SecretID represents the ID of the specific secret that we're referencing.
          - `SecretName` string — SecretName is the name of the secret that this references, but this is just provided for lookup/display purposes. The secret in the reference will be identified by its ID.
        - `StopGracePeriod` integer — Amount of time to wait for the container to terminate before forcefully killing it.
        - `StopSignal` string — Signal to stop the container.
        - `TTY` boolean — Whether a pseudo-TTY should be allocated.
        - `User` string — The user inside the container.
      - `ForceUpdate` integer — A counter that triggers an update even if no relevant parameters have been changed.
      - `LogDriver` object — Specifies the log driver to use for tasks created from this spec. If not present, the default one for the swarm will be used, finally falling back to the engine default if not specified.
        - `Name` string
        - `Options` object
      - `Networks` object[]
        - `Aliases` string[]
        - `Target` string
      - `Placement` object
        - `Constraints` string[] — An array of constraints.
        - `Platforms` Platform[] — Platforms stores all the platforms that the service's image can run on. This field is used in the platform filter for scheduling. If empty, then the platform filter is off, meaning there are no scheduling restrictions.
          - `Architecture` string — Architecture represents the hardware architecture (for example, `x86_64`).
          - `OS` string — OS represents the Operating System (for example, `linux` or `windows`).
        - `Preferences` object[] — Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence.
          - `Spread` object
            - `SpreadDescriptor` string — label descriptor, such as engine.labels.az
      - `PluginSpec` object — Invalid when specified with `ContainerSpec`. *(Experimental release only.)*
        - `Disabled` boolean — Disable the plugin once scheduled.
        - `Name` string — The name or 'alias' to use for the plugin.
        - `PluginPrivilege` object[]
          - `Description` string
          - `Name` string
          - `Value` string[]
        - `Remote` string — The plugin image reference to use.
      - `Resources` object — Resource requirements which apply to each individual container created as part of the service.
        - `Limits` ResourceObject — An object describing the resources which can be advertised by a node and requested by a task
          - `GenericResources` object[] — User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`)
            - `DiscreteResourceSpec` object
              - …
            - `NamedResourceSpec` object
              - …
          - `MemoryBytes` integer
          - `NanoCPUs` integer
        - `Reservation` ResourceObject — An object describing the resources which can be advertised by a node and requested by a task
          - `GenericResources` object[] — User-defined resources can be either Integer resources (e.g, `SSD=3`) or String resources (e.g, `GPU=UUID1`)
            - `DiscreteResourceSpec` object
              - …
            - `NamedResourceSpec` object
              - …
          - `MemoryBytes` integer
          - `NanoCPUs` integer
      - `RestartPolicy` object — Specification for the restart policy which applies to containers created as part of this service.
        - `Condition` 'none' | 'on-failure' | 'any' — Condition for restart.
        - `Delay` integer — Delay between restart attempts.
        - `MaxAttempts` integer — Maximum attempts to restart a given container before giving up (default value is 0, which is ignored).
        - `Window` integer — Windows is the time window used to evaluate the restart policy (default value is 0, which is unbounded).
      - `Runtime` string — Runtime is the type of runtime specified for the task executor.
    - `UpdateConfig` object — Specification for the update strategy of the service.
      - `Delay` integer — Amount of time between updates, in nanoseconds.
      - `FailureAction` 'continue' | 'pause' | 'rollback' — Action to take if an updated task fails to run, or stops running during the update.
      - `MaxFailureRatio` number — The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1.
      - `Monitor` integer — Amount of time to monitor each updated task for failures, in nanoseconds.
      - `Order` 'stop-first' | 'start-first' — The order of operations when rolling out an updated task. Either the old task is shut down before the new task is started, or the new task is started before the old task is shut down.
      - `Parallelism` integer — Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism).
  - `UpdateStatus` object — The status of a service update.
    - `CompletedAt` string, dateTime
    - `Message` string
    - `StartedAt` string, dateTime
    - `State` 'updating' | 'paused' | 'completed'
  - `UpdatedAt` string, dateTime
  - `Version` ObjectVersion — The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. The client must send the version number along with the modified specification when updating these objects. This approach ensures safe concurrency and determinism in that the change on the object may not be applied if the version number has changed from the last read. In other words, if two update requests specify the same base version, only one of the requests can succeed. As a result, two separate update requests that happen at the same time will not unintentionally overwrite each other.
    - `Index` integer

## Other responses

- `500` — server error
- `503` — node is not part of a swarm

---

[API](https://skmtc.net/docker/apis/engine.md) · [All operations](https://skmtc.net/docker/apis/engine/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docker/engine/versions/400730735b03/schema)
