summaryrefslogtreecommitdiff
path: root/pkg/api/server/register_images.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-02-04 12:48:13 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-02-10 12:36:45 +0100
commit76e2a0c5d3365205cb104280d41015d6ab25cd9a (patch)
treecaaa958c7b9c09f283e7e4498fdd8c473403f32e /pkg/api/server/register_images.go
parentee811431d29962c3a801903ca3ca342a2000f65e (diff)
downloadpodman-76e2a0c5d3365205cb104280d41015d6ab25cd9a.tar.gz
podman-76e2a0c5d3365205cb104280d41015d6ab25cd9a.tar.bz2
podman-76e2a0c5d3365205cb104280d41015d6ab25cd9a.zip
v2 api: /libpod/images/pull
Implement the /libpod/images/pull endpoint and correct the swagger docs. The reference parameter is mandatory and must either be a c/image/docker/reference or a reference to the "docker://" transport as the pull endpoint is meant to only support pulling images from a registry. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/api/server/register_images.go')
-rw-r--r--pkg/api/server/register_images.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index 4a46b6ee6..98858dac2 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -691,34 +691,49 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// 500:
// $ref: '#/responses/InternalError'
r.Handle(VersionedPath("/libpod/images/import"), APIHandler(s.Context, libpod.ImagesImport)).Methods(http.MethodPost)
- // swagger:operation GET /libpod/images/pull libpod libpodImagesPull
+ // swagger:operation POST /libpod/images/pull libpod libpodImagesPull
// ---
// tags:
// - images
- // summary: Import image
- // description: Import a previosly exported image as a tarball.
+ // summary: Pull images
+ // description: Pull one or more images from a container registry.
// parameters:
// - in: query
// name: reference
- // description: Mandatory reference to the image (e.g., quay.io/image/name:tag)/
+ // description: Mandatory reference to the image (e.g., quay.io/image/name:tag)
// type: string
// - in: query
// name: credentials
// description: username:password for the registry.
// type: string
// - in: query
+ // name: os
+ // description: Pull image for the specified operating system.
+ // type: string
+ // - in: query
+ // name: arch
+ // description: Pull image for the specified architecture.
+ // type: string
+ // - in: query
// name: tls-verify
// description: Require TLS verification.
// type: boolean
// default: true
+ // - in: query
+ // name: all-tags
+ // description: Pull all tagged images in the repository.
+ // type: bool
// produces:
// - application/json
// responses:
// 200:
// $ref: "#/responses/DocsLibpodImagesPullResponse"
+ // $ref: "#/response/LibpodImagesPullResponse"
+ // 400:
+ // $ref: "#/responses/BadParamError"
// 500:
// $ref: '#/responses/InternalError'
- r.Handle(VersionedPath("/libpod/images/pull"), APIHandler(s.Context, libpod.ImagesPull)).Methods(http.MethodPost)
+ r.Handle(VersionedPath("/libpod/images/pull"), APIHandler(s.Context, libpod.ImagesPull)).Methods(http.MethodPut)
// swagger:operation POST /libpod/images/prune libpod libpodPruneImages
// ---
// tags: