diff --git a/api/server/httputils/errors.go b/api/server/httputils/errors.go index 17e98786f2..59098a9df0 100644 --- a/api/server/httputils/errors.go +++ b/api/server/httputils/errors.go @@ -62,7 +62,7 @@ func GetHTTPErrorStatusCode(err error) int { {"wrong login/password", http.StatusUnauthorized}, {"unauthorized", http.StatusUnauthorized}, {"hasn't been activated", http.StatusForbidden}, - {"this node", http.StatusNotAcceptable}, + {"this node", http.StatusServiceUnavailable}, } { if strings.Contains(errStr, status.keyword) { statusCode = status.code diff --git a/api/swagger.yaml b/api/swagger.yaml index 45c53189c4..9a7fca094c 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -6731,14 +6731,14 @@ paths: description: "bad parameter" schema: $ref: "#/definitions/ErrorResponse" - 406: - description: "node is already part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" 500: description: "server error" schema: $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" parameters: - name: "body" in: "body" @@ -6773,14 +6773,14 @@ paths: responses: 200: description: "no error" - 406: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" 500: description: "server error" schema: $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" parameters: - name: "force" description: "Force leave swarm, even if this is the last manager or that it will break the cluster." @@ -6800,14 +6800,14 @@ paths: description: "bad parameter" schema: $ref: "#/definitions/ErrorResponse" - 406: - description: "node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" 500: description: "server error" schema: $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" parameters: - name: "body" in: "body" @@ -6877,10 +6877,6 @@ paths: type: "string" example: ID: "ak7w3gjqoa3kuz8xcpnyy0pvl" - 406: - description: "server error or node is not part of a swarm" - schema: - $ref: "#/definitions/ErrorResponse" 409: description: "name conflicts with an existing service" schema: @@ -6889,6 +6885,10 @@ paths: description: "server error" schema: $ref: "#/definitions/ErrorResponse" + 503: + description: "server error or node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" parameters: - name: "body" in: "body" diff --git a/docs/reference/api/docker_remote_api_v1.25.md b/docs/reference/api/docker_remote_api_v1.25.md index 437fda069a..3728ae7b80 100644 --- a/docs/reference/api/docker_remote_api_v1.25.md +++ b/docs/reference/api/docker_remote_api_v1.25.md @@ -4821,7 +4821,7 @@ Initialize a new swarm. The body of the HTTP response includes the node ID. - **200** – no error - **400** – bad parameter -- **406** – node is already part of a swarm +- **503** – node is already part of a swarm JSON Parameters: @@ -4890,7 +4890,7 @@ Join an existing swarm - **200** – no error - **400** – bad parameter -- **406** – node is already part of a swarm +- **503** – node is already part of a swarm JSON Parameters: @@ -4928,7 +4928,7 @@ Leave a swarm **Status codes**: - **200** – no error -- **406** – node is not part of a swarm +- **503** – node is not part of a swarm ### Retrieve the swarm's unlock key @@ -5024,7 +5024,7 @@ Update a swarm - **200** – no error - **400** – bad parameter -- **406** – node is not part of a swarm +- **503** – node is not part of a swarm JSON Parameters: @@ -5268,8 +5268,8 @@ image](#create-an-image) section for more details. **Status codes**: - **201** – no error -- **406** – server error or node is not part of a swarm - **409** – name conflicts with an existing object +- **503** – server error or node is not part of a swarm **JSON Parameters**: @@ -6049,8 +6049,8 @@ Create a secret **Status codes**: - **201** – no error -- **406** – server error or node is not part of a swarm - **409** – name conflicts with an existing object +- **503** – server error or node is not part of a swarm **JSON Parameters**: