Browse code

Merge pull request #30702 from allencloud/update-api-docs-about-filters

add missing filter type in swagger.yml and sort filter type in alphabets

Brian Goff authored on 2017/02/10 00:33:49
Showing 3 changed files
... ...
@@ -2489,22 +2489,23 @@ paths:
2489 2489
         - name: "filters"
2490 2490
           in: "query"
2491 2491
           description: |
2492
-            Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers.
2492
+            Filters to process on the container list, encoded as JSON (a `map[string][]string`). For example, `{"status": ["paused"]}` will only return paused containers. Available filters:
2493 2493
 
2494
-            Available filters:
2494
+            - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`)
2495
+            - `before`=(`<container id>` or `<container name>`)
2496
+            - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
2495 2497
             - `exited=<int>` containers with exit code of `<int>`
2496
-            - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
2497
-            - `label=key` or `label="key=value"` of a container label
2498
-            - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
2498
+            - `health`=(`starting`|`healthy`|`unhealthy`|`none`)
2499 2499
             - `id=<ID>` a container's ID
2500
-            - `name=<name>` a container's name
2500
+            - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
2501 2501
             - `is-task=`(`true`|`false`)
2502
-            - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`)
2503
-            - `before`=(`<container id>` or `<container name>`)
2502
+            - `label=key` or `label="key=value"` of a container label
2503
+            - `name=<name>` a container's name
2504
+            - `network`=(`<network id>` or `<network name>`)
2505
+            - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`)
2504 2506
             - `since`=(`<container id>` or `<container name>`)
2507
+            - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`)
2505 2508
             - `volume`=(`<volume name>` or `<mount point destination>`)
2506
-            - `network`=(`<network id>` or `<network name>`)
2507
-            - `health`=(`starting`|`healthy`|`unhealthy`|`none`)
2508 2509
           type: "string"
2509 2510
       responses:
2510 2511
         200:
... ...
@@ -4310,14 +4311,13 @@ paths:
4310 4310
         - name: "filters"
4311 4311
           in: "query"
4312 4312
           description: |
4313
-            A JSON encoded value of the filters (a `map[string][]string`) to process on the images list.
4313
+            A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
4314 4314
 
4315
-            Available filters:
4315
+            - `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
4316 4316
             - `dangling=true`
4317 4317
             - `label=key` or `label="key=value"` of an image label
4318
-            - `before`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
4319
-            - `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
4320 4318
             - `reference`=(`<image-name>[:<tag>]`)
4319
+            - `since`=(`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`)
4321 4320
           type: "string"
4322 4321
         - name: "digests"
4323 4322
           in: "query"
... ...
@@ -4899,9 +4899,9 @@ paths:
4899 4899
           description: |
4900 4900
             A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters:
4901 4901
 
4902
-            - `stars=<number>`
4903 4902
             - `is-automated=(true|false)`
4904 4903
             - `is-official=(true|false)`
4904
+            - `stars=<number>` Matches images that has at least 'number' stars.
4905 4905
           type: "string"
4906 4906
       tags: ["Image"]
4907 4907
   /images/prune:
... ...
@@ -4914,9 +4914,8 @@ paths:
4914 4914
         - name: "filters"
4915 4915
           in: "query"
4916 4916
           description: |
4917
-            Filters to process on the prune list, encoded as JSON (a `map[string][]string`).
4917
+            Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters:
4918 4918
 
4919
-            Available filters:
4920 4919
             - `dangling=<boolean>` When set to `true` (or `1`), prune only
4921 4920
                unused *and* untagged images. When set to `false`
4922 4921
                (or `0`), all unused images are pruned.
... ...
@@ -5411,13 +5410,14 @@ paths:
5411 5411
             A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters:
5412 5412
 
5413 5413
             - `container=<string>` container name or ID
5414
+            - `daemon=<string>` daemon name or ID
5414 5415
             - `event=<string>` event type
5415 5416
             - `image=<string>` image name or ID
5416 5417
             - `label=<string>` image or container label
5418
+            - `network=<string>` network name or ID
5419
+            - `plugin`=<string> plugin name or ID
5417 5420
             - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, or `daemon`
5418 5421
             - `volume=<string>` volume name or ID
5419
-            - `network=<string>` network name or ID
5420
-            - `daemon=<string>` daemon name or ID
5421 5422
           type: "string"
5422 5423
       tags: ["System"]
5423 5424
   /system/df:
... ...
@@ -5891,13 +5891,14 @@ paths:
5891 5891
             JSON encoded value of the filters (a `map[string][]string`) to
5892 5892
             process on the volumes list. Available filters:
5893 5893
 
