diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-10 21:28:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 21:28:05 +0100 |
commit | e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9 (patch) | |
tree | 61134dad4b2efdaa65dee6e7206e5ce20080302c /pkg/api/server/register_volumes.go | |
parent | 6ed88e047579bd2d1eac99a6089cc617f0c4773d (diff) | |
parent | 986feef2e80cfaed7cbce0df4fd5d619bcffefd7 (diff) | |
download | podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.tar.gz podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.tar.bz2 podman-e1ffac6cc73eb36640cbaf6a1a28ba44749a96d9.zip |
Merge pull request #4832 from baude/apiv2tomaster
Apiv2tomaster
Diffstat (limited to 'pkg/api/server/register_volumes.go')
-rw-r--r-- | pkg/api/server/register_volumes.go | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/pkg/api/server/register_volumes.go b/pkg/api/server/register_volumes.go new file mode 100644 index 000000000..8fe5a67e4 --- /dev/null +++ b/pkg/api/server/register_volumes.go @@ -0,0 +1,85 @@ +package server + +import ( + "net/http" + + "github.com/containers/libpod/pkg/api/handlers/libpod" + "github.com/gorilla/mux" +) + +func (s *APIServer) registerVolumeHandlers(r *mux.Router) error { + // swagger:operation POST /libpod/volumes/create volumes createVolume + // + // Create a volume + // + // --- + // produces: + // - application/json + // responses: + // '200': + // description: tbd + // '500': + // "$ref": "#/responses/InternalError" + r.Handle("/libpod/volumes/create", APIHandler(s.Context, libpod.CreateVolume)).Methods(http.MethodPost) + r.Handle("/libpod/volumes/json", APIHandler(s.Context, libpod.ListVolumes)).Methods(http.MethodGet) + // swagger:operation POST /volumes/prune volumes pruneVolumes + // + // Prune volumes + // + // --- + // produces: + // - application/json + // responses: + // '204': + // description: no error + // '500': + // "$ref": "#/responses/InternalError" + r.Handle("/libpod/volumes/prune", APIHandler(s.Context, libpod.PruneVolumes)).Methods(http.MethodPost) + // swagger:operation GET /volumes/{nameOrID}/json volumes inspectVolume + // + // Inspect volume + // + // --- + // parameters: + // - in: path + // name: nameOrID + // required: true + // description: the name or ID of the volume + // produces: + // - application/json + // responses: + // '200': + // "$ref": "#/responses/InspectVolumeResponse" + // '404': + // "$ref": "#/responses/NoSuchVolume" + // '500': + // "$ref": "#/responses/InternalError" + r.Handle("/libpod/volumes/{name:..*}/json", APIHandler(s.Context, libpod.InspectVolume)).Methods(http.MethodGet) + // swagger:operation DELETE /volumes/{nameOrID} volumes removeVolume + // + // Inspect volume + // + // --- + // parameters: + // - in: path + // name: nameOrID + // required: true + // description: the name or ID of the volume + // - in: query + // name: force + // type: bool + // description: force removal + // produces: + // - application/json + // responses: + // '204': + // description: no error + // '400': + // "$ref": "#/responses/BadParamError" + // '404': + // "$ref": "#/responses/NoSuchVolume" + // '500': + // "$ref": "#/responses/InternalError" + r.Handle("/libpod/volumes/{name:..*}", APIHandler(s.Context, libpod.RemoveVolume)).Methods(http.MethodDelete) + return nil +} |