List processes running inside a container Run in API Explorer

GET /containers/{id}/top

On Unix systems, this is done by running the ps command. This endpoint is not supported on Windows.

Path parameters

  • id string Required

    ID or name of the container

Query parameters

  • ps_args string

    The arguments to pass to ps. For example, aux

    Default value is -ef.

Responses

  • 200 application/json

    no error

    Hide response attributes Show response attributes object
    • Titles array[string]

      The ps column titles

    • Processes array[array]

      Each process running in the container, where each is process is an array of values corresponding to the titles.

  • 404 application/json

    no such container

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

GET /containers/{id}/top
curl \
 --request GET 'http://api.example.com/v1.44/containers/{id}/top'
Response examples (200)
{
  "Titles": [
    "UID",
    "PID",
    "PPID",
    "C",
    "STIME",
    "TTY",
    "TIME",
    "CMD"
  ],
  "Processes": [
    [
      "root",
      "13642",
      "882",
      "0",
      "17:03",
      "pts/0",
      "00:00:00",
      "/bin/bash"
    ],
    [
      "root",
      "13735",
      "13642",
      "0",
      "17:06",
      "pts/0",
      "00:00:00",
      "sleep 10"
    ]
  ]
}
Response examples (200)
{
  "Titles": [
    "string"
  ],
  "Processes": [
    [
      "string"
    ]
  ]
}
Response examples (404)
{
  "message": "No such container: c2ada9df5af8"
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}