swagger: remove name wildcards

Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
This commit is contained in:
Tom Deseyn
2021-04-07 15:21:44 +02:00
parent b8a4494b10
commit 71322d6c1f
4 changed files with 40 additions and 40 deletions

View File

@@ -8,7 +8,7 @@ import (
) )
func (s *APIServer) registerGenerateHandlers(r *mux.Router) error { func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// swagger:operation GET /libpod/generate/{name:.*}/systemd libpod GenerateSystemdLibpod // swagger:operation GET /libpod/generate/{name}/systemd libpod GenerateSystemdLibpod
// --- // ---
// tags: // tags:
// - containers // - containers
@@ -17,7 +17,7 @@ func (s *APIServer) registerGenerateHandlers(r *mux.Router) error {
// description: Generate Systemd Units based on a pod or container. // description: Generate Systemd Units based on a pod or container.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: Name or ID of the container or pod. // description: Name or ID of the container or pod.

View File

@@ -8,7 +8,7 @@ import (
) )
func (s *APIServer) registerHealthCheckHandlers(r *mux.Router) error { func (s *APIServer) registerHealthCheckHandlers(r *mux.Router) error {
// swagger:operation GET /libpod/containers/{name:.*}/healthcheck libpod ContainerHealthcheckLibpod // swagger:operation GET /libpod/containers/{name}/healthcheck libpod ContainerHealthcheckLibpod
// --- // ---
// tags: // tags:
// - containers // - containers
@@ -16,7 +16,7 @@ func (s *APIServer) registerHealthCheckHandlers(r *mux.Router) error {
// description: Execute the defined healthcheck and return information about the results // description: Execute the defined healthcheck and return information about the results
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container

View File

@@ -188,7 +188,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet) r.Handle(VersionedPath("/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths // Added non version path to URI to support docker non versioned paths
r.Handle("/images/search", s.APIHandler(compat.SearchImages)).Methods(http.MethodGet) r.Handle("/images/search", s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
// swagger:operation DELETE /images/{name:.*} compat ImageDelete // swagger:operation DELETE /images/{name} compat ImageDelete
// --- // ---
// tags: // tags:
// - images (compat) // - images (compat)
@@ -196,7 +196,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Delete an image from local storage // description: Delete an image from local storage
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: name or ID of image to delete // description: name or ID of image to delete
@@ -222,7 +222,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}"), s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete) r.Handle(VersionedPath("/images/{name:.*}"), s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
// Added non version path to URI to support docker non versioned paths // Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}", s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete) r.Handle("/images/{name:.*}", s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
// swagger:operation POST /images/{name:.*}/push compat ImagePush // swagger:operation POST /images/{name}/push compat ImagePush
// --- // ---
// tags: // tags:
// - images (compat) // - images (compat)
@@ -230,7 +230,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Push an image to a container registry // description: Push an image to a container registry
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: Name of image to push. // description: Name of image to push.
@@ -269,7 +269,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/push"), s.APIHandler(compat.PushImage)).Methods(http.MethodPost) r.Handle(VersionedPath("/images/{name:.*}/push"), s.APIHandler(compat.PushImage)).Methods(http.MethodPost)
// Added non version path to URI to support docker non versioned paths // Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/push", s.APIHandler(compat.PushImage)).Methods(http.MethodPost) r.Handle("/images/{name:.*}/push", s.APIHandler(compat.PushImage)).Methods(http.MethodPost)
// swagger:operation GET /images/{name:.*}/get compat ImageGet // swagger:operation GET /images/{name}/get compat ImageGet
// --- // ---
// tags: // tags:
// - images (compat) // - images (compat)
@@ -277,7 +277,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Export an image in tarball format // description: Export an image in tarball format
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -319,7 +319,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/get"), s.APIHandler(compat.ExportImages)).Methods(http.MethodGet) r.Handle(VersionedPath("/images/get"), s.APIHandler(compat.ExportImages)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths // Added non version path to URI to support docker non versioned paths
r.Handle("/images/get", s.APIHandler(compat.ExportImages)).Methods(http.MethodGet) r.Handle("/images/get", s.APIHandler(compat.ExportImages)).Methods(http.MethodGet)
// swagger:operation GET /images/{name:.*}/history compat ImageHistory // swagger:operation GET /images/{name}/history compat ImageHistory
// --- // ---
// tags: // tags:
// - images (compat) // - images (compat)
@@ -327,7 +327,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Return parent layers of an image. // description: Return parent layers of an image.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -343,7 +343,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet) r.Handle(VersionedPath("/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths // Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/history", s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet) r.Handle("/images/{name:.*}/history", s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
// swagger:operation GET /images/{name:.*}/json compat ImageInspect // swagger:operation GET /images/{name}/json compat ImageInspect
// --- // ---
// tags: // tags:
// - images (compat) // - images (compat)
@@ -351,7 +351,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Return low-level information about an image. // description: Return low-level information about an image.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -367,7 +367,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
r.Handle(VersionedPath("/images/{name:.*}/json"), s.APIHandler(compat.GetImage)).Methods(http.MethodGet) r.Handle(VersionedPath("/images/{name:.*}/json"), s.APIHandler(compat.GetImage)).Methods(http.MethodGet)
// Added non version path to URI to support docker non versioned paths // Added non version path to URI to support docker non versioned paths
r.Handle("/images/{name:.*}/json", s.APIHandler(compat.GetImage)).Methods(http.MethodGet) r.Handle("/images/{name:.*}/json", s.APIHandler(compat.GetImage)).Methods(http.MethodGet)
// swagger:operation POST /images/{name:.*}/tag compat ImageTag // swagger:operation POST /images/{name}/tag compat ImageTag
// --- // ---
// tags: // tags:
// - images (compat) // - images (compat)
@@ -375,7 +375,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Tag an image so that it becomes part of a repository. // description: Tag an image so that it becomes part of a repository.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -667,7 +667,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
libpod endpoints libpod endpoints
*/ */
// swagger:operation POST /libpod/images/{name:.*}/push libpod ImagePushLibpod // swagger:operation POST /libpod/images/{name}/push libpod ImagePushLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -675,7 +675,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Push an image to a container registry // description: Push an image to a container registry
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: Name of image to push. // description: Name of image to push.
@@ -705,7 +705,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/push"), s.APIHandler(libpod.PushImage)).Methods(http.MethodPost) r.Handle(VersionedPath("/libpod/images/{name:.*}/push"), s.APIHandler(libpod.PushImage)).Methods(http.MethodPost)
// swagger:operation GET /libpod/images/{name:.*}/exists libpod ImageExistsLibpod // swagger:operation GET /libpod/images/{name}/exists libpod ImageExistsLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -713,7 +713,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Check if image exists in local store // description: Check if image exists in local store
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -727,7 +727,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/exists"), s.APIHandler(libpod.ImageExists)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/images/{name:.*}/exists"), s.APIHandler(libpod.ImageExists)).Methods(http.MethodGet)
// swagger:operation GET /libpod/images/{name:.*}/tree libpod ImageTreeLibpod // swagger:operation GET /libpod/images/{name}/tree libpod ImageTreeLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -735,7 +735,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Retrieve the image tree for the provided image name or ID // description: Retrieve the image tree for the provided image name or ID
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -753,7 +753,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/tree"), s.APIHandler(libpod.ImageTree)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/images/{name:.*}/tree"), s.APIHandler(libpod.ImageTree)).Methods(http.MethodGet)
// swagger:operation GET /libpod/images/{name:.*}/history libpod ImageHistoryLibpod // swagger:operation GET /libpod/images/{name}/history libpod ImageHistoryLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -761,7 +761,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Return parent layers of an image. // description: Return parent layers of an image.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -906,7 +906,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/remove"), s.APIHandler(libpod.ImagesBatchRemove)).Methods(http.MethodDelete) r.Handle(VersionedPath("/libpod/images/remove"), s.APIHandler(libpod.ImagesBatchRemove)).Methods(http.MethodDelete)
// swagger:operation DELETE /libpod/images/{name:.*} libpod ImageDeleteLibpod // swagger:operation DELETE /libpod/images/{name} libpod ImageDeleteLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -914,7 +914,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Remove an image from the local storage. // description: Remove an image from the local storage.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: name or ID of image to remove // description: name or ID of image to remove
@@ -1042,7 +1042,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
// swagger:operation GET /libpod/images/{name:.*}/get libpod ImageGetLibpod // swagger:operation GET /libpod/images/{name}/get libpod ImageGetLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -1050,7 +1050,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Export an image // description: Export an image
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -1109,7 +1109,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/export"), s.APIHandler(libpod.ExportImages)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/images/export"), s.APIHandler(libpod.ExportImages)).Methods(http.MethodGet)
// swagger:operation GET /libpod/images/{name:.*}/json libpod ImageInspectLibpod // swagger:operation GET /libpod/images/{name}/json libpod ImageInspectLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -1117,7 +1117,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Obtain low-level information about an image // description: Obtain low-level information about an image
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -1131,7 +1131,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/{name:.*}/json"), s.APIHandler(libpod.GetImage)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/images/{name:.*}/json"), s.APIHandler(libpod.GetImage)).Methods(http.MethodGet)
// swagger:operation POST /libpod/images/{name:.*}/tag libpod ImageTagLibpod // swagger:operation POST /libpod/images/{name}/tag libpod ImageTagLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -1139,7 +1139,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Tag an image so that it becomes part of a repository. // description: Tag an image so that it becomes part of a repository.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container
@@ -1217,7 +1217,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/commit"), s.APIHandler(libpod.CommitContainer)).Methods(http.MethodPost) r.Handle(VersionedPath("/libpod/commit"), s.APIHandler(libpod.CommitContainer)).Methods(http.MethodPost)
// swagger:operation POST /libpod/images/{name:.*}/untag libpod ImageUntagLibpod // swagger:operation POST /libpod/images/{name}/untag libpod ImageUntagLibpod
// --- // ---
// tags: // tags:
// - images // - images
@@ -1225,7 +1225,7 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: Untag an image. If not repo and tag are specified, all tags are removed from the image. // description: Untag an image. If not repo and tag are specified, all tags are removed from the image.
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the container // description: the name or ID of the container

