added manifest api description
This commit is contained in:
@@ -5,6 +5,6 @@ const (
|
||||
rundir = "/var/run/mstore"
|
||||
logdir = "/var/log/mstore"
|
||||
datadir = "/var/lib/mstore"
|
||||
version = "0.2.4"
|
||||
srvname = "mstored"
|
||||
version = "0.2.5"
|
||||
srvname = "mstored"
|
||||
)
|
||||
|
||||
+91
-3
@@ -11,6 +11,19 @@ import (
|
||||
"mstore/pkg/terms"
|
||||
)
|
||||
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary Get manifest info
|
||||
// @Description Get manifest info
|
||||
// @Tags manifest
|
||||
// @Param name path string true "Manifest path"
|
||||
// @Param reference path string true "Manifest tag"
|
||||
// @Success 200
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/{name}/manifests/{reference} [HEAD]
|
||||
// @Header 200 {string} Content-Length "Manifest size"
|
||||
// @Header 200 {string} Content-Type "Manifest type"
|
||||
// @Header 200 {string} Docker-Content-Digest "Manigest digest"
|
||||
func (hand *Handler) ManifestExists(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
reference, _ := rctx.GetSubpath("reference")
|
||||
@@ -47,7 +60,18 @@ func (hand *Handler) ManifestExists(rctx *router.Context) {
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// PUT /v2/<name>/manifests/<reference> 201 404
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary Put manifest
|
||||
// @Description Put manifest
|
||||
// @Tags manifest
|
||||
// @Param name path string true "Manifest path"
|
||||
// @Param reference path string true "Manifest tag"
|
||||
// @Param Content-Length header string true "Manifest size"
|
||||
// @Param Content-Type header string true "Manifest type"
|
||||
// @Success 200
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/{name}/manifests/{reference} [PUT]
|
||||
func (hand *Handler) PutManifest(rctx *router.Context) {
|
||||
|
||||
//hand.DumpHeaders("PutManifest headers", rctx)
|
||||
@@ -87,7 +111,19 @@ func (hand *Handler) PutManifest(rctx *router.Context) {
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// GET /v2/<name>/manifests/<reference> 200 404
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary Get manifest
|
||||
// @Description Get manifest
|
||||
// @Tags manifest
|
||||
// @Param name path string true "Manifest path"
|
||||
// @Param reference path string true "Manifest tag"
|
||||
// @Success 200
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/{name}/manifests/{reference} [GET]
|
||||
// @Header 200 {string} Content-Length "Manifest size"
|
||||
// @Header 200 {string} Content-Type "Manifest type"
|
||||
// @Header 200 {string} Docker-Content-Digest "Manigest digest"
|
||||
func (hand *Handler) GetManifest(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
reference, _ := rctx.GetSubpath("reference")
|
||||
@@ -129,7 +165,16 @@ func (hand *Handler) GetManifest(rctx *router.Context) {
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// DELETE /v2/<name>/manifests/<reference> 200 404
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary Delete manifest
|
||||
// @Description Delete manifest
|
||||
// @Tags manifest
|
||||
// @Param name path string true "Manifest path"
|
||||
// @Param reference path string true "Manifest tag"
|
||||
// @Success 202
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/{name}/manifests/{reference} [DELETE]
|
||||
func (hand *Handler) DeleteManifest(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
reference, _ := rctx.GetSubpath("reference")
|
||||
@@ -160,6 +205,18 @@ func (hand *Handler) DeleteManifest(rctx *router.Context) {
|
||||
|
||||
// GET /v2/<name>/referrers/<digest> 200 404/400
|
||||
// GET /v2/<name>/referrers/<digest>?artifactType=<artifactType> 200 404/400
|
||||
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary Get manifest referer
|
||||
// @Description Get manifest referer
|
||||
// @Tags manifest
|
||||
// @Param name path string true "Manifest path"
|
||||
// @Param digest path string true "Manifest digest"
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/{name}/referrers/{digest} [GET]
|
||||
// @Success 200 {object} imageoper.GetRefererResult.Reference
|
||||
// @Produce application/json
|
||||
func (hand *Handler) GetReferer(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
digest, _ := rctx.GetSubpath("digest")
|
||||
@@ -188,6 +245,17 @@ func (hand *Handler) GetReferer(rctx *router.Context) {
|
||||
|
||||
// GET /v2/<name>/tags/list 200 404
|
||||
// GET /v2/<name>/tags/list?n=<integer>&last=<integer>
|
||||
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary List manifest tags
|
||||
// @Description List manifest tags
|
||||
// @Tags manifest
|
||||
// @Param name path string true "Manifest path"
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/{name}/tags/list [GET]
|
||||
// @Success 200 {object} imageoper.GetTagsResult.TagDescr
|
||||
// @Produce application/json
|
||||
func (hand *Handler) GetTags(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
params := &imageoper.GetTagsParams{
|
||||
@@ -214,6 +282,16 @@ func (hand *Handler) GetTags(rctx *router.Context) {
|
||||
}
|
||||
|
||||
// GET /v2/_catalog?n=1000 200 404
|
||||
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary List manifests
|
||||
// @Description List manifests
|
||||
// @Tags manifest
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/_catalog [GET]
|
||||
// @Success 200 {object} imageoper.ListManifestsResult.Repositories
|
||||
// @Produce application/json
|
||||
func (hand *Handler) ListManifests(rctx *router.Context) {
|
||||
params := &imageoper.ListManifestsParams{}
|
||||
// Rigth checking
|
||||
@@ -237,6 +315,16 @@ func (hand *Handler) ListManifests(rctx *router.Context) {
|
||||
rctx.SendJSON(code, res.Repositories)
|
||||
}
|
||||
|
||||
// GetProperty godoc
|
||||
//
|
||||
// @Summary Check images
|
||||
// @Description Check images
|
||||
// @Tags manifest
|
||||
// @Failure 404,405,500
|
||||
// @Router /v2/checker/{name} [POST]
|
||||
// @Router /v2/checker/ [POST]
|
||||
// @Success 200 {object} imageoper.CheckImagesResult.Repositories
|
||||
// @Produce application/json
|
||||
func (hand *Handler) CheckImages(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
params := &imageoper.CheckImagesParams{
|
||||
|
||||
Reference in New Issue
Block a user