Search or ask Docker

List services

GET /services — Docker Engine API 1.57.

View Markdown
GET/services

Connection and access

API connection and authentication guidance

/v1.57

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

Parameters

filters query

A JSON encoded value of the filters (a map[string][]string) to process on the services list.

Available filters:

  • id=<service id>
  • label=<service label>
  • mode=["replicated"|"global"]
  • name=<service name>

Type: string

All schema constraints and annotations
{
  "type": "string"
}

status query

Include service status, with count of running and desired tasks.

Type: boolean

All schema constraints and annotations
{
  "type": "boolean"
}

Request and responses

Response 200

no error

application/json

Type: array

Array item

Schema: Service

All schema constraints and annotations
{
  "items": {
    "$ref": "#/components/schemas/Service"
  },
  "type": "array"
}

Response 200

no error

text/plain

Type: array

Array item

Schema: Service

All schema constraints and annotations
{
  "items": {
    "$ref": "#/components/schemas/Service"
  },
  "type": "array"
}

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 503

node is not part of a swarm

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ErrorResponse

#/components/schemas/Service

Complete operation contract
{
  "operationId": "ServiceList",
  "parameters": [
    {
      "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the services list.\n\nAvailable filters:\n\n- `id=\u003cservice id\u003e`\n- `label=\u003cservice label\u003e`\n- `mode=[\"replicated\"|\"global\"]`\n- `name=\u003cservice name\u003e`\n",
      "in": "query",
      "name": "filters",
      "schema": {
        "type": "string"
      }
    },
    {
      "description": "Include service status, with count of running and desired tasks.\n",
      "in": "query",
      "name": "status",
      "schema": {
        "type": "boolean"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "type": "array"
          }
        },
        "text/plain": {
          "schema": {
            "items": {
              "$ref": "#/components/schemas/Service"
            },
            "type": "array"
          }
        }
      },
      "description": "no error"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "node is not part of a swarm"
    }
  },
  "summary": "List services",
  "tags": [
    "Service"
  ]
}