Add GET /quadlets/{name}/file

Fixes: https://issues.redhat.com/browse/RUN-3716

Signed-off-by: Nicola Sella <nsella@redhat.com>
This commit is contained in:
Nicola Sella
2025-11-12 16:15:07 +01:00
parent 046206fe53
commit ee0efb9fc6
5 changed files with 110 additions and 3 deletions

View File

@@ -32,5 +32,27 @@ func (s *APIServer) registerQuadletHandlers(r *mux.Router) error {
// 500:
// $ref: "#/responses/internalError"
r.HandleFunc(VersionedPath("/libpod/quadlets/json"), s.APIHandler(libpod.ListQuadlets)).Methods(http.MethodGet)
// swagger:operation GET /libpod/quadlets/{name}/file libpod QuadletFileLibpod
// ---
// tags:
// - quadlets
// summary: Get quadlet file
// description: Get the contents of a Quadlet, displaying the file including all comments
// produces:
// - text/plain
// parameters:
// - in: path
// name: name
// type: string
// required: true
// description: the name of the quadlet with extension (e.g., "myapp.container")
// responses:
// 200:
// $ref: "#/responses/quadletFileResponse"
// 404:
// $ref: "#/responses/quadletNotFound"
// 500:
// $ref: "#/responses/internalError"
r.HandleFunc(VersionedPath("/libpod/quadlets/{name}/file"), s.APIHandler(libpod.GetQuadletPrint)).Methods(http.MethodGet)
return nil
}