5894
-            - `name=<volume-name>` Matches all or part of a volume name.
5895 5894
             - `dangling=<boolean>` When set to `true` (or `1`), returns all
5896 5895
                volumes that are not in use by a container. When set to `false`
5897 5896
                (or `0`), only volumes that are in use by one or more
5898 5897
                containers are returned.
5899
-            - `driver=<volume-driver-name>` Matches all or part of a volume
5900
-              driver name.
5898
+            - `driver=<volume-driver-name>` Matches volumes based on their driver.
5899
+            - `label=<key>` or `label=<key>:<value>` Matches volumes based on
5900
+               the presence of a `label` alone or a `label` and a value.
5901
+            - `name=<volume-name>` Matches all or part of a volume name.
5901 5902
           type: "string"
5902 5903
           format: "json"
5903 5904
       tags: ["Volume"]
... ...
@@ -7264,8 +7265,8 @@ paths:
7264 7264
             A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters:
7265 7265
 
7266 7266
             - `id=<service id>`
7267
-            - `name=<service name>`
7268 7267
             - `label=<service label>`
7268
+            - `name=<service name>`
7269 7269
       tags: ["Service"]
7270 7270
   /services/create:
7271 7271
     post:
... ...
@@ -7728,12 +7729,12 @@ paths:
7728 7728
           description: |
7729 7729
             A JSON encoded value of the filters (a `map[string][]string`) to process on the tasks list. Available filters:
7730 7730
 
7731
+            - `desired-state=(running | shutdown | accepted)`
7731 7732
             - `id=<task id>`
7733
+            - `label=key` or `label="key=value"`
7732 7734
             - `name=<task name>`
7733
-            - `service=<service name>`
7734 7735
             - `node=<node id or name>`
7735
-            - `label=key` or `label="key=value"`
7736
-            - `desired-state=(running | shutdown | accepted)`
7736
+            - `service=<service name>`
7737 7737
       tags: ["Task"]
7738 7738
   /tasks/{id}:
7739 7739
     get:
... ...
@@ -143,14 +143,14 @@ container container 588a23dac085 *AND* the event type is *start*
143 143
 The currently supported filters are:
144 144
 
145 145
 * container (`container=<name or id>`)
146
+* daemon (`daemon=<name or id>`)
146 147
 * event (`event=<event action>`)
147 148
 * image (`image=<tag or id>`)
148
-* plugin (experimental) (`plugin=<name or id>`)
149 149
 * label (`label=<key>` or `label=<key>=<value>`)
150
+* network (`network=<name or id>`)
151
+* plugin (`plugin=<name or id>`)
150 152
 * type (`type=<container or image or volume or network or daemon>`)
151 153
 * volume (`volume=<name or id>`)
152
-* network (`network=<name or id>`)
153
-* daemon (`daemon=<name or id>`)
154 154
 
155 155
 #### Format
156 156
 
... ...
@@ -23,19 +23,22 @@ List containers
23 23
 Options:
24 24
   -a, --all             Show all containers (default shows just running)
25 25
   -f, --filter value    Filter output based on conditions provided (default [])
26
-                        - exited=<int> an exit code of <int>
27
-                        - label=<key> or label=<key>=<value>
28
-                        - status=(created|restarting|removing|running|paused|exited)
29
-                        - name=<string> a container's name
30
-                        - id=<ID> a container's ID
31
-                        - before=(<container-name>|<container-id>)
32
-                        - since=(<container-name>|<container-id>)
33 26
                         - ancestor=(<image-name>[:tag]|<image-id>|<image@digest>)
34 27
                           containers created from an image or a descendant.
35
-                        - publish=(<port>[/<proto>]|<startport-endport>/[<proto>])
28
+                        - before=(<container-name>|<container-id>)
36 29
                         - expose=(<port>[/<proto>]|<startport-endport>/[<proto>])
37
-                        - is-task=(true|false)
30
+                        - exited=<int> an exit code of <int>
38 31
                         - health=(starting|healthy|unhealthy|none)
32
+                        - id=<ID> a container's ID
33
+                        - isolation=(`default`|`process`|`hyperv`) (Windows daemon only)
34
+                        - is-task=(true|false)
35
+                        - label=<key> or label=<key>=<value>
36
+                        - name=<string> a container's name
37
+                        - network=(<network-id>|<network-name>)
38
+                        - publish=(<port>[/<proto>]|<startport-endport>/[<proto>])
39
+                        - since=(<container-name>|<container-id>)
40
+                        - status=(created|restarting|removing|running|paused|exited) 
41
+                        - volume=(<volume name>|<mount point destination>)
39 42
       --format string   Pretty-print containers using a Go template
40 43
       --help            Print usage
41 44
   -n, --last int        Show n last created containers (includes all states) (default -1)