diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-13 12:24:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 12:24:05 -0700 |
commit | 886b2cc4b10c32611b45da983fa9d1318d38356a (patch) | |
tree | 4484691fbb13faef71e7b11cfa3a81ab46c9fee2 /pkg/api/server/register_networks.go | |
parent | d147b3ee027580dd7afdeb0fa04d990ae1d2ee91 (diff) | |
parent | cf502b99feda401ced410fbcfd1a3a2663c7a559 (diff) | |
download | podman-886b2cc4b10c32611b45da983fa9d1318d38356a.tar.gz podman-886b2cc4b10c32611b45da983fa9d1318d38356a.tar.bz2 podman-886b2cc4b10c32611b45da983fa9d1318d38356a.zip |
Merge pull request #6197 from baude/v2remotenetwork
enable podman v2 networking for remote client
Diffstat (limited to 'pkg/api/server/register_networks.go')
-rw-r--r-- | pkg/api/server/register_networks.go | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/pkg/api/server/register_networks.go b/pkg/api/server/register_networks.go new file mode 100644 index 000000000..b1189c1f4 --- /dev/null +++ b/pkg/api/server/register_networks.go @@ -0,0 +1,100 @@ +package server + +import ( + "net/http" + + "github.com/containers/libpod/pkg/api/handlers/libpod" + "github.com/gorilla/mux" +) + +func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { + // swagger:operation DELETE /libpod/networks/{name} libpod libpodRemoveNetwork + // --- + // tags: + // - networks + // summary: Remove a network + // description: Remove a CNI configured network + // parameters: + // - in: path + // name: name + // type: string + // required: true + // description: the name of the network + // - in: query + // name: Force + // type: boolean + // description: remove containers associated with network + // produces: + // - application/json + // responses: + // 200: + // $ref: "#/responses/NetworkRmReport" + // 404: + // $ref: "#/responses/NoSuchNetwork" + // 500: + // $ref: "#/responses/InternalError" + r.HandleFunc(VersionedPath("/libpod/networks/{name}"), s.APIHandler(libpod.RemoveNetwork)).Methods(http.MethodDelete) + // swagger:operation GET /libpod/networks/{name}/json libpod libpodInspectNetwork + // --- + // tags: + // - networks + // summary: Inspect a network + // description: Display low level configuration for a CNI network + // parameters: + // - in: path + // name: name + // type: string + // required: true + // description: the name of the network + // produces: + // - application/json + // responses: + // 200: + // $ref: "#/responses/NetworkInspectReport" + // 404: + // $ref: "#/responses/NoSuchNetwork" + // 500: + // $ref: "#/responses/InternalError" + r.HandleFunc(VersionedPath("/libpod/networks/{name}/json"), s.APIHandler(libpod.InspectNetwork)).Methods(http.MethodGet) + // swagger:operation GET /libpod/networks/json libpod libpodListNetwork + // --- + // tags: + // - networks + // summary: List networks + // description: Display summary of network configurations + // produces: + // - application/json + // responses: + // 200: + // $ref: "#/responses/NetworkListReport" + // 500: + // $ref: "#/responses/InternalError" + r.HandleFunc(VersionedPath("/libpod/networks/json"), s.APIHandler(libpod.ListNetworks)).Methods(http.MethodGet) + // swagger:operation POST /libpod/networks/create libpod libpodCreateNetwork + // --- + // tags: + // - networks + // summary: Create network + // description: Create a new CNI network configuration + // produces: + // - application/json + // parameters: + // - in: query + // name: name + // type: string + // description: optional name for new network + // - in: body + // name: create + // description: attributes for creating a container + // schema: + // $ref: "#/definitions/NetworkCreateOptions" + // responses: + // 200: + // $ref: "#/responses/NetworkCreateReport" + // 400: + // $ref: "#/responses/BadParamError" + // 500: + // $ref: "#/responses/InternalError" + r.HandleFunc(VersionedPath("/libpod/networks/create"), s.APIHandler(libpod.CreateNetwork)).Methods(http.MethodPost) + return nil +} |