From 56dca8b676cee2781021cb1138f48d42ace415a4 Mon Sep 17 00:00:00 2001 From: allencloud Date: Fri, 3 Feb 2017 13:19:22 +0800 Subject: [PATCH] update status code for network api Signed-off-by: allencloud --- api/swagger.yaml | 8 ++++++++ docs/api/v1.21.md | 12 ++++++++---- docs/api/v1.22.md | 12 ++++++++---- docs/api/v1.23.md | 12 ++++++++---- docs/api/v1.24.md | 12 ++++++++---- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/api/swagger.yaml b/api/swagger.yaml index 68ca5d0162..01f9d5d233 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -6320,6 +6320,10 @@ paths: description: "Network not found" schema: $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" parameters: - name: "id" in: "path" @@ -6339,6 +6343,10 @@ paths: responses: 204: description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" 404: description: "no such network" schema: diff --git a/docs/api/v1.21.md b/docs/api/v1.21.md index cb72b6811e..1d42fd0ecc 100644 --- a/docs/api/v1.21.md +++ b/docs/api/v1.21.md @@ -2739,7 +2739,9 @@ Content-Type: application/json #### Inspect network -`GET /networks/` +`GET /networks/(id or name)` + +Return low-level information on the network `id` **Example request**: @@ -2787,6 +2789,7 @@ Content-Type: application/json - **200** - no error - **404** - network not found +- **500** - server error #### Create a network @@ -2853,7 +2856,7 @@ Content-Type: application/json #### Connect a container to a network -`POST /networks/(id)/connect` +`POST /networks/(id or name)/connect` Connect a container to a network @@ -2884,7 +2887,7 @@ Content-Type: application/json #### Disconnect a container from a network -`POST /networks/(id)/disconnect` +`POST /networks/(id or name)/disconnect` Disconnect a container from a network @@ -2915,7 +2918,7 @@ Content-Type: application/json #### Remove a network -`DELETE /networks/(id)` +`DELETE /networks/(id or name)` Instruct the driver to remove the network (`id`). @@ -2930,6 +2933,7 @@ Instruct the driver to remove the network (`id`). **Status codes**: - **200** - no error +- **403** - operation not supported for pre-defined networks - **404** - no such network - **500** - server error diff --git a/docs/api/v1.22.md b/docs/api/v1.22.md index 0c5a061272..9bf64b7e94 100644 --- a/docs/api/v1.22.md +++ b/docs/api/v1.22.md @@ -3055,7 +3055,9 @@ Content-Type: application/json #### Inspect network -`GET /networks/` +`GET /networks/(id or name)` + +Return low-level information on the network `id` **Example request**: @@ -3108,6 +3110,7 @@ Content-Type: application/json - **200** - no error - **404** - network not found +- **500** - server error #### Create a network @@ -3183,7 +3186,7 @@ Content-Type: application/json #### Connect a container to a network -`POST /networks/(id)/connect` +`POST /networks/(id or name)/connect` Connect a container to a network @@ -3220,7 +3223,7 @@ Content-Type: application/json #### Disconnect a container from a network -`POST /networks/(id)/disconnect` +`POST /networks/(id or name)/disconnect` Disconnect a container from a network @@ -3253,7 +3256,7 @@ Content-Type: application/json #### Remove a network -`DELETE /networks/(id)` +`DELETE /networks/(id or name)` Instruct the driver to remove the network (`id`). @@ -3268,6 +3271,7 @@ Instruct the driver to remove the network (`id`). **Status codes**: - **200** - no error +- **403** - operation not supported for pre-defined networks - **404** - no such network - **500** - server error diff --git a/docs/api/v1.23.md b/docs/api/v1.23.md index a5006eb33d..508a721c75 100644 --- a/docs/api/v1.23.md +++ b/docs/api/v1.23.md @@ -3150,7 +3150,9 @@ Content-Type: application/json #### Inspect network -`GET /networks/` +`GET /networks/(id or name)` + +Return low-level information on the network `id` **Example request**: @@ -3209,6 +3211,7 @@ Content-Type: application/json - **200** - no error - **404** - network not found +- **500** - server error #### Create a network @@ -3300,7 +3303,7 @@ Content-Type: application/json #### Connect a container to a network -`POST /networks/(id)/connect` +`POST /networks/(id or name)/connect` Connect a container to a network @@ -3337,7 +3340,7 @@ Content-Type: application/json #### Disconnect a container from a network -`POST /networks/(id)/disconnect` +`POST /networks/(id or name)/disconnect` Disconnect a container from a network @@ -3370,7 +3373,7 @@ Content-Type: application/json #### Remove a network -`DELETE /networks/(id)` +`DELETE /networks/(id or name)` Instruct the driver to remove the network (`id`). @@ -3385,6 +3388,7 @@ Instruct the driver to remove the network (`id`). **Status codes**: - **204** - no error +- **403** - operation not supported for pre-defined networks - **404** - no such network - **500** - server error diff --git a/docs/api/v1.24.md b/docs/api/v1.24.md index b7586c93ea..ba98e18583 100644 --- a/docs/api/v1.24.md +++ b/docs/api/v1.24.md @@ -3214,7 +3214,9 @@ Content-Type: application/json #### Inspect network -`GET /networks/` +`GET /networks/(id or name)` + +Return low-level information on the network `id` **Example request**: @@ -3273,6 +3275,7 @@ Content-Type: application/json - **200** - no error - **404** - network not found +- **500** - server error #### Create a network @@ -3365,7 +3368,7 @@ Content-Type: application/json #### Connect a container to a network -`POST /networks/(id)/connect` +`POST /networks/(id or name)/connect` Connect a container to a network @@ -3403,7 +3406,7 @@ Content-Type: application/json #### Disconnect a container from a network -`POST /networks/(id)/disconnect` +`POST /networks/(id or name)/disconnect` Disconnect a container from a network @@ -3437,7 +3440,7 @@ Content-Type: application/json #### Remove a network -`DELETE /networks/(id)` +`DELETE /networks/(id or name)` Instruct the driver to remove the network (`id`). @@ -3452,6 +3455,7 @@ Instruct the driver to remove the network (`id`). **Status codes**: - **204** - no error +- **403** - operation not supported for pre-defined networks - **404** - no such network - **500** - server error