podman
1package server2
3import (4"net/http"5
6"github.com/containers/podman/v5/pkg/api/handlers/libpod"7"github.com/gorilla/mux"8)
9
10func (s *APIServer) registerManifestHandlers(r *mux.Router) error {11v3 := r.PathPrefix("/v{version:[0-3][0-9A-Za-z.-]*}/libpod/manifests").Subrouter()12v4 := r.PathPrefix("/v{version:[4-9][0-9A-Za-z.-]*}/libpod/manifests").Subrouter()13// swagger:operation POST /libpod/manifests/{name}/push manifests ManifestPushV3Libpod14// ---15// summary: Push manifest to registry16// description: |17// Push a manifest list or image index to a registry18//19// Deprecated: As of 4.0.0 use ManifestPushLibpod instead20// produces:21// - application/json22// parameters:23// - in: path24// name: name25// type: string26// required: true27// description: the name or ID of the manifest28// - in: query29// name: destination30// type: string31// required: true32// description: the destination for the manifest33// - in: query34// name: all35// description: push all images36// type: boolean37// responses:38// 200:39// schema:40// $ref: "#/definitions/IDResponse"41// 400:42// $ref: "#/responses/badParamError"43// 404:44// $ref: "#/responses/manifestNotFound"45// 500:46// $ref: "#/responses/internalError"47v3.Handle("/{name}/push", s.APIHandler(libpod.ManifestPushV3)).Methods(http.MethodPost)48// swagger:operation POST /libpod/manifests/{name}/registry/{destination} manifests ManifestPushLibpod49// ---50// summary: Push manifest list to registry51// description: |52// Push a manifest list or image index to the named registry53//54// As of v4.0.055// produces:56// - application/json57// parameters:58// - in: path59// name: name60// type: string61// required: true62// description: the name or ID of the manifest list63// - in: query64// name: addCompression65// required: false66// description: add existing instances with requested compression algorithms to manifest list67// type: array68// items:69// type: string70// - in: query71// name: forceCompressionFormat72// description: Enforce compressing the layers with the specified --compression and do not reuse differently compressed blobs on the registry.73// type: boolean74// default: false75// - in: path76// name: destination77// type: string78// required: true79// description: the registry for the manifest list80// - in: query81// name: all82// description: push all images83// type: boolean84// default: true85// - in: query86// name: tlsVerify87// type: boolean88// default: true89// description: Require HTTPS and verify signatures when contacting registries.90// - in: query91// name: quiet92// description: "silences extra stream data on push"93// type: boolean94// default: true95// responses:96// 200:97// schema:98// $ref: "#/definitions/IDResponse"99// 400:100// $ref: "#/responses/badParamError"101// 404:102// $ref: "#/responses/manifestNotFound"103// 500:104// $ref: "#/responses/internalError"105v4.Handle("/{name:.*}/registry/{destination:.*}", s.APIHandler(libpod.ManifestPush)).Methods(http.MethodPost)106// swagger:operation POST /libpod/manifests/{name} manifests ManifestCreateLibpod107// ---108// summary: Create109// description: Create a manifest list110// produces:111// - application/json112// parameters:113// - in: path114// name: name115// type: string116// description: manifest list or index name to create117// required: true118// - in: query119// name: images120// type: string121// required: true122// description: |123// One or more names of an image or a manifest list. Repeat parameter as needed.124//125// Support for multiple images, as of version 4.0.0126// Alias of `image` is support for compatibility with < 4.0.0127// Response status code is 200 with < 4.0.0 for compatibility128// - in: query129// name: all130// type: boolean131// description: add all contents if given list132// - in: query133// name: amend134// type: boolean135// description: modify an existing list if one with the desired name already exists136// - in: body137// name: options138// description: options for new manifest139// required: false140// schema:141// $ref: "#/definitions/ManifestModifyOptions"142// responses:143// 201:144// schema:145// $ref: "#/definitions/IDResponse"146// 400:147// $ref: "#/responses/badParamError"148// 404:149// $ref: "#/responses/imageNotFound"150// 500:151// $ref: "#/responses/internalError"152v3.Handle("/create", s.APIHandler(libpod.ManifestCreate)).Methods(http.MethodPost)153v4.Handle("/{name:.*}", s.APIHandler(libpod.ManifestCreate)).Methods(http.MethodPost)154// swagger:operation GET /libpod/manifests/{name}/exists manifests ManifestExistsLibpod155// ---156// summary: Exists157// description: |158// Check if manifest list exists159//160// Note: There is no contract that the manifest list will exist for a follow-on operation161// parameters:162// - in: path163// name: name164// type: string165// required: true166// description: the name or ID of the manifest list167// produces:168// - application/json169// responses:170// 204:171// description: manifest list exists172// 404:173// $ref: '#/responses/manifestNotFound'174// 500:175// $ref: '#/responses/internalError'176v3.Handle("/{name:.*}/exists", s.APIHandler(libpod.ManifestExists)).Methods(http.MethodGet)177v4.Handle("/{name:.*}/exists", s.APIHandler(libpod.ManifestExists)).Methods(http.MethodGet)178// swagger:operation GET /libpod/manifests/{name}/json manifests ManifestInspectLibpod179// ---180// summary: Inspect181// description: Display attributes of given manifest list182// produces:183// - application/json184// parameters:185// - in: path186// name: name187// type: string188// required: true189// description: the name or ID of the manifest list190// - in: query191// name: tlsVerify192// type: boolean193// default: true194// description: Require HTTPS and verify signatures when contacting registries.195// responses:196// 200:197// $ref: "#/responses/manifestInspect"198// 404:199// $ref: "#/responses/manifestNotFound"200// 500:201// $ref: "#/responses/internalError"202v3.Handle("/{name:.*}/json", s.APIHandler(libpod.ManifestInspect)).Methods(http.MethodGet)203v4.Handle("/{name:.*}/json", s.APIHandler(libpod.ManifestInspect)).Methods(http.MethodGet)204// swagger:operation PUT /libpod/manifests/{name} manifests ManifestModifyLibpod205// ---206// summary: Modify manifest list207// description: |208// Add/Remove an image(s) to a manifest list209//210// Note: operations are not atomic when multiple Images are provided.211//212// As of v4.0.0213// produces:214// - application/json215// parameters:216// - in: path217// name: name218// type: string219// required: true220// description: the name or ID of the manifest221// - in: query222// name: tlsVerify223// type: boolean224// default: true225// description: Require HTTPS and verify signatures when contacting registries.226// - in: body227// name: options228// description: options for mutating a manifest229// required: true230// schema:231// $ref: "#/definitions/ManifestModifyOptions"232// responses:233// 200:234// schema:235// $ref: "#/definitions/ManifestModifyReport"236// 404:237// $ref: "#/responses/manifestNotFound"238// 400:239// $ref: "#/responses/badParamError"240// 409:241// description: Operation had partial success, both Images and Errors may have members242// schema:243// $ref: "#/definitions/ManifestModifyReport"244// 500:245// $ref: "#/responses/internalError"246v4.Handle("/{name:.*}", s.APIHandler(libpod.ManifestModify)).Methods(http.MethodPut)247// swagger:operation POST /libpod/manifests/{name}/add manifests ManifestAddLibpod248// ---249// summary: Add image250// description: |251// Add an image to a manifest list252//253// Deprecated: As of 4.0.0 use ManifestModifyLibpod instead254// produces:255// - application/json256// parameters:257// - in: path258// name: name259// type: string260// required: true261// description: the name or ID of the manifest262// - in: body263// name: options264// description: options for creating a manifest265// schema:266// $ref: "#/definitions/ManifestAddOptions"267// responses:268// 200:269// schema:270// $ref: "#/definitions/IDResponse"271// 404:272// $ref: "#/responses/manifestNotFound"273// 409:274// $ref: "#/responses/badParamError"275// 500:276// $ref: "#/responses/internalError"277v3.Handle("/{name:.*}/add", s.APIHandler(libpod.ManifestAddV3)).Methods(http.MethodPost)278// swagger:operation DELETE /libpod/manifests/{name} manifests ManifestDeleteV3Libpod279// ---280// summary: Remove image from a manifest list281// description: |282// Remove an image from a manifest list283//284// Deprecated: As of 4.0.0 use ManifestModifyLibpod instead285// produces:286// - application/json287// parameters:288// - in: path289// name: name290// type: string291// required: true292// description: the image associated with the manifest293// - in: query294// name: digest295// type: string296// description: image digest to be removed297// responses:298// 200:299// schema:300// $ref: "#/definitions/IDResponse"301// 400:302// $ref: "#/responses/badParamError"303// 404:304// $ref: "#/responses/manifestNotFound"305// 500:306// $ref: "#/responses/internalError"307v3.Handle("/{name:.*}", s.APIHandler(libpod.ManifestRemoveDigestV3)).Methods(http.MethodDelete)308// swagger:operation DELETE /libpod/manifests/{name} manifests ManifestDeleteLibpod309// ---310// summary: Delete manifest list311// description: |312// Delete named manifest list313//314// As of v4.0.0315// produces:316// - application/json317// parameters:318// - in: path319// name: name320// type: string321// required: true322// description: The name or ID of the list to be deleted323// responses:324// 200:325// $ref: "#/responses/imagesRemoveResponseLibpod"326// 404:327// $ref: "#/responses/manifestNotFound"328// 500:329// $ref: "#/responses/internalError"330v4.Handle("/{name:.*}", s.APIHandler(libpod.ManifestDelete)).Methods(http.MethodDelete)331return nil332}
333