Browse code

update status code for network api

Signed-off-by: allencloud <allen.sun@daocloud.io>

allencloud authored on 2017/02/03 14:19:22
Showing 5 changed files
... ...
@@ -6320,6 +6320,10 @@ paths:
6320 6320
           description: "Network not found"
6321 6321
           schema:
6322 6322
             $ref: "#/definitions/ErrorResponse"
6323
+        500:
6324
+          description: "Server error"
6325
+          schema:
6326
+            $ref: "#/definitions/ErrorResponse"
6323 6327
       parameters:
6324 6328
         - name: "id"
6325 6329
           in: "path"
... ...
@@ -6339,6 +6343,10 @@ paths:
6339 6339
       responses:
6340 6340
         204:
6341 6341
           description: "No error"
6342
+        403:
6343
+          description: "operation not supported for pre-defined networks"
6344
+          schema:
6345
+            $ref: "#/definitions/ErrorResponse"
6342 6346
         404:
6343 6347
           description: "no such network"
6344 6348
           schema:
... ...
@@ -2739,7 +2739,9 @@ Content-Type: application/json
2739 2739
 
2740 2740
 #### Inspect network
2741 2741
 
2742
-`GET /networks/<network-id>`
2742
+`GET /networks/(id or name)`
2743
+
2744
+Return low-level information on the network `id`
2743 2745
 
2744 2746
 **Example request**:
2745 2747
 
... ...
@@ -2787,6 +2789,7 @@ Content-Type: application/json
2787 2787
 
2788 2788
 -   **200** - no error
2789 2789
 -   **404** - network not found
2790
+-   **500** - server error
2790 2791
 
2791 2792
 #### Create a network
2792 2793
 
... ...
@@ -2853,7 +2856,7 @@ Content-Type: application/json
2853 2853
 
2854 2854
 #### Connect a container to a network
2855 2855
 
2856
-`POST /networks/(id)/connect`
2856
+`POST /networks/(id or name)/connect`
2857 2857
 
2858 2858
 Connect a container to a network
2859 2859
 
... ...
@@ -2884,7 +2887,7 @@ Content-Type: application/json
2884 2884
 
2885 2885
 #### Disconnect a container from a network
2886 2886
 
2887
-`POST /networks/(id)/disconnect`
2887
+`POST /networks/(id or name)/disconnect`
2888 2888
 
2889 2889
 Disconnect a container from a network
2890 2890
 
... ...
@@ -2915,7 +2918,7 @@ Content-Type: application/json
2915 2915
 
2916 2916
 #### Remove a network
2917 2917
 
2918
-`DELETE /networks/(id)`
2918
+`DELETE /networks/(id or name)`
2919 2919
 
2920 2920
 Instruct the driver to remove the network (`id`).
2921 2921
 
... ...
@@ -2930,6 +2933,7 @@ Instruct the driver to remove the network (`id`).
2930 2930
 **Status codes**:
2931 2931
 
2932 2932
 -   **200** - no error
2933
+-   **403** - operation not supported for pre-defined networks
2933 2934
 -   **404** - no such network
2934 2935
 -   **500** - server error
2935 2936
 
... ...
@@ -3055,7 +3055,9 @@ Content-Type: application/json
3055 3055
 
3056 3056
 #### Inspect network
3057 3057
 
3058
-`GET /networks/<network-id>`
3058
+`GET /networks/(id or name)`
3059
+
3060
+Return low-level information on the network `id`
3059 3061
 
3060 3062
 **Example request**:
3061 3063
 
... ...
@@ -3108,6 +3110,7 @@ Content-Type: application/json
3108 3108
 
3109 3109
 -   **200** - no error
3110 3110
 -   **404** - network not found
3111
+-   **500** - server error
3111 3112
 
3112 3113
 #### Create a network
3113 3114
 
... ...
@@ -3183,7 +3186,7 @@ Content-Type: application/json
3183 3183
 
3184 3184
 #### Connect a container to a network
3185 3185
 
3186
-`POST /networks/(id)/connect`
3186
+`POST /networks/(id or name)/connect`
3187 3187
 
3188 3188
 Connect a container to a network
3189 3189
 
... ...
@@ -3220,7 +3223,7 @@ Content-Type: application/json
3220 3220
 
3221 3221
 #### Disconnect a container from a network
3222 3222
 
3223
-`POST /networks/(id)/disconnect`
3223
+`POST /networks/(id or name)/disconnect`
3224 3224
 
3225 3225
 Disconnect a container from a network
3226 3226
 
... ...
@@ -3253,7 +3256,7 @@ Content-Type: application/json
3253 3253
 
3254 3254
 #### Remove a network
3255 3255
 
