diff --git a/api/README.md b/api/README.md index 4496992c6e..e560083f00 100644 --- a/api/README.md +++ b/api/README.md @@ -49,6 +49,9 @@ DELETE "/images/{name:.*}" ``` * `GET "/containers/{name:.*}/json"`: `HostIP` replaced by the the actual Node's IP if `HostIP` is `0.0.0.0` -* `GET "/containers"/json"`: Node's name prepended to the container name. +* `GET "/containers/json"`: Node's name prepended to the container name. + +* `GET "/containers/json"`: `HostIP` replaced by the the actual Node's IP if `HostIP` is `0.0.0.0` + +* `GET "/containers/json"` : Containers started from the `swarm` official image are hidden by default, use `all=1` to display them. -* `GET "/containers"/json"`: `HostIP` replaed by the the actual Node's IP if `HostIP` is `0.0.0.0` diff --git a/api/api.go b/api/api.go index e003faffa0..9e506368c9 100644 --- a/api/api.go +++ b/api/api.go @@ -136,6 +136,10 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) { if !strings.Contains(tmp.Status, "Up") && !all { continue } + // Skip swarm containers unless -a was specified. + if strings.Split(tmp.Image, ":")[0] == "swarm" && !all { + continue + } if !container.Node.IsHealthy() { tmp.Status = "Pending" }