Commit cc493a52a46271df82dbebea26038502b85788b9 added
a constraint to network connect/disconnect operations
on "Swarm scoped" networks.
This adds those errors to the API documentation. Also
changes the error to lowercase for consistency.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b0089e48272f18d856ba147b393371c18d5683fb)
Signed-off-by: Tibor Vass <tibor@docker.com>
| ... | ... |
@@ -121,7 +121,7 @@ func (n *networkRouter) postNetworkConnect(ctx context.Context, w http.ResponseW |
| 121 | 121 |
} |
| 122 | 122 |
|
| 123 | 123 |
if nw.Info().Dynamic() {
|
| 124 |
- return newNetworkForbiddenError("Operation not supported for swarm scoped networks")
|
|
| 124 |
+ return newNetworkForbiddenError("operation not supported for swarm scoped networks")
|
|
| 125 | 125 |
} |
| 126 | 126 |
|
| 127 | 127 |
return n.backend.ConnectContainerToNetwork(connect.Container, nw.Name(), connect.EndpointConfig) |
| ... | ... |
@@ -147,7 +147,7 @@ func (n *networkRouter) postNetworkDisconnect(ctx context.Context, w http.Respon |
| 147 | 147 |
} |
| 148 | 148 |
|
| 149 | 149 |
if nw.Info().Dynamic() {
|
| 150 |
- return newNetworkForbiddenError("Operation not supported for swarm scoped networks")
|
|
| 150 |
+ return newNetworkForbiddenError("operation not supported for swarm scoped networks")
|
|
| 151 | 151 |
} |
| 152 | 152 |
|
| 153 | 153 |
return n.backend.DisconnectContainerFromNetwork(disconnect.Container, nw, disconnect.Force) |
| ... | ... |
@@ -3260,6 +3260,7 @@ Content-Type: application/json |
| 3260 | 3260 |
**Status codes**: |
| 3261 | 3261 |
|
| 3262 | 3262 |
- **200** - no error |
| 3263 |
+- **403** - operation not supported for swarm scoped networks |
|
| 3263 | 3264 |
- **404** - network or container is not found |
| 3264 | 3265 |
- **500** - Internal Server Error |
| 3265 | 3266 |
|
| ... | ... |
@@ -3292,6 +3293,7 @@ Content-Type: application/json |
| 3292 | 3292 |
**Status codes**: |
| 3293 | 3293 |
|
| 3294 | 3294 |
- **200** - no error |
| 3295 |
+- **403** - operation not supported for swarm scoped networks |
|
| 3295 | 3296 |
- **404** - network or container not found |
| 3296 | 3297 |
- **500** - Internal Server Error |
| 3297 | 3298 |
|