mirror of
https://github.com/containers/podman.git
synced 2025-12-05 04:40:47 +08:00
With the advent of Podman 2.0.0 we crossed the magical barrier of go modules. While we were able to continue importing all packages inside of the project, the project could not be vendored anymore from the outside. Move the go module to new major version and change all imports to `github.com/containers/libpod/v2`. The renaming of the imports was done via `gomove` [1]. [1] https://github.com/KSubedi/gomove Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
146 lines
4.1 KiB
Go
146 lines
4.1 KiB
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/containers/libpod/v2/pkg/api/handlers/libpod"
|
|
"github.com/gorilla/mux"
|
|
)
|
|
|
|
func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
|
|
// swagger:operation POST /libpod/manifests/create manifests Create
|
|
// ---
|
|
// summary: Create
|
|
// description: Create a manifest list
|
|
// produces:
|
|
// - application/json
|
|
// parameters:
|
|
// - in: query
|
|
// name: name
|
|
// type: string
|
|
// description: manifest list name
|
|
// required: true
|
|
// - in: query
|
|
// name: image
|
|
// type: string
|
|
// description: name of the image
|
|
// - in: query
|
|
// name: all
|
|
// type: boolean
|
|
// description: add all contents if given list
|
|
// responses:
|
|
// 200:
|
|
// $ref: "#/definitions/IDResponse"
|
|
// 400:
|
|
// $ref: "#/responses/BadParamError"
|
|
// 404:
|
|
// $ref: "#/responses/NoSuchImage"
|
|
// 500:
|
|
// $ref: "#/responses/InternalError"
|
|
r.Handle(VersionedPath("/libpod/manifests/create"), s.APIHandler(libpod.ManifestCreate)).Methods(http.MethodPost)
|
|
// swagger:operation GET /libpod/manifests/{name:.*}/json manifests Inspect
|
|
// ---
|
|
// summary: Inspect
|
|
// description: Display a manifest list
|
|
// produces:
|
|
// - application/json
|
|
// parameters:
|
|
// - in: path
|
|
// name: name:.*
|
|
// type: string
|
|
// required: true
|
|
// description: the name or ID of the manifest
|
|
// responses:
|
|
// 200:
|
|
// $ref: "#/responses/InspectManifest"
|
|
// 404:
|
|
// $ref: "#/responses/NoSuchManifest"
|
|
// 500:
|
|
// $ref: "#/responses/InternalError"
|
|
r.Handle(VersionedPath("/libpod/manifests/{name:.*}/json"), s.APIHandler(libpod.ManifestInspect)).Methods(http.MethodGet)
|
|
// swagger:operation POST /libpod/manifests/{name:.*}/add manifests AddManifest
|
|
// ---
|
|
// description: Add an image to a manifest list
|
|
// produces:
|
|
// - application/json
|
|
// parameters:
|
|
// - in: path
|
|
// name: name:.*
|
|
// type: string
|
|
// required: true
|
|
// description: the name or ID of the manifest
|
|
// - in: body
|
|
// name: options
|
|
// description: options for creating a manifest
|
|
// schema:
|
|
// $ref: "#/definitions/ManifestAddOpts"
|
|
// responses:
|
|
// 200:
|
|
// $ref: "#/definitions/IDResponse"
|
|
// 404:
|
|
// $ref: "#/responses/NoSuchManifest"
|
|
// 409:
|
|
// $ref: "#/responses/BadParamError"
|
|
// 500:
|
|
// $ref: "#/responses/InternalError"
|
|
r.Handle(VersionedPath("/libpod/manifests/{name:.*}/add"), s.APIHandler(libpod.ManifestAdd)).Methods(http.MethodPost)
|
|
// swagger:operation DELETE /libpod/manifests/{name:.*} manifests RemoveManifest
|
|
// ---
|
|
// summary: Remove
|
|
// description: Remove an image from a manifest list
|
|
// produces:
|
|
// - application/json
|
|
// parameters:
|
|
// - in: path
|
|
// name: name:.*
|
|
// type: string
|
|
// required: true
|
|
// description: the image associated with the manifest
|
|
// - in: query
|
|
// name: digest
|
|
// type: string
|
|
// description: image digest to be removed
|
|
// responses:
|
|
// 200:
|
|
// $ref: "#/definitions/IDResponse"
|
|
// 400:
|
|
// $ref: "#/responses/BadParamError"
|
|
// 404:
|
|
// $ref: "#/responses/NoSuchManifest"
|
|
// 500:
|
|
// $ref: "#/responses/InternalError"
|
|
r.Handle(VersionedPath("/libpod/manifests/{name:.*}"), s.APIHandler(libpod.ManifestRemove)).Methods(http.MethodDelete)
|
|
// swagger:operation POST /libpod/manifests/{name}/push manifests PushManifest
|
|
// ---
|
|
// summary: Push
|
|
// description: Push a manifest list or image index to a registry
|
|
// produces:
|
|
// - application/json
|
|
// parameters:
|
|
// - in: path
|
|
// name: name
|
|
// type: string
|
|
// required: true
|
|
// description: the name or ID of the manifest
|
|
// - in: query
|
|
// name: destination
|
|
// type: string
|
|
// required: true
|
|
// description: the destination for the manifest
|
|
// - in: query
|
|
// name: all
|
|
// description: push all images
|
|
// type: boolean
|
|
// responses:
|
|
// 200:
|
|
// $ref: "#/definitions/IDResponse"
|
|
// 400:
|
|
// $ref: "#/responses/BadParamError"
|
|
// 404:
|
|
// $ref: "#/responses/NoSuchManifest"
|
|
// 500:
|
|
// $ref: "#/responses/InternalError"
|
|
r.Handle(VersionedPath("/libpod/manifests/{name}/push"), s.APIHandler(libpod.ManifestPush)).Methods(http.MethodPost)
|
|
return nil
|
|
}
|