From 1214b1a38b1877fecfdf232d8b3fc7f2a1dab9a2 Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Wed, 27 Jan 2021 13:48:16 +0100 Subject: swagger: add operationIds that match with docker Signed-off-by: Tom Deseyn --- pkg/api/server/register_networks.go | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'pkg/api/server/register_networks.go') diff --git a/pkg/api/server/register_networks.go b/pkg/api/server/register_networks.go index a07c6a55e..02729d093 100644 --- a/pkg/api/server/register_networks.go +++ b/pkg/api/server/register_networks.go @@ -9,11 +9,26 @@ import ( ) func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { + // swagger:operation POST /networks/prune compat compatPruneNetwork + // --- + // tags: + // - networks (compat) + // Summary: Delete unused networks + // operationId: NetworkPrune + // description: Not supported + // produces: + // - application/json + // responses: + // 404: + // $ref: "#/responses/NoSuchNetwork" + r.HandleFunc(VersionedPath("/networks/prune"), compat.UnsupportedHandler).Methods(http.MethodPost) + r.HandleFunc("/networks/prune", compat.UnsupportedHandler).Methods(http.MethodPost) // swagger:operation DELETE /networks/{name} compat compatRemoveNetwork // --- // tags: // - networks (compat) // summary: Remove a network + // operationId: NetworkDelete // description: Remove a network // parameters: // - in: path @@ -37,6 +52,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { // tags: // - networks (compat) // summary: Inspect a network + // operationId: NetworkInspect // description: Display low level configuration network // parameters: // - in: path @@ -60,6 +76,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { // tags: // - networks (compat) // summary: List networks + // operationId: NetworkList // description: Display summary of network configurations // parameters: // - in: query @@ -85,6 +102,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { // tags: // - networks (compat) // summary: Create network + // operationId: NetworkCreate // description: Create a network configuration // produces: // - application/json @@ -108,6 +126,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { // tags: // - networks (compat) // summary: Connect container to network + // operationId: NetworkConnect // description: Connect a container to a network. This endpoint is current a no-op // produces: // - application/json @@ -136,6 +155,7 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { // tags: // - networks (compat) // summary: Disconnect container from network + // operationId: NetworkDisconnect // description: Disconnect a container from a network. This endpoint is current a no-op // produces: // - application/json @@ -219,6 +239,28 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error { */ 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/{name}/exists libpod libpodExistsNetwork // --- // tags: -- cgit v1.2.3-54-g00ecf