View File

@@ -59,7 +59,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: '#/responses/InternalError' // $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/manifests/{name}/exists"), s.APIHandler(libpod.ExistsManifest)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/manifests/{name}/exists"), s.APIHandler(libpod.ExistsManifest)).Methods(http.MethodGet)
// swagger:operation GET /libpod/manifests/{name:.*}/json manifests ManifestInspectLibpod // swagger:operation GET /libpod/manifests/{name}/json manifests ManifestInspectLibpod
// --- // ---
// summary: Inspect // summary: Inspect
// description: Display a manifest list // description: Display a manifest list
@@ -67,7 +67,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// - application/json // - application/json
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the manifest // description: the name or ID of the manifest
@@ -79,14 +79,14 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: "#/responses/InternalError" // $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/manifests/{name:.*}/json"), s.APIHandler(libpod.ManifestInspect)).Methods(http.MethodGet) r.Handle(VersionedPath("/libpod/manifests/{name:.*}/json"), s.APIHandler(libpod.ManifestInspect)).Methods(http.MethodGet)
// swagger:operation POST /libpod/manifests/{name:.*}/add manifests ManifestAddLibpod // swagger:operation POST /libpod/manifests/{name}/add manifests ManifestAddLibpod
// --- // ---
// description: Add an image to a manifest list // description: Add an image to a manifest list
// produces: // produces:
// - application/json // - application/json
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the name or ID of the manifest // description: the name or ID of the manifest
@@ -106,7 +106,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// 500: // 500:
// $ref: "#/responses/InternalError" // $ref: "#/responses/InternalError"
r.Handle(VersionedPath("/libpod/manifests/{name:.*}/add"), s.APIHandler(libpod.ManifestAdd)).Methods(http.MethodPost) r.Handle(VersionedPath("/libpod/manifests/{name:.*}/add"), s.APIHandler(libpod.ManifestAdd)).Methods(http.MethodPost)
// swagger:operation DELETE /libpod/manifests/{name:.*} manifests ManifestDeleteLibpod // swagger:operation DELETE /libpod/manifests/{name} manifests ManifestDeleteLibpod
// --- // ---
// summary: Remove // summary: Remove
// description: Remove an image from a manifest list // description: Remove an image from a manifest list
@@ -114,7 +114,7 @@ func (s *APIServer) registerManifestHandlers(r *mux.Router) error {
// - application/json // - application/json
// parameters: // parameters:
// - in: path // - in: path
// name: name:.* // name: name
// type: string // type: string
// required: true // required: true
// description: the image associated with the manifest // description: the image associated with the manifest