forked from AliyunContainerService/pouch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yml
4382 lines (4170 loc) · 137 KB
/
swagger.yml
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
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
swagger: "2.0"
schemes:
- "http"
- "https"
produces:
- "application/json"
- "text/plain"
consumes:
- "application/json"
- "text/plain"
basePath: "/v1.24"
info:
title: "Pouch Engine API"
version: "1.24"
description: |
API is an HTTP API served by Pouch Engine.
paths:
/_ping:
get:
summary: ""
description: ""
responses:
200:
description: "no error"
schema:
type: "string"
example: "OK"
500:
$ref: "#/responses/500ErrorResponse"
/version:
get:
summary: "Get Pouchd version"
description: ""
responses:
200:
schema:
$ref: '#/definitions/SystemVersion'
description: "no error"
500:
$ref: "#/responses/500ErrorResponse"
/info:
get:
summary: "Get System information"
description: ""
responses:
200:
schema:
$ref: '#/definitions/SystemInfo'
description: "no error"
500:
$ref: "#/responses/500ErrorResponse"
/auth:
post:
summary: "Check auth configuration"
description: "Validate credentials for a registry and, if available, get an identity token for accessing the registry without password."
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "An identity token was generated successfully."
schema:
$ref: "#/definitions/AuthResponse"
401:
$ref: "#/responses/401ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "authConfig"
in: "body"
description: "Authentication to check"
schema:
$ref: "#/definitions/AuthConfig"
/daemon/update:
post:
summary: "Update daemon's labels and image proxy"
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "no error"
400:
description: "bad parameter"
schema:
$ref: '#/definitions/Error'
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "DaemonUpdateConfig"
in: body
description: "Config used to update daemon, only labels and image proxy are allowed."
schema:
$ref: "#/definitions/DaemonUpdateConfig"
/events:
get:
summary: "Subscribe pouchd events to users"
description: |
Stream real-time events from the server.
Report various object events of pouchd when something happens to them.
Containers report these events: create`, `destroy`, `die`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update` and `exec_die`
Images report these events: `pull`, `untag`
Volumes report these events: `create`, `destroy`
Networks report these events: `create`, `connect`, `disconnect`, `destroy`
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
$ref: '#/definitions/EventsMessage'
400:
description: "bad parameter"
schema:
$ref: '#/definitions/Error'
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "since"
in: "query"
description: "Show events created since this timestamp then stream new events."
type: "string"
- name: "until"
in: "query"
description: "Show events created until this timestamp then stop streaming"
type: "string"
- name: "filters"
in: "query"
description: |
A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:
- `container=<string>` container name or ID
- `event=<string>` event type
- `image=<string>` image name or ID
- `label=<string>` image or container label
- `network=<string>` network name or ID
- `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`
- `volume=<string>` volume name
type: "string"
/images/create:
post:
summary: "Create an image by pulling from a registry or importing from an existing source file"
consumes:
- "text/plain"
- "application/octet-stream"
produces:
- "application/json"
responses:
200:
description: "no error"
404:
schema:
$ref: '#/definitions/Error'
description: "image not found"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "fromImage"
in: "query"
description: "Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed."
type: "string"
- name: "fromSrc"
in: "query"
description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image."
type: "string"
- name: "repo"
in: "query"
description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image."
type: "string"
- name: "tag"
in: "query"
description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled."
type: "string"
- name: "inputImage"
in: "body"
description: "Image content if the value `-` has been specified in fromSrc query parameter"
schema:
type: "string"
required: false
- name: "X-Registry-Auth"
in: "header"
description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
type: "string"
/images/load:
post:
summary: "Import images"
description: |
Load a set of images by oci.v1 format tar stream
consumes:
- application/x-tar
responses:
200:
description: "no error"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "imageTarStream"
in: "body"
description: "tar stream containing images"
schema:
type: "string"
format: "binary"
- name: "name"
in: "query"
description: "set the image name for the tar stream, default unknown/unknown"
type: "string"
/images/save:
get:
summary: "Save image"
description: |
Save an image by oci.v1 format tar stream.
produces:
- application/x-tar
responses:
200:
description: "no error"
schema:
type: "string"
format: "binary"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "name"
in: "query"
description: "Image name which is to be saved"
type: "string"
/images/{imageid}/json:
get:
summary: "Inspect an image"
description: "Return the information about image"
operationId: "ImageInspect"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
$ref: "#/definitions/ImageInfo"
examples:
application/json:
CreatedAt: "2017-12-19 15:32:09"
Digest: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8"
ID: "e216a057b1cb"
Name: "ubuntu:12.04"
Size: 103579269
Tag: "12.04"
404:
description: "no such image"
schema:
$ref: "#/definitions/Error"
examples:
application/json:
message: "No such image: e216a057b1cb"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- $ref: "#/parameters/imageid"
/images/{imageid}/history:
get:
summary: "Get an image's history"
description: "Return the history of each layer of image"
operationId: "ImageHistory"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
type: "array"
items:
$ref: "#/definitions/HistoryResultItem"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- $ref: "#/parameters/imageid"
/images/json:
get:
summary: "List Images"
description: "Return a list of stored images."
operationId: "ImageList"
produces:
- "application/json"
responses:
200:
description: "Summary image data for the images matching the query"
schema:
type: "array"
items:
$ref: "#/definitions/ImageInfo"
examples:
application/json:
- Id: "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8"
ParentId: ""
RepoTags:
- "ubuntu:12.04"
- "ubuntu:precise"
RepoDigests:
- "ubuntu@sha256:992069aee4016783df6345315302fa59681aae51a8eeb2f889dea59290f21787"
Created: 1474925151
Size: 103579269
VirtualSize: 103579269
SharedSize: 0
Labels: {}
Containers: 2
- Id: "sha256:3e314f95dcace0f5e4fd37b10862fe8398e3c60ed36600bc0ca5fda78b087175"
ParentId: ""
RepoTags:
- "ubuntu:12.10"
- "ubuntu:quantal"
RepoDigests:
- "ubuntu@sha256:002fba3e3255af10be97ea26e476692a7ebed0bb074a9ab960b2e7a1526b15d7"
- "ubuntu@sha256:68ea0200f0b90df725d99d823905b04cf844f6039ef60c60bf3e019915017bd3"
Created: 1403128455
Size: 172064416
VirtualSize: 172064416
SharedSize: 0
Labels: {}
Containers: 5
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "all"
in: "query"
description: "Show all images. Only images from a final layer (no children) are shown by default."
type: "boolean"
- 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>`)
- `reference`=(`<image-name>[:<tag>]`)
- `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`)
type: "string"
- name: "digests"
in: "query"
description: "Show digest information as a `RepoDigests` field on each image."
type: "boolean"
/images/search:
get:
summary: "Search images"
produces:
- "application/json"
responses:
200:
description: "No error"
schema:
type: "array"
items:
$ref: "#/definitions/SearchResultItem"
500:
$ref: "#/responses/500ErrorResponse"
/images/{imageid}/tag:
post:
summary: "Tag an image"
description: "Add tag reference to the existing image"
parameters:
- $ref: "#/parameters/imageid"
- name: "repo"
in: "query"
description: "The repository to tag in. For example, `someuser/someimage`."
type: "string"
- name: "tag"
in: "query"
description: "The name of the new tag."
type: "string"
responses:
201:
description: "No error"
400:
description: "Bad parameter"
schema:
$ref: "#/definitions/Error"
404:
description: "no such image"
schema:
$ref: "#/definitions/Error"
500:
$ref: "#/responses/500ErrorResponse"
/images/{imageid}:
delete:
summary: "Remove an image"
description: "Remove an image by reference."
parameters:
- $ref: "#/parameters/imageid"
- name: "force"
in: "query"
description: "Remove the image even if it is being used"
type: "boolean"
default: false
responses:
204:
description: "No error"
404:
description: "no such image"
schema:
$ref: "#/definitions/Error"
examples:
application/json:
message: "No such image: c2ada9df5af8"
500:
$ref: "#/responses/500ErrorResponse"
/images/{imageid}/push:
post:
summary: "push an image"
description: "push an image on the registry"
operationId: "ImagePush"
consumes:
- "application/octet-stream"
produces:
- "application/json"
parameters:
- $ref: "#/parameters/imageid"
- name: "tag"
in: "query"
description: "the tag to associate with the image on the registry. This is optional."
type: "string"
- name: "X-Registry-Auth"
in: "header"
description: "A base64-encoded auth configuration. [See the authentication section for details.](#section/Authentication)"
type: "string"
responses:
200:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
/containers/create:
post:
summary: "Create a container"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "name"
in: "query"
description: "Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`."
type: "string"
pattern: "/?[a-zA-Z0-9_-]+"
- name: "body"
in: "body"
description: "Container to create"
schema:
$ref: "#/definitions/ContainerCreateConfig"
required: true
responses:
201:
description: "Container created successfully"
schema:
$ref: "#/definitions/ContainerCreateResp"
examples:
application/json:
Id: "e90e34656806"
Warnings: []
400:
description: "bad parameter"
schema:
$ref: "#/definitions/Error"
404:
description: "no such image"
schema:
$ref: "#/definitions/Error"
examples:
application/json:
message: "image: xxx:latest: not found"
409:
description: "conflict"
schema:
$ref: "#/definitions/Error"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/json:
get:
summary: "Inspect a container"
description: "Return low-level information about a container."
operationId: "ContainerInspect"
produces:
- "application/json"
responses:
200:
description: "no error"
schema:
$ref: "#/definitions/ContainerJSON"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- $ref: "#/parameters/id"
- name: "size"
in: "query"
type: "boolean"
description: "Return the size of container as fields `SizeRw` and `SizeRootFs`"
tags: ["Container"]
/containers/json:
get:
summary: "List containers"
operationId: "ContainerList"
produces: ["application/json"]
responses:
200:
description: "Summary containers that matches the query"
schema:
type: "array"
items:
$ref: "#/definitions/Container"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "all"
in: "query"
description: "Return all containers. By default, only running containers are shown"
type: "boolean"
default: false
- name: "filters"
in: "query"
description: |
Filters encoded as JSON string(type map[string][]string in Golang). This API will list containers match all of the filters. For example, `{"status": ["paused"]}` will only return paused containers.
Available filters:
- `id=<ID>` container ID filter, support regular expression.
- `name=<name>` container name filter, support regular expression.
- `status=<status>` container status filter, support regular expression.
- `label=<key>=<value>` container label filter, support equal and unequal operator. such as `label=[k=a,k!=b]`.
type: "string"
/containers/{id}/rename:
post:
summary: "Rename a container"
operationId: "ContainerRename"
parameters:
- $ref: "#/parameters/id"
- name: "name"
in: "query"
required: true
description: "New name for the container"
type: "string"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
409:
description: "name already in use"
schema:
$ref: "#/definitions/Error"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/restart:
post:
summary: "Restart a container"
operationId: "ContainerRestart"
parameters:
- $ref: "#/parameters/id"
- name: "name"
in: "query"
required: true
description: "New name for the container"
type: "string"
- name: "t"
in: "query"
description: "Number of seconds to wait before killing the container"
type: "integer"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/start:
post:
summary: "Start a container"
operationId: "ContainerStart"
parameters:
- $ref: "#/parameters/id"
- name: "detachKeys"
in: "query"
description: "Override the key sequence for detaching a container. Format is a single character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`."
type: "string"
- name: "checkpoint-dir"
in: "query"
description: "checkpoint directory"
type: "string"
- name: "checkpoint"
in: "query"
description: "checkpoint id"
type: "string"
responses:
204:
description: "no error"
304:
description: "container already started"
404:
$ref: "#/responses/404ErrorResponse"
409:
description: "container is paused"
schema:
$ref: "#/definitions/Error"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/stop:
post:
summary: "Stop a container"
operationId: "ContainerStop"
parameters:
- $ref: "#/parameters/id"
- name: "t"
in: "query"
description: "Number of seconds to wait before killing the container"
type: "integer"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/pause:
post:
summary: "Pause a container"
operationId: "ContainerPause"
parameters:
- $ref: "#/parameters/id"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/unpause:
post:
summary: "Unpause a container"
operationId: "ContainerUnpause"
parameters:
- $ref: "#/parameters/id"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/top:
get:
summary: "Display the running processes of a container"
operationId: "ContainerTop"
parameters:
- $ref: "#/parameters/id"
- name: "ps_args"
in: "query"
description: "top arguments"
type: "string"
responses:
200:
description: "no error"
schema:
$ref: "#/definitions/ContainerProcessList"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/wait:
post:
summary: "Block until a container stops, then returns the exit code."
operationId: "ContainerWait"
parameters:
- $ref: "#/parameters/id"
responses:
200:
description: "The container has exited."
schema:
type: "object"
required: [StatusCode]
properties:
StatusCode:
description: "Exit code of the container"
type: "integer"
x-nullable: false
Error:
description: "The error message of waiting container"
type: "string"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}:
delete:
summary: "Remove one container"
operationId: "ContainerRemove"
parameters:
- $ref: "#/parameters/id"
- name: "force"
in: "query"
description: "If the container is running, force query is used to kill it and remove it forcefully."
type: "boolean"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/exec:
post:
summary: "Create an exec instance"
description: "Run a command inside a running container."
operationId: "ContainerExec"
consumes:
- "application/json"
produces:
- "application/json"
responses:
201:
description: "no error"
schema:
$ref: "#/definitions/ExecCreateResp"
404:
$ref: "#/responses/404ErrorResponse"
409:
description: "container is paused"
schema:
$ref: "#/definitions/Error"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- $ref: "#/parameters/id"
- name: "body"
in: "body"
schema:
$ref: "#/definitions/ExecCreateConfig"
required: true
tags: ["Exec"]
/containers/{id}/logs:
get:
summary: "Get container logs"
description: |
Get `stdout` and `stderr` logs from a container.
Note: This endpoint works only for containers with the `json-file` or `journald` logging driver.
operationId: "ContainerLogs"
responses:
101:
description: "logs returned as a stream"
schema:
type: "string"
format: "binary"
200:
description: "logs returned as a string in response body"
schema:
type: "string"
400:
description: "bad parameter"
schema:
$ref: "#/definitions/Error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "follow"
in: "query"
description: |
Return the logs as a stream.
type: "boolean"
default: false
- name: "stdout"
in: "query"
description: "Return logs from `stdout`"
type: "boolean"
default: false
- name: "stderr"
in: "query"
description: "Return logs from `stderr`"
type: "boolean"
default: false
- name: "since"
in: "query"
description: "Only return logs since this time, as a UNIX timestamp"
type: "integer"
default: 0
- name: "until"
in: "query"
description: "Only return logs before this time, as a UNIX timestamp"
type: "integer"
default: 0
- name: "timestamps"
in: "query"
description: "Add timestamps to every log line"
type: "boolean"
default: false
- name: "tail"
in: "query"
description: "Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines."
type: "string"
default: "all"
tags: ["Container"]
/containers/{id}/stats:
get:
summary: "Get container stats based on resource usage"
description: |
This endpoint returns a live stream of a container’s resource usage
statistics.
The `precpu_stats` is the CPU statistic of the *previous* read, and is
used to calculate the CPU usage percentage. It is not an exact copy
of the `cpu_stats` field.
If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
nil then for compatibility with older daemons the length of the
corresponding `cpu_usage.percpu_usage` array should be used.
operationId: "ContainerStats"
produces: ["application/json"]
responses:
200:
description: container stats
schema:
$ref: "#/definitions/ContainerStats"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
parameters:
- name: "id"
in: "path"
required: true
description: "ID or name of the container"
type: "string"
- name: "stream"
in: "query"
description: "Stream the output. If false, the stats will be output once and then it will disconnect."
type: "boolean"
default: true
tags: ["Container"]
/containers/{id}/resize:
post:
summary: "changes the size of the tty for a container"
operationId: "ContainerResize"
parameters:
- $ref: "#/parameters/id"
- name: "h"
in: "query"
description: "height of the tty"
type: "string"
- name: "w"
in: "query"
description: "width of the tty"
type: "string"
responses:
200:
description: "no error"
400:
description: "bad parameter"
schema:
$ref: "#/definitions/Error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/containers/{id}/checkpoints:
post:
summary: "create a checkpoint from a running container"
operationId: "ContainerCheckpointCreate"
parameters:
- $ref: "#/parameters/id"
- name: "body"
in: "body"
schema:
$ref: "#/definitions/CheckpointCreateOptions"
responses:
201:
description: "created"
400:
description: "bad parameter"
schema:
$ref: "#/definitions/Error"
404:
$ref: "#/responses/404ErrorResponse"
tags: ["Container"]
get:
summary: "list checkpoints of a container"
operationId: "ContainerCheckpointList"
parameters:
- $ref: "#/parameters/id"
- name: "checkpointdir"
in: "query"
description: "checkpoint directory"
type: "string"
responses:
200:
description: "no error"
400:
description: "bad parameter"
schema:
$ref: "#/definitions/Error"
404:
$ref: "#/responses/404ErrorResponse"
tags: ["Container"]
/containers/{id}/checkpoints/{checkpointId}:
delete:
summary: "delete a checkpoint of a container"
operationId: "ContainerCheckpointDelete"
parameters:
- $ref: "#/parameters/id"
- name: "checkpointId"
in: "path"
description: "checkpoint id"
type: "string"
required: true
- name: "dir"
in: "query"
description: "checkpoint directory"
type: "string"
responses:
204:
description: "no error"
404:
$ref: "#/responses/404ErrorResponse"
500:
$ref: "#/responses/500ErrorResponse"
tags: ["Container"]
/exec/{id}/start:
post:
summary: "Start an exec instance"
description: "Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command."
operationId: "ExecStart"
consumes:
- "application/json"
produces:
- "application/vnd.raw-stream"
responses:
200:
description: "No error"
404:
description: "No such exec instance"
schema:
$ref: "#/definitions/Error"
409:
description: "Container is stopped or paused"
schema:
$ref: "#/definitions/Error"