github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/pkg/api/server/register_images.go (about)

     1  package server
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/containers/libpod/pkg/api/handlers/compat"
     7  	"github.com/containers/libpod/pkg/api/handlers/libpod"
     8  	"github.com/gorilla/mux"
     9  )
    10  
    11  func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
    12  	// swagger:operation POST /images/create compat createImage
    13  	// ---
    14  	// tags:
    15  	//  - images (compat)
    16  	// summary: Create an image
    17  	// description: Create an image by either pulling it from a registry or importing it.
    18  	// produces:
    19  	// - application/json
    20  	// parameters:
    21  	//  - in: query
    22  	//    name: fromImage
    23  	//    type: string
    24  	//    description: needs description
    25  	//  - in: query
    26  	//    name: fromSrc
    27  	//    type: string
    28  	//    description: needs description
    29  	//  - in: query
    30  	//    name: tag
    31  	//    type: string
    32  	//    description: needs description
    33  	//  - in: header
    34  	//    name: X-Registry-Auth
    35  	//    type: string
    36  	//    description: A base64-encoded auth configuration.
    37  	//  - in: body
    38  	//    name: request
    39  	//    schema:
    40  	//      type: string
    41  	//    description: Image content if fromSrc parameter was used
    42  	// responses:
    43  	//   200:
    44  	//     $ref: "#/responses/ok"
    45  	//   404:
    46  	//     $ref: "#/responses/NoSuchImage"
    47  	//   500:
    48  	//     $ref: "#/responses/InternalError"
    49  	r.Handle(VersionedPath("/images/create"), s.APIHandler(compat.CreateImageFromImage)).Methods(http.MethodPost).Queries("fromImage", "{fromImage}")
    50  	// Added non version path to URI to support docker non versioned paths
    51  	r.Handle("/images/create", s.APIHandler(compat.CreateImageFromImage)).Methods(http.MethodPost).Queries("fromImage", "{fromImage}")
    52  	r.Handle(VersionedPath("/images/create"), s.APIHandler(compat.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}")
    53  	// Added non version path to URI to support docker non versioned paths
    54  	r.Handle("/images/create", s.APIHandler(compat.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}")
    55  	// swagger:operation GET /images/json compat listImages
    56  	// ---
    57  	// tags:
    58  	//  - images (compat)
    59  	// summary: List Images
    60  	// description: Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image.
    61  	// parameters:
    62  	//   - name: all
    63  	//     in: query
    64  	//     description: "Show all images. Only images from a final layer (no children) are shown by default."
    65  	//     type: boolean
    66  	//     default: false
    67  	//   - name: filters
    68  	//     in: query
    69  	//     description: |
    70  	//        A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
    71  	//        - `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
    72  	//        - `dangling=true`
    73  	//        - `label=key` or `label="key=value"` of an image label
    74  	//        - `reference`=(`<image-name>[:<tag>]`)
    75  	//        - `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
    76  	//     type: string
    77  	//   - name: digests
    78  	//     in: query
    79  	//     description: Not supported
    80  	//     type: boolean
    81  	//     default: false
    82  	// produces:
    83  	// - application/json
    84  	// responses:
    85  	//   200:
    86  	//     $ref: "#/responses/DockerImageSummary"
    87  	//   500:
    88  	//     $ref: '#/responses/InternalError'
    89  	r.Handle(VersionedPath("/images/json"), s.APIHandler(compat.GetImages)).Methods(http.MethodGet)
    90  	// Added non version path to URI to support docker non versioned paths
    91  	r.Handle("/images/json", s.APIHandler(compat.GetImages)).Methods(http.MethodGet)
    92  	// swagger:operation POST /images/load compat importImage
    93  	// ---
    94  	// tags:
    95  	//  - images (compat)
    96  	// summary: Import image
    97  	// description: Load a set of images and tags into a repository.
    98  	// parameters:
    99  	//  - in: query
   100  	//    name: quiet
   101  	//    type: boolean
   102  	//    description: not supported
   103  	//  - in: body
   104  	//    name: request
   105  	//    description: tarball of container image
   106  	//    schema:
   107  	//      type: string
   108  	// produces:
   109  	// - application/json
   110  	// responses:
   111  	//   200:
   112  	//     description: no error
   113  	//   500:
   114  	//     $ref: '#/responses/InternalError'
   115  	r.Handle(VersionedPath("/images/load"), s.APIHandler(compat.LoadImages)).Methods(http.MethodPost)
   116  	// Added non version path to URI to support docker non versioned paths
   117  	r.Handle("/images/load", s.APIHandler(compat.LoadImages)).Methods(http.MethodPost)
   118  	// swagger:operation POST /images/prune compat pruneImages
   119  	// ---
   120  	// tags:
   121  	//  - images (compat)
   122  	// summary: Prune unused images
   123  	// description: Remove images from local storage that are not being used by a container
   124  	// parameters:
   125  	//  - in: query
   126  	//    name: filters
   127  	//    type: string
   128  	//    description: |
   129  	//      filters to apply to image pruning, encoded as JSON (map[string][]string). Available filters:
   130  	//        - `dangling=<boolean>` When set to `true` (or `1`), prune only
   131  	//           unused *and* untagged images. When set to `false`
   132  	//           (or `0`), all unused images are pruned.
   133  	//        - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.
   134  	//        - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels.
   135  	// produces:
   136  	// - application/json
   137  	// responses:
   138  	//   200:
   139  	//     $ref: "#/responses/DocsImageDeleteResponse"
   140  	//   500:
   141  	//     $ref: '#/responses/InternalError'
   142  	r.Handle(VersionedPath("/images/prune"), s.APIHandler(compat.PruneImages)).Methods(http.MethodPost)
   143  	// Added non version path to URI to support docker non versioned paths
   144  	r.Handle("/images/prune", s.APIHandler(compat.PruneImages)).Methods(http.MethodPost)
   145  	// swagger:operation GET /images/search compat searchImages
   146  	// ---
   147  	// tags:
   148  	//  - images (compat)
   149  	// summary: Search images
   150  	// description: Search registries for an image
   151  	// parameters:
   152  	//  - in: query
   153  	//    name: term
   154  	//    type: string
   155  	//    description: term to search
   156  	//  - in: query
   157  	//    name: limit
   158  	//    type: integer
   159  	//    description: maximum number of results
   160  	//  - in: query
   161  	//    name: filters
   162  	//    type: string
   163  	//    description: |
   164  	//        A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
   165  	//        - `is-automated=(true|false)`
   166  	//        - `is-official=(true|false)`
   167  	//        - `stars=<number>` Matches images that has at least 'number' stars.
   168  	// produces:
   169  	// - application/json
   170  	// responses:
   171  	//   200:
   172  	//     $ref: "#/responses/DocsSearchResponse"
   173  	//   400:
   174  	//     $ref: "#/responses/BadParamError"
   175  	//   500:
   176  	//     $ref: '#/responses/InternalError'
   177  	r.Handle(VersionedPath("/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
   178  	// Added non version path to URI to support docker non versioned paths
   179  	r.Handle("/images/search", s.APIHandler(compat.SearchImages)).Methods(http.MethodGet)
   180  	// swagger:operation DELETE /images/{name:.*} compat removeImage
   181  	// ---
   182  	// tags:
   183  	//  - images (compat)
   184  	// summary: Remove Image
   185  	// description: Delete an image from local storage
   186  	// parameters:
   187  	//  - in: path
   188  	//    name: name:.*
   189  	//    type: string
   190  	//    required: true
   191  	//    description: name or ID of image to delete
   192  	//  - in: query
   193  	//    name: force
   194  	//    type: boolean
   195  	//    description: remove the image even if used by containers or has other tags
   196  	//  - in: query
   197  	//    name: noprune
   198  	//    type: boolean
   199  	//    description: not supported. will be logged as an invalid parameter if enabled
   200  	// produces:
   201  	//  - application/json
   202  	// responses:
   203  	//   200:
   204  	//     $ref: "#/responses/DocsImageDeleteResponse"
   205  	//   404:
   206  	//     $ref: '#/responses/NoSuchImage'
   207  	//   409:
   208  	//     $ref: '#/responses/ConflictError'
   209  	//   500:
   210  	//     $ref: '#/responses/InternalError'
   211  	r.Handle(VersionedPath("/images/{name:.*}"), s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
   212  	// Added non version path to URI to support docker non versioned paths
   213  	r.Handle("/images/{name:.*}", s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
   214  	// swagger:operation POST /images/{name:.*}/push compat pushImage
   215  	// ---
   216  	// tags:
   217  	//  - images (compat)
   218  	// summary: Push Image
   219  	// description: Push an image to a container registry
   220  	// parameters:
   221  	//  - in: path
   222  	//    name: name:.*
   223  	//    type: string
   224  	//    required: true
   225  	//    description: Name of image to push.
   226  	//  - in: query
   227  	//    name: tag
   228  	//    type: string
   229  	//    description: The tag to associate with the image on the registry.
   230  	//  - in: header
   231  	//    name: X-Registry-Auth
   232  	//    type: string
   233  	//    description: A base64-encoded auth configuration.
   234  	// produces:
   235  	// - application/json
   236  	// responses:
   237  	//   200:
   238  	//     description: no error
   239  	//     schema:
   240  	//      type: string
   241  	//      format: binary
   242  	//   404:
   243  	//     $ref: '#/responses/NoSuchImage'
   244  	//   500:
   245  	//     $ref: '#/responses/InternalError'
   246  	r.Handle(VersionedPath("/images/{name:.*}/push"), s.APIHandler(compat.PushImage)).Methods(http.MethodPost)
   247  	// Added non version path to URI to support docker non versioned paths
   248  	r.Handle("/images/{name:.*}/push", s.APIHandler(compat.PushImage)).Methods(http.MethodPost)
   249  	// swagger:operation GET /images/{name:.*}/get compat exportImage
   250  	// ---
   251  	// tags:
   252  	//  - images (compat)
   253  	// summary: Export an image
   254  	// description: Export an image in tarball format
   255  	// parameters:
   256  	//  - in: path
   257  	//    name: name:.*
   258  	//    type: string
   259  	//    required: true
   260  	//    description: the name or ID of the container
   261  	// produces:
   262  	//  - application/json
   263  	// responses:
   264  	//   200:
   265  	//     description: no error
   266  	//     schema:
   267  	//      type: string
   268  	//      format: binary
   269  	//   500:
   270  	//     $ref: '#/responses/InternalError'
   271  	r.Handle(VersionedPath("/images/{name:.*}/get"), s.APIHandler(compat.ExportImage)).Methods(http.MethodGet)
   272  	// Added non version path to URI to support docker non versioned paths
   273  	r.Handle("/images/{name:.*}/get", s.APIHandler(compat.ExportImage)).Methods(http.MethodGet)
   274  	// swagger:operation GET /images/{name:.*}/history compat imageHistory
   275  	// ---
   276  	// tags:
   277  	//  - images (compat)
   278  	// summary: History of an image
   279  	// description: Return parent layers of an image.
   280  	// parameters:
   281  	//  - in: path
   282  	//    name: name:.*
   283  	//    type: string
   284  	//    required: true
   285  	//    description: the name or ID of the container
   286  	// produces:
   287  	// - application/json
   288  	// responses:
   289  	//   200:
   290  	//     $ref: "#/responses/DocsHistory"
   291  	//   404:
   292  	//     $ref: "#/responses/NoSuchImage"
   293  	//   500:
   294  	//     $ref: "#/responses/InternalError"
   295  	r.Handle(VersionedPath("/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
   296  	// Added non version path to URI to support docker non versioned paths
   297  	r.Handle("/images/{name:.*}/history", s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
   298  	// swagger:operation GET /images/{name:.*}/json compat inspectImage
   299  	// ---
   300  	// tags:
   301  	//  - images (compat)
   302  	// summary: Inspect an image
   303  	// description: Return low-level information about an image.
   304  	// parameters:
   305  	//  - in: path
   306  	//    name: name:.*
   307  	//    type: string
   308  	//    required: true
   309  	//    description: the name or ID of the container
   310  	// produces:
   311  	// - application/json
   312  	// responses:
   313  	//   200:
   314  	//     $ref: "#/responses/DocsImageInspect"
   315  	//   404:
   316  	//     $ref: "#/responses/NoSuchImage"
   317  	//   500:
   318  	//     $ref: "#/responses/InternalError"
   319  	r.Handle(VersionedPath("/images/{name:.*}/json"), s.APIHandler(compat.GetImage)).Methods(http.MethodGet)
   320  	// Added non version path to URI to support docker non versioned paths
   321  	r.Handle("/images/{name:.*}/json", s.APIHandler(compat.GetImage)).Methods(http.MethodGet)
   322  	// swagger:operation POST /images/{name:.*}/tag compat tagImage
   323  	// ---
   324  	// tags:
   325  	//  - images (compat)
   326  	// summary: Tag an image
   327  	// description: Tag an image so that it becomes part of a repository.
   328  	// parameters:
   329  	//  - in: path
   330  	//    name: name:.*
   331  	//    type: string
   332  	//    required: true
   333  	//    description: the name or ID of the container
   334  	//  - in: query
   335  	//    name: repo
   336  	//    type: string
   337  	//    description: the repository to tag in
   338  	//  - in: query
   339  	//    name: tag
   340  	//    type: string
   341  	//    description: the name of the new tag
   342  	// produces:
   343  	// - application/json
   344  	// responses:
   345  	//   201:
   346  	//     description: no error
   347  	//   400:
   348  	//     $ref: '#/responses/BadParamError'
   349  	//   404:
   350  	//     $ref: '#/responses/NoSuchImage'
   351  	//   409:
   352  	//     $ref: '#/responses/ConflictError'
   353  	//   500:
   354  	//     $ref: '#/responses/InternalError'
   355  	r.Handle(VersionedPath("/images/{name:.*}/tag"), s.APIHandler(compat.TagImage)).Methods(http.MethodPost)
   356  	// Added non version path to URI to support docker non versioned paths
   357  	r.Handle("/images/{name:.*}/tag", s.APIHandler(compat.TagImage)).Methods(http.MethodPost)
   358  	// swagger:operation POST /commit compat commitContainer
   359  	// ---
   360  	// tags:
   361  	//  - containers (compat)
   362  	// summary: New Image
   363  	// description: Create a new image from a container
   364  	// parameters:
   365  	//  - in: query
   366  	//    name: container
   367  	//    type: string
   368  	//    description: the name or ID of a container
   369  	//  - in: query
   370  	//    name: repo
   371  	//    type: string
   372  	//    description: the repository name for the created image
   373  	//  - in: query
   374  	//    name: tag
   375  	//    type: string
   376  	//    description: tag name for the created image
   377  	//  - in: query
   378  	//    name: comment
   379  	//    type: string
   380  	//    description: commit message
   381  	//  - in: query
   382  	//    name: author
   383  	//    type: string
   384  	//    description: author of the image
   385  	//  - in: query
   386  	//    name: pause
   387  	//    type: boolean
   388  	//    description: pause the container before committing it
   389  	//  - in: query
   390  	//    name: changes
   391  	//    type: string
   392  	//    description: instructions to apply while committing in Dockerfile format
   393  	// produces:
   394  	// - application/json
   395  	// responses:
   396  	//   201:
   397  	//     description: no error
   398  	//   404:
   399  	//     $ref: '#/responses/NoSuchImage'
   400  	//   500:
   401  	//     $ref: '#/responses/InternalError'
   402  	r.Handle(VersionedPath("/commit"), s.APIHandler(compat.CommitContainer)).Methods(http.MethodPost)
   403  	// Added non version path to URI to support docker non versioned paths
   404  	r.Handle("/commit", s.APIHandler(compat.CommitContainer)).Methods(http.MethodPost)
   405  
   406  	// swagger:operation POST /build compat buildImage
   407  	// ---
   408  	// tags:
   409  	//  - images
   410  	// summary: Create image
   411  	// description: Build an image from the given Dockerfile(s)
   412  	// parameters:
   413  	//  - in: query
   414  	//    name: dockerfile
   415  	//    type: string
   416  	//    default: Dockerfile
   417  	//    description: |
   418  	//      Path within the build context to the `Dockerfile`.
   419  	//      This is ignored if remote is specified and points to an external `Dockerfile`.
   420  	//  - in: query
   421  	//    name: t
   422  	//    type: string
   423  	//    default: latest
   424  	//    description: A name and optional tag to apply to the image in the `name:tag` format.
   425  	//  - in: query
   426  	//    name: extrahosts
   427  	//    type: string
   428  	//    default:
   429  	//    description: |
   430  	//      TBD Extra hosts to add to /etc/hosts
   431  	//      (As of version 1.xx)
   432  	//  - in: query
   433  	//    name: remote
   434  	//    type: string
   435  	//    default:
   436  	//    description: |
   437  	//      A Git repository URI or HTTP/HTTPS context URI.
   438  	//      If the URI points to a single text file, the file’s contents are placed
   439  	//      into a file called Dockerfile and the image is built from that file. If
   440  	//      the URI points to a tarball, the file is downloaded by the daemon and the
   441  	//      contents therein used as the context for the build. If the URI points to a
   442  	//      tarball and the dockerfile parameter is also specified, there must be a file
   443  	//      with the corresponding path inside the tarball.
   444  	//      (As of version 1.xx)
   445  	//  - in: query
   446  	//    name: q
   447  	//    type: boolean
   448  	//    default: false
   449  	//    description: |
   450  	//      Suppress verbose build output
   451  	//  - in: query
   452  	//    name: nocache
   453  	//    type: boolean
   454  	//    default: false
   455  	//    description: |
   456  	//      Do not use the cache when building the image
   457  	//      (As of version 1.xx)
   458  	//  - in: query
   459  	//    name: cachefrom
   460  	//    type: string
   461  	//    default:
   462  	//    description: |
   463  	//      JSON array of images used to build cache resolution
   464  	//      (As of version 1.xx)
   465  	//  - in: query
   466  	//    name: pull
   467  	//    type: boolean
   468  	//    default: false
   469  	//    description: |
   470  	//      Attempt to pull the image even if an older image exists locally
   471  	//      (As of version 1.xx)
   472  	//  - in: query
   473  	//    name: rm
   474  	//    type: boolean
   475  	//    default: true
   476  	//    description: |
   477  	//      Remove intermediate containers after a successful build
   478  	//      (As of version 1.xx)
   479  	//  - in: query
   480  	//    name: forcerm
   481  	//    type: boolean
   482  	//    default: false
   483  	//    description: |
   484  	//      Always remove intermediate containers, even upon failure
   485  	//      (As of version 1.xx)
   486  	//  - in: query
   487  	//    name: memory
   488  	//    type: integer
   489  	//    description: |
   490  	//      Memory is the upper limit (in bytes) on how much memory running containers can use
   491  	//      (As of version 1.xx)
   492  	//  - in: query
   493  	//    name: memswap
   494  	//    type: integer
   495  	//    description: |
   496  	//      MemorySwap limits the amount of memory and swap together
   497  	//      (As of version 1.xx)
   498  	//  - in: query
   499  	//    name: cpushares
   500  	//    type: integer
   501  	//    description: |
   502  	//      CPUShares (relative weight
   503  	//      (As of version 1.xx)
   504  	//  - in: query
   505  	//    name: cpusetcpus
   506  	//    type: string
   507  	//    description: |
   508  	//      CPUSetCPUs in which to allow execution (0-3, 0,1)
   509  	//      (As of version 1.xx)
   510  	//  - in: query
   511  	//    name: cpuperiod
   512  	//    type: integer
   513  	//    description: |
   514  	//      CPUPeriod limits the CPU CFS (Completely Fair Scheduler) period
   515  	//      (As of version 1.xx)
   516  	//  - in: query
   517  	//    name: cpuquota
   518  	//    type: integer
   519  	//    description: |
   520  	//      CPUQuota limits the CPU CFS (Completely Fair Scheduler) quota
   521  	//      (As of version 1.xx)
   522  	//  - in: query
   523  	//    name: buildargs
   524  	//    type: string
   525  	//    default:
   526  	//    description: |
   527  	//      JSON map of string pairs denoting build-time variables.
   528  	//      For example, the build argument `Foo` with the value of `bar` would be encoded in JSON as `["Foo":"bar"]`.
   529  	//
   530  	//      For example, buildargs={"Foo":"bar"}.
   531  	//
   532  	//      Note(s):
   533  	//      * This should not be used to pass secrets.
   534  	//      * The value of buildargs should be URI component encoded before being passed to the API.
   535  	//
   536  	//      (As of version 1.xx)
   537  	//  - in: query
   538  	//    name: shmsize
   539  	//    type: integer
   540  	//    default: 67108864
   541  	//    description: |
   542  	//      ShmSize is the "size" value to use when mounting an shmfs on the container's /dev/shm directory.
   543  	//      Default is 64MB
   544  	//      (As of version 1.xx)
   545  	//  - in: query
   546  	//    name: squash
   547  	//    type: boolean
   548  	//    default: false
   549  	//    description: |
   550  	//      Silently ignored.
   551  	//      Squash the resulting images layers into a single layer
   552  	//      (As of version 1.xx)
   553  	//  - in: query
   554  	//    name: labels
   555  	//    type: string
   556  	//    default:
   557  	//    description: |
   558  	//      JSON map of key, value pairs to set as labels on the new image
   559  	//      (As of version 1.xx)
   560  	//  - in: query
   561  	//    name: networkmode
   562  	//    type: string
   563  	//    default: bridge
   564  	//    description: |
   565  	//      Sets the networking mode for the run commands during build.
   566  	//      Supported standard values are:
   567  	//        * `bridge` limited to containers within a single host, port mapping required for external access
   568  	//        * `host` no isolation between host and containers on this network
   569  	//        * `none` disable all networking for this container
   570  	//        * container:<nameOrID> share networking with given container
   571  	//        ---All other values are assumed to be a custom network's name
   572  	//      (As of version 1.xx)
   573  	//  - in: query
   574  	//    name: platform
   575  	//    type: string
   576  	//    default:
   577  	//    description: |
   578  	//      Platform format os[/arch[/variant]]
   579  	//      (As of version 1.xx)
   580  	//  - in: query
   581  	//    name: target
   582  	//    type: string
   583  	//    default:
   584  	//    description: |
   585  	//      Target build stage
   586  	//      (As of version 1.xx)
   587  	//  - in: query
   588  	//    name: outputs
   589  	//    type: string
   590  	//    default:
   591  	//    description: |
   592  	//      output configuration TBD
   593  	//      (As of version 1.xx)
   594  	// produces:
   595  	// - application/json
   596  	// responses:
   597  	//   200:
   598  	//     description: OK (As of version 1.xx)
   599  	//     schema:
   600  	//       type: object
   601  	//       required:
   602  	//         - stream
   603  	//       properties:
   604  	//         stream:
   605  	//           type: string
   606  	//           description: output from build process
   607  	//           example: |
   608  	//             (build details...)
   609  	//             Successfully built 8ba084515c724cbf90d447a63600c0a6
   610  	//   400:
   611  	//     $ref: "#/responses/BadParamError"
   612  	//   500:
   613  	//     $ref: "#/responses/InternalError"
   614  	r.Handle(VersionedPath("/build"), s.APIHandler(compat.BuildImage)).Methods(http.MethodPost)
   615  	// Added non version path to URI to support docker non versioned paths
   616  	r.Handle("/build", s.APIHandler(compat.BuildImage)).Methods(http.MethodPost)
   617  	/*
   618  		libpod endpoints
   619  	*/
   620  
   621  	// swagger:operation POST /libpod/images/{name:.*}/push libpod libpodPushImage
   622  	// ---
   623  	// tags:
   624  	//  - images (libpod)
   625  	// summary: Push Image
   626  	// description: Push an image to a container registry
   627  	// parameters:
   628  	//  - in: path
   629  	//    name: name:.*
   630  	//    type: string
   631  	//    required: true
   632  	//    description: Name of image to push.
   633  	//  - in: query
   634  	//    name: tag
   635  	//    type: string
   636  	//    description: The tag to associate with the image on the registry.
   637  	//  - in: query
   638  	//    name: credentials
   639  	//    description: username:password for the registry.
   640  	//    type: string
   641  	//  - in: header
   642  	//    name: X-Registry-Auth
   643  	//    type: string
   644  	//    description: A base64-encoded auth configuration.
   645  	// produces:
   646  	// - application/json
   647  	// responses:
   648  	//   200:
   649  	//     description: no error
   650  	//     schema:
   651  	//      type: string
   652  	//      format: binary
   653  	//   404:
   654  	//     $ref: '#/responses/NoSuchImage'
   655  	//   500:
   656  	//     $ref: '#/responses/InternalError'
   657  	r.Handle(VersionedPath("/libpod/images/{name:.*}/push"), s.APIHandler(libpod.PushImage)).Methods(http.MethodPost)
   658  	// swagger:operation GET /libpod/images/{name:.*}/exists libpod libpodImageExists
   659  	// ---
   660  	// tags:
   661  	//  - images
   662  	// summary: Image exists
   663  	// description: Check if image exists in local store
   664  	// parameters:
   665  	//  - in: path
   666  	//    name: name:.*
   667  	//    type: string
   668  	//    required: true
   669  	//    description: the name or ID of the container
   670  	// produces:
   671  	// - application/json
   672  	// responses:
   673  	//   204:
   674  	//     description: image exists
   675  	//   404:
   676  	//     $ref: '#/responses/NoSuchImage'
   677  	//   500:
   678  	//     $ref: '#/responses/InternalError'
   679  	r.Handle(VersionedPath("/libpod/images/{name:.*}/exists"), s.APIHandler(libpod.ImageExists)).Methods(http.MethodGet)
   680  	// swagger:operation GET /libpod/images/{name:.*}/tree libpod libpodImageTree
   681  	// ---
   682  	// tags:
   683  	//  - images
   684  	// summary: Image tree
   685  	// description: Retrieve the image tree for the provided image name or ID
   686  	// parameters:
   687  	//  - in: path
   688  	//    name: name:.*
   689  	//    type: string
   690  	//    required: true
   691  	//    description: the name or ID of the container
   692  	//  - in: query
   693  	//    name: whatrequires
   694  	//    type: boolean
   695  	//    description: show all child images and layers of the specified image
   696  	// produces:
   697  	// - application/json
   698  	// responses:
   699  	//   200:
   700  	//     $ref: '#/responses/LibpodImageTreeResponse'
   701  	//   401:
   702  	//     $ref: '#/responses/NoSuchImage'
   703  	//   500:
   704  	//     $ref: '#/responses/InternalError'
   705  	r.Handle(VersionedPath("/libpod/images/{name:.*}/tree"), s.APIHandler(libpod.ImageTree)).Methods(http.MethodGet)
   706  	// swagger:operation GET /libpod/images/{name:.*}/history libpod libpodImageHistory
   707  	// ---
   708  	// tags:
   709  	//  - images
   710  	// summary: History of an image
   711  	// description: Return parent layers of an image.
   712  	// parameters:
   713  	//  - in: path
   714  	//    name: name:.*
   715  	//    type: string
   716  	//    required: true
   717  	//    description: the name or ID of the container
   718  	// produces:
   719  	// - application/json
   720  	// responses:
   721  	//   200:
   722  	//     $ref: "#/responses/DocsHistory"
   723  	//   404:
   724  	//     $ref: '#/responses/NoSuchImage'
   725  	//   500:
   726  	//     $ref: '#/responses/InternalError'
   727  	r.Handle(VersionedPath("/libpod/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet)
   728  	// swagger:operation GET /libpod/images/json libpod libpodListImages
   729  	// ---
   730  	// tags:
   731  	//  - images
   732  	// summary: List Images
   733  	// description: Returns a list of images on the server
   734  	// parameters:
   735  	//   - name: all
   736  	//     in: query
   737  	//     description: Show all images. Only images from a final layer (no children) are shown by default.
   738  	//     type: boolean
   739  	//     default: false
   740  	//   - name: filters
   741  	//     in: query
   742  	//     description: |
   743  	//        A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
   744  	//        - `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
   745  	//        - `dangling=true`
   746  	//        - `label=key` or `label="key=value"` of an image label
   747  	//        - `reference`=(`<image-name>[:<tag>]`)
   748  	//        - `id`=(`<image-id>`)
   749  	//        - `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
   750  	//     type: string
   751  	// produces:
   752  	// - application/json
   753  	// responses:
   754  	//   200:
   755  	//     $ref: "#/responses/DockerImageSummary"
   756  	//   500:
   757  	//     $ref: '#/responses/InternalError'
   758  	r.Handle(VersionedPath("/libpod/images/json"), s.APIHandler(libpod.GetImages)).Methods(http.MethodGet)
   759  	// swagger:operation POST /libpod/images/load libpod libpodImagesLoad
   760  	// ---
   761  	// tags:
   762  	//  - images
   763  	// summary: Load image
   764  	// description: Load an image (oci-archive or docker-archive) stream.
   765  	// parameters:
   766  	//   - in: query
   767  	//     name: reference
   768  	//     description: "Optional Name[:TAG] for the image"
   769  	//     type: string
   770  	//   - in: formData
   771  	//     name: upload
   772  	//     description: tarball of container image
   773  	//     type: file
   774  	//     required: true
   775  	// produces:
   776  	// - application/json
   777  	// responses:
   778  	//   200:
   779  	//     $ref: "#/responses/DocsLibpodImagesLoadResponse"
   780  	//   400:
   781  	//     $ref: "#/responses/BadParamError"
   782  	//   500:
   783  	//     $ref: '#/responses/InternalError'
   784  	r.Handle(VersionedPath("/libpod/images/load"), s.APIHandler(libpod.ImagesLoad)).Methods(http.MethodPost)
   785  	// swagger:operation POST /libpod/images/import libpod libpodImagesImport
   786  	// ---
   787  	// tags:
   788  	//  - images
   789  	// summary: Import image
   790  	// description: Import a previously exported tarball as an image.
   791  	// parameters:
   792  	//   - in: query
   793  	//     name: changes
   794  	//     description: "Apply the following possible instructions to the created image: CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR.  JSON encoded string"
   795  	//     type: array
   796  	//     items:
   797  	//       type: string
   798  	//   - in: query
   799  	//     name: message
   800  	//     description: Set commit message for imported image
   801  	//     type: string
   802  	//   - in: query
   803  	//     name: reference
   804  	//     description: "Optional Name[:TAG] for the image"
   805  	//     type: string
   806  	//   - in: query
   807  	//     name: url
   808  	//     description: Load image from the specified URL
   809  	//     type: string
   810  	//   - in: formData
   811  	//     name: upload
   812  	//     type: file
   813  	//     required: true
   814  	//     description: tarball for imported image
   815  	// produces:
   816  	// - application/json
   817  	// responses:
   818  	//   200:
   819  	//     $ref: "#/responses/DocsLibpodImagesImportResponse"
   820  	//   400:
   821  	//     $ref: "#/responses/BadParamError"
   822  	//   500:
   823  	//     $ref: '#/responses/InternalError'
   824  	r.Handle(VersionedPath("/libpod/images/import"), s.APIHandler(libpod.ImagesImport)).Methods(http.MethodPost)
   825  	// swagger:operation POST /libpod/images/pull libpod libpodImagesPull
   826  	// ---
   827  	// tags:
   828  	//  - images
   829  	// summary: Pull images
   830  	// description: Pull one or more images from a container registry.
   831  	// parameters:
   832  	//   - in: query
   833  	//     name: reference
   834  	//     description: "Mandatory reference to the image (e.g., quay.io/image/name:tag)"
   835  	//     type: string
   836  	//   - in: query
   837  	//     name: credentials
   838  	//     description: "username:password for the registry"
   839  	//     type: string
   840  	//   - in: query
   841  	//     name: overrideOS
   842  	//     description: Pull image for the specified operating system.
   843  	//     type: string
   844  	//   - in: query
   845  	//     name: overrideArch
   846  	//     description: Pull image for the specified architecture.
   847  	//     type: string
   848  	//   - in: query
   849  	//     name: tlsVerify
   850  	//     description: Require TLS verification.
   851  	//     type: boolean
   852  	//     default: true
   853  	//   - in: query
   854  	//     name: allTags
   855  	//     description: Pull all tagged images in the repository.
   856  	//     type: boolean
   857  	// produces:
   858  	// - application/json
   859  	// responses:
   860  	//   200:
   861  	//     $ref: "#/responses/DocsLibpodImagesPullResponse"
   862  	//   400:
   863  	//     $ref: "#/responses/BadParamError"
   864  	//   500:
   865  	//     $ref: '#/responses/InternalError'
   866  	r.Handle(VersionedPath("/libpod/images/pull"), s.APIHandler(libpod.ImagesPull)).Methods(http.MethodPost)
   867  	// swagger:operation POST /libpod/images/prune libpod libpodPruneImages
   868  	// ---
   869  	// tags:
   870  	//  - images
   871  	// summary: Prune unused images
   872  	// description: Remove images that are not being used by a container
   873  	// parameters:
   874  	//  - in: query
   875  	//    name: filters
   876  	//    type: string
   877  	//    description: |
   878  	//      filters to apply to image pruning, encoded as JSON (map[string][]string). Available filters:
   879  	//        - `dangling=<boolean>` When set to `true` (or `1`), prune only
   880  	//           unused *and* untagged images. When set to `false`
   881  	//           (or `0`), all unused images are pruned.
   882  	//        - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time.
   883  	//        - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels.
   884  	// produces:
   885  	// - application/json
   886  	// responses:
   887  	//   200:
   888  	//     $ref: "#/responses/DocsImageDeleteResponse"
   889  	//   500:
   890  	//     $ref: '#/responses/InternalError'
   891  	r.Handle(VersionedPath("/libpod/images/prune"), s.APIHandler(libpod.PruneImages)).Methods(http.MethodPost)
   892  	// swagger:operation GET /libpod/images/search libpod libpodSearchImages
   893  	// ---
   894  	// tags:
   895  	//  - images
   896  	// summary: Search images
   897  	// description: Search registries for images
   898  	// parameters:
   899  	//  - in: query
   900  	//    name: term
   901  	//    type: string
   902  	//    description: term to search
   903  	//  - in: query
   904  	//    name: limit
   905  	//    type: integer
   906  	//    description: maximum number of results
   907  	//  - in: query
   908  	//    name: filters
   909  	//    type: string
   910  	//    description: |
   911  	//        A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
   912  	//        - `is-automated=(true|false)`
   913  	//        - `is-official=(true|false)`
   914  	//        - `stars=<number>` Matches images that has at least 'number' stars.
   915  	// produces:
   916  	// - application/json
   917  	// responses:
   918  	//   200:
   919  	//      $ref: "#/responses/DocsSearchResponse"
   920  	//   500:
   921  	//      $ref: '#/responses/InternalError'
   922  	r.Handle(VersionedPath("/libpod/images/search"), s.APIHandler(libpod.SearchImages)).Methods(http.MethodGet)
   923  	// swagger:operation DELETE /libpod/images/{name:.*} libpod libpodRemoveImage
   924  	// ---
   925  	// tags:
   926  	//  - images
   927  	// summary: Remove Image
   928  	// description: Delete an image from local store
   929  	// parameters:
   930  	//  - in: path
   931  	//    name: name:.*
   932  	//    type: string
   933  	//    required: true
   934  	//    description: name or ID of image to delete
   935  	//  - in: query
   936  	//    name: force
   937  	//    type: boolean
   938  	//    description: remove the image even if used by containers or has other tags
   939  	// produces:
   940  	// - application/json
   941  	// responses:
   942  	//   200:
   943  	//     $ref: "#/responses/DocsImageDeleteResponse"
   944  	//   400:
   945  	//     $ref: "#/responses/BadParamError"
   946  	//   404:
   947  	//     $ref: '#/responses/NoSuchImage'
   948  	//   409:
   949  	//     $ref: '#/responses/ConflictError'
   950  	//   500:
   951  	//     $ref: '#/responses/InternalError'
   952  	r.Handle(VersionedPath("/libpod/images/{name:.*}"), s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete)
   953  	// swagger:operation GET /libpod/images/{name:.*}/get libpod libpodExportImage
   954  	// ---
   955  	// tags:
   956  	//  - images
   957  	// summary: Export an image
   958  	// description: Export an image
   959  	// parameters:
   960  	//  - in: path
   961  	//    name: name:.*
   962  	//    type: string
   963  	//    required: true
   964  	//    description: the name or ID of the container
   965  	//  - in: query
   966  	//    name: format
   967  	//    type: string
   968  	//    description: format for exported image
   969  	//  - in: query
   970  	//    name: compress
   971  	//    type: boolean
   972  	//    description: use compression on image
   973  	// produces:
   974  	// - application/json
   975  	// responses:
   976  	//   200:
   977  	//     description: no error
   978  	//     schema:
   979  	//      type: string
   980  	//      format: binary
   981  	//   404:
   982  	//     $ref: '#/responses/NoSuchImage'
   983  	//   500:
   984  	//     $ref: '#/responses/InternalError'
   985  	r.Handle(VersionedPath("/libpod/images/{name:.*}/get"), s.APIHandler(libpod.ExportImage)).Methods(http.MethodGet)
   986  	// swagger:operation GET /libpod/images/{name:.*}/json libpod libpodInspectImage
   987  	// ---
   988  	// tags:
   989  	//  - images
   990  	// summary: Inspect an image
   991  	// description: Obtain low-level information about an image
   992  	// parameters:
   993  	//  - in: path
   994  	//    name: name:.*
   995  	//    type: string
   996  	//    required: true
   997  	//    description: the name or ID of the container
   998  	// produces:
   999  	// - application/json
  1000  	// responses:
  1001  	//   200:
  1002  	//     $ref: "#/responses/DocsLibpodInspectImageResponse"
  1003  	//   404:
  1004  	//     $ref: '#/responses/NoSuchImage'
  1005  	//   500:
  1006  	//     $ref: '#/responses/InternalError'
  1007  	r.Handle(VersionedPath("/libpod/images/{name:.*}/json"), s.APIHandler(libpod.GetImage)).Methods(http.MethodGet)
  1008  	// swagger:operation POST /libpod/images/{name:.*}/tag libpod libpodTagImage
  1009  	// ---
  1010  	// tags:
  1011  	//  - images
  1012  	// summary: Tag an image
  1013  	// description: Tag an image so that it becomes part of a repository.
  1014  	// parameters:
  1015  	//  - in: path
  1016  	//    name: name:.*
  1017  	//    type: string
  1018  	//    required: true
  1019  	//    description: the name or ID of the container
  1020  	//  - in: query
  1021  	//    name: repo
  1022  	//    type: string
  1023  	//    description: the repository to tag in
  1024  	//  - in: query
  1025  	//    name: tag
  1026  	//    type: string
  1027  	//    description: the name of the new tag
  1028  	// produces:
  1029  	// - application/json
  1030  	// responses:
  1031  	//   201:
  1032  	//     description: no error
  1033  	//   400:
  1034  	//     $ref: '#/responses/BadParamError'
  1035  	//   404:
  1036  	//     $ref: '#/responses/NoSuchImage'
  1037  	//   409:
  1038  	//     $ref: '#/responses/ConflictError'
  1039  	//   500:
  1040  	//     $ref: '#/responses/InternalError'
  1041  	r.Handle(VersionedPath("/libpod/images/{name:.*}/tag"), s.APIHandler(compat.TagImage)).Methods(http.MethodPost)
  1042  	// swagger:operation POST /libpod/commit libpod libpodCommitContainer
  1043  	// ---
  1044  	// tags:
  1045  	//  - containers
  1046  	// summary: Commit
  1047  	// description: Create a new image from a container
  1048  	// parameters:
  1049  	//  - in: query
  1050  	//    name: container
  1051  	//    type: string
  1052  	//    description: the name or ID of a container
  1053  	//    required: true
  1054  	//  - in: query
  1055  	//    name: repo
  1056  	//    type: string
  1057  	//    description: the repository name for the created image
  1058  	//  - in: query
  1059  	//    name: tag
  1060  	//    type: string
  1061  	//    description: tag name for the created image
  1062  	//  - in: query
  1063  	//    name: comment
  1064  	//    type: string
  1065  	//    description: commit message
  1066  	//  - in: query
  1067  	//    name: author
  1068  	//    type: string
  1069  	//    description: author of the image
  1070  	//  - in: query
  1071  	//    name: pause
  1072  	//    type: boolean
  1073  	//    description: pause the container before committing it
  1074  	//  - in: query
  1075  	//    name: changes
  1076  	//    description: instructions to apply while committing in Dockerfile format (i.e. "CMD=/bin/foo")
  1077  	//    type: array
  1078  	//    items:
  1079  	//       type: string
  1080  	//  - in: query
  1081  	//    name: format
  1082  	//    type: string
  1083  	//    description: format of the image manifest and metadata (default "oci")
  1084  	// produces:
  1085  	// - application/json
  1086  	// responses:
  1087  	//   201:
  1088  	//     description: no error
  1089  	//   404:
  1090  	//     $ref: '#/responses/NoSuchImage'
  1091  	//   500:
  1092  	//     $ref: '#/responses/InternalError'
  1093  	r.Handle(VersionedPath("/libpod/commit"), s.APIHandler(libpod.CommitContainer)).Methods(http.MethodPost)
  1094  	// swagger:operation POST /libpod/images/{name:.*}/untag libpod libpodUntagImage
  1095  	// ---
  1096  	// tags:
  1097  	//  - images
  1098  	// summary: Untag an image
  1099  	// description: Untag an image
  1100  	// parameters:
  1101  	//  - in: path
  1102  	//    name: name:.*
  1103  	//    type: string
  1104  	//    required: true
  1105  	//    description: the name or ID of the container
  1106  	//  - in: query
  1107  	//    name: repo
  1108  	//    type: string
  1109  	//    description: the repository to untag
  1110  	//  - in: query
  1111  	//    name: tag
  1112  	//    type: string
  1113  	//    description: the name of the tag to untag
  1114  	// produces:
  1115  	// - application/json
  1116  	// responses:
  1117  	//   201:
  1118  	//     description: no error
  1119  	//   400:
  1120  	//     $ref: '#/responses/BadParamError'
  1121  	//   404:
  1122  	//     $ref: '#/responses/NoSuchImage'
  1123  	//   409:
  1124  	//     $ref: '#/responses/ConflictError'
  1125  	//   500:
  1126  	//     $ref: '#/responses/InternalError'
  1127  	r.Handle(VersionedPath("/libpod/images/{name:.*}/untag"), s.APIHandler(libpod.UntagImage)).Methods(http.MethodPost)
  1128  
  1129  	// swagger:operation GET /libpod/images/{name}/changes libpod libpodChangesImages
  1130  	// ---
  1131  	// tags:
  1132  	//   - images
  1133  	// summary: Report on changes to images's filesystem; adds, deletes or modifications.
  1134  	// description: |
  1135  	//   Returns which files in a images's filesystem have been added, deleted, or modified. The Kind of modification can be one of:
  1136  	//
  1137  	//   0: Modified
  1138  	//   1: Added
  1139  	//   2: Deleted
  1140  	// parameters:
  1141  	//  - in: path
  1142  	//    name: name
  1143  	//    type: string
  1144  	//    required: true
  1145  	//    description: the name or id of the container
  1146  	// responses:
  1147  	//   200:
  1148  	//     description: Array of Changes
  1149  	//     content:
  1150  	//       application/json:
  1151  	//       schema:
  1152  	//         $ref: "#/responses/Changes"
  1153  	//   404:
  1154  	//     $ref: "#/responses/NoSuchContainer"
  1155  	//   500:
  1156  	//     $ref: "#/responses/InternalError"
  1157  	r.HandleFunc(VersionedPath("/libpod/images/{name}/changes"), s.APIHandler(compat.Changes))
  1158  
  1159  	return nil
  1160  }