summaryrefslogtreecommitdiff
path: root/pkg/api/server/register_networks.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-22 16:19:11 -0400
committerGitHub <noreply@github.com>2020-10-22 16:19:11 -0400
commita53a660313c6539c3e4a3558beb49836ca76d46f (patch)
tree3b887656f560a4d997a7456572738088e5ad8892 /pkg/api/server/register_networks.go
parentd340f8523c9610644c8a195d1e3e9b3a5d32c5b3 (diff)
parent68419365257f1fcaa638605576a0583ef282a5a5 (diff)
downloadpodman-a53a660313c6539c3e4a3558beb49836ca76d46f.tar.gz
podman-a53a660313c6539c3e4a3558beb49836ca76d46f.tar.bz2
podman-a53a660313c6539c3e4a3558beb49836ca76d46f.zip
Merge pull request #8078 from baude/networkdisconnect
APIv2 compatibility network connect|disconnect
Diffstat (limited to 'pkg/api/server/register_networks.go')
-rw-r--r--pkg/api/server/register_networks.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkg/api/server/register_networks.go b/pkg/api/server/register_networks.go
index 61916eedf..6222006e5 100644
--- a/pkg/api/server/register_networks.go
+++ b/pkg/api/server/register_networks.go
@@ -98,6 +98,63 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
// $ref: "#/responses/InternalError"
r.HandleFunc(VersionedPath("/networks/create"), s.APIHandler(compat.CreateNetwork)).Methods(http.MethodPost)
r.HandleFunc("/networks/create", s.APIHandler(compat.CreateNetwork)).Methods(http.MethodPost)
+ // swagger:operation POST /networks/{name}/connect compat compatConnectNetwork
+ // ---
+ // tags:
+ // - networks (compat)
+ // summary: Connect container to network
+ // description: Connect a container to a network. This endpoint is current a no-op
+ // produces:
+ // - application/json
+ // parameters:
+ // - in: path
+ // name: name
+ // type: string
+ // required: true
+ // description: the name of the network
+ // - in: body
+ // name: create
+ // description: attributes for connecting a container to a network
+ // schema:
+ // $ref: "#/definitions/NetworkConnectRequest"
+ // responses:
+ // 200:
+ // description: OK
+ // 400:
+ // $ref: "#/responses/BadParamError"
+ // 500:
+ // $ref: "#/responses/InternalError"
+ r.HandleFunc(VersionedPath("/networks/{name}/connect"), s.APIHandler(compat.Connect)).Methods(http.MethodPost)
+ r.HandleFunc("/networks/{name}/connect", s.APIHandler(compat.Connect)).Methods(http.MethodPost)
+ // swagger:operation POST /networks/{name}/disconnect compat compatDisconnectNetwork
+ // ---
+ // tags:
+ // - networks (compat)
+ // summary: Disconnect container from network
+ // description: Disconnect a container from a network. This endpoint is current a no-op
+ // produces:
+ // - application/json
+ // parameters:
+ // - in: path
+ // name: name
+ // type: string
+ // required: true
+ // description: the name of the network
+ // - in: body
+ // name: create
+ // description: attributes for disconnecting a container from a network
+ // schema:
+ // $ref: "#/definitions/NetworkDisconnectRequest"
+ // responses:
+ // 200:
+ // description: OK
+ // 400:
+ // $ref: "#/responses/BadParamError"
+ // 500:
+ // $ref: "#/responses/InternalError"
+ r.HandleFunc(VersionedPath("/networks/{name}/disconnect"), s.APIHandler(compat.Disconnect)).Methods(http.MethodPost)
+ r.HandleFunc("/networks/{name}/disconnect", s.APIHandler(compat.Disconnect)).Methods(http.MethodPost)
+
// swagger:operation DELETE /libpod/networks/{name} libpod libpodRemoveNetwork
// ---
// tags: