Browse code

update swagger and docs

Signed-off-by: Victor Vieux <vieux@docker.com>

Victor Vieux authored on 2016/11/11 03:15:16
Showing 2 changed files
... ...
@@ -6471,7 +6471,9 @@ paths:
6471 6471
   /plugins/{name}/set:
6472 6472
     post:
6473 6473
       summary: "Configure a plugin"
6474
-      operationId: "PluginsSet"
6474
+      operationId: "PostPluginsSet"
6475
+      consumes:
6476
+        - "application/json"
6475 6477
       parameters:
6476 6478
         - name: "name"
6477 6479
           in: "path"
... ...
@@ -27,20 +27,67 @@ Options:
27 27
 
28 28
 Change settings for a plugin. The plugin must be disabled.
29 29
 
30
+The settings currently supported are:
31
+ * env variables
32
+ * source of mounts
33
+ * path of devices
34
+ * args
30 35
 
31
-The following example installs change the env variable `DEBUG` of the
36
+The following example change the env variable `DEBUG` on the
32 37
 `no-remove` plugin.
33 38
 
34 39
 ```bash
35
-$ docker plugin inspect -f {{.Config.Env}} tiborvass/no-remove
40
+$ docker plugin inspect -f {{.Settings.Env}} tiborvass/no-remove
36 41
 [DEBUG=0]
37 42
 
38
-$ docker plugin set DEBUG=1 tiborvass/no-remove
43
+$ docker plugin set tiborvass/no-remove DEBUG=1
39 44
 
40
-$ docker plugin inspect -f {{.Config.Env}} tiborvass/no-remove
45
+$ docker plugin inspect -f {{.Settings.Env}} tiborvass/no-remove
41 46
 [DEBUG=1]
42 47
 ```
43 48
 
49
+The following example change the source of the `mymount` mount on
50
+the `myplugin` plugin.
51
+
52
+```bash
53
+$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
54
+/foo
55
+
56
+$ docker plugins set myplugin mymount.source=/bar
57
+
58
+$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin
59
+/bar
60
+```
61
+
62
+Note: since only `source` is settable in `mymount`, `docker plugins set mymount=/bar myplugin` would work too.
63
+
64
+The following example change the path of the `mydevice` device on
65
+the `myplugin` plugin.
66
+
67
+```bash
68
+$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
69
+/dev/foo
70
+
71
+$ docker plugins set myplugin mydevice.path=/dev/bar
72
+
73
+$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin
74
+/dev/bar
75
+```
76
+
77
+Note: since only `path` is settable in `mydevice`, `docker plugins set mydevice=/dev/bar myplugin` would work too.
78
+
79
+The following example change the source of the args on the `myplugin` plugin.
80
+
81
+```bash
82
+$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
83
+["foo", "bar"]
84
+
85
+$ docker plugins set myplugin args="foo bar baz"
86
+
87
+$ docker plugin inspect -f '{{.Settings.Args}}' myplugin
88
+["foo", "bar", "baz"]
89
+```
90
+
44 91
 ## Related information
45 92
 
46 93
 * [plugin create](plugin_create.md)