Merge pull request #28532 from stevvooe/disabled-swarm-service-unavailable

api/server/httputils: service unavailable for disable swarm
This commit is contained in:
Michael Crosby 2016-11-17 15:16:23 -08:00 committed by GitHub
commit bbac9eeae6
3 changed files with 23 additions and 23 deletions

View file

@ -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

View file

@ -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"

View file

@ -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**: