You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/swagger.yaml
+80Lines changed: 80 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7948,6 +7948,86 @@ paths:
7948
7948
required: true
7949
7949
type: "string"
7950
7950
tags: ["Task"]
7951
+
/tasks/{id}/logs:
7952
+
get:
7953
+
summary: "Get task logs"
7954
+
description: |
7955
+
Get `stdout` and `stderr` logs from a task.
7956
+
7957
+
**Note**: This endpoint works only for services with the `json-file` or `journald` logging drivers.
7958
+
operationId: "TaskLogs"
7959
+
produces:
7960
+
- "application/vnd.docker.raw-stream"
7961
+
- "application/json"
7962
+
responses:
7963
+
101:
7964
+
description: "logs returned as a stream"
7965
+
schema:
7966
+
type: "string"
7967
+
format: "binary"
7968
+
200:
7969
+
description: "logs returned as a string in response body"
7970
+
schema:
7971
+
type: "string"
7972
+
404:
7973
+
description: "no such task"
7974
+
schema:
7975
+
$ref: "#/definitions/ErrorResponse"
7976
+
examples:
7977
+
application/json:
7978
+
message: "No such task: c2ada9df5af8"
7979
+
500:
7980
+
description: "server error"
7981
+
schema:
7982
+
$ref: "#/definitions/ErrorResponse"
7983
+
503:
7984
+
description: "node is not part of a swarm"
7985
+
schema:
7986
+
$ref: "#/definitions/ErrorResponse"
7987
+
parameters:
7988
+
- name: "id"
7989
+
in: "path"
7990
+
required: true
7991
+
description: "ID of the task"
7992
+
type: "string"
7993
+
- name: "details"
7994
+
in: "query"
7995
+
description: "Show extra details provided to logs."
7996
+
type: "boolean"
7997
+
default: false
7998
+
- name: "follow"
7999
+
in: "query"
8000
+
description: |
8001
+
Return the logs as a stream.
8002
+
8003
+
This will return a `101` HTTP response with a `Connection: upgrade` header, then hijack the HTTP connection to send raw output. For more information about hijacking and the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
8004
+
type: "boolean"
8005
+
default: false
8006
+
- name: "stdout"
8007
+
in: "query"
8008
+
description: "Return logs from `stdout`"
8009
+
type: "boolean"
8010
+
default: false
8011
+
- name: "stderr"
8012
+
in: "query"
8013
+
description: "Return logs from `stderr`"
8014
+
type: "boolean"
8015
+
default: false
8016
+
- name: "since"
8017
+
in: "query"
8018
+
description: "Only return logs since this time, as a UNIX timestamp"
8019
+
type: "integer"
8020
+
default: 0
8021
+
- name: "timestamps"
8022
+
in: "query"
8023
+
description: "Add timestamps to every log line"
8024
+
type: "boolean"
8025
+
default: false
8026
+
- name: "tail"
8027
+
in: "query"
8028
+
description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines."
0 commit comments