3256
-`DELETE /networks/(id)`
3256
+`DELETE /networks/(id or name)`
3257 3257
 
3258 3258
 Instruct the driver to remove the network (`id`).
3259 3259
 
... ...
@@ -3268,6 +3271,7 @@ Instruct the driver to remove the network (`id`).
3268 3268
 **Status codes**:
3269 3269
 
3270 3270
 -   **200** - no error
3271
+-   **403** - operation not supported for pre-defined networks
3271 3272
 -   **404** - no such network
3272 3273
 -   **500** - server error
3273 3274
 
... ...
@@ -3150,7 +3150,9 @@ Content-Type: application/json
3150 3150
 
3151 3151
 #### Inspect network
3152 3152
 
3153
-`GET /networks/<network-id>`
3153
+`GET /networks/(id or name)`
3154
+
3155
+Return low-level information on the network `id`
3154 3156
 
3155 3157
 **Example request**:
3156 3158
 
... ...
@@ -3209,6 +3211,7 @@ Content-Type: application/json
3209 3209
 
3210 3210
 -   **200** - no error
3211 3211
 -   **404** - network not found
3212
+-   **500** - server error
3212 3213
 
3213 3214
 #### Create a network
3214 3215
 
... ...
@@ -3300,7 +3303,7 @@ Content-Type: application/json
3300 3300
 
3301 3301
 #### Connect a container to a network
3302 3302
 
3303
-`POST /networks/(id)/connect`
3303
+`POST /networks/(id or name)/connect`
3304 3304
 
3305 3305
 Connect a container to a network
3306 3306
 
... ...
@@ -3337,7 +3340,7 @@ Content-Type: application/json
3337 3337
 
3338 3338
 #### Disconnect a container from a network
3339 3339
 
3340
-`POST /networks/(id)/disconnect`
3340
+`POST /networks/(id or name)/disconnect`
3341 3341
 
3342 3342
 Disconnect a container from a network
3343 3343
 
... ...
@@ -3370,7 +3373,7 @@ Content-Type: application/json
3370 3370
 
3371 3371
 #### Remove a network
3372 3372
 
3373
-`DELETE /networks/(id)`
3373
+`DELETE /networks/(id or name)`
3374 3374
 
3375 3375
 Instruct the driver to remove the network (`id`).
3376 3376
 
... ...
@@ -3385,6 +3388,7 @@ Instruct the driver to remove the network (`id`).
3385 3385
 **Status codes**:
3386 3386
 
3387 3387
 -   **204** - no error
3388
+-   **403** - operation not supported for pre-defined networks
3388 3389
 -   **404** - no such network
3389 3390
 -   **500** - server error
3390 3391
 
... ...
@@ -3214,7 +3214,9 @@ Content-Type: application/json
3214 3214
 
3215 3215
 #### Inspect network
3216 3216
 
3217
-`GET /networks/<network-id>`
3217
+`GET /networks/(id or name)`
3218
+
3219
+Return low-level information on the network `id`
3218 3220
 
3219 3221
 **Example request**:
3220 3222
 
... ...
@@ -3273,6 +3275,7 @@ Content-Type: application/json
3273 3273
 
3274 3274
 -   **200** - no error
3275 3275
 -   **404** - network not found
3276
+-   **500** - server error
3276 3277
 
3277 3278
 #### Create a network
3278 3279
 
... ...
@@ -3365,7 +3368,7 @@ Content-Type: application/json
3365 3365
 
3366 3366
 #### Connect a container to a network
3367 3367
 
3368
-`POST /networks/(id)/connect`
3368
+`POST /networks/(id or name)/connect`
3369 3369
 
3370 3370
 Connect a container to a network
3371 3371
 
... ...
@@ -3403,7 +3406,7 @@ Content-Type: application/json
3403 3403
 
3404 3404
 #### Disconnect a container from a network
3405 3405
 
3406
-`POST /networks/(id)/disconnect`
3406
+`POST /networks/(id or name)/disconnect`
3407 3407
 
3408 3408
 Disconnect a container from a network
3409 3409
 
... ...
@@ -3437,7 +3440,7 @@ Content-Type: application/json
3437 3437
 
3438 3438
 #### Remove a network
3439 3439
 
3440
-`DELETE /networks/(id)`
3440
+`DELETE /networks/(id or name)`
3441 3441
 
3442 3442
 Instruct the driver to remove the network (`id`).
3443 3443
 
... ...
@@ -3452,6 +3455,7 @@ Instruct the driver to remove the network (`id`).
3452 3452
 **Status codes**:
3453 3453
 
3454 3454
 -   **204** - no error
3455
+-   **403** - operation not supported for pre-defined networks
3455 3456
 -   **404** - no such network
3456 3457
 -   **500** - server error
3457 3458