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