From 1bc2b60fd4fe24d85ab6b5922545f716580c371d Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 10 Nov 2016 10:15:16 -0800 Subject: [PATCH] update swagger and docs Signed-off-by: Victor Vieux Upstream-commit: aef1dec9a6dbf1dcf4b43417c3c5fafda2ede957 Component: engine --- components/engine/api/swagger.yaml | 4 +- .../docs/reference/commandline/plugin_set.md | 55 +++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/components/engine/api/swagger.yaml b/components/engine/api/swagger.yaml index da20bb6d34..45c53189c4 100644 --- a/components/engine/api/swagger.yaml +++ b/components/engine/api/swagger.yaml @@ -6471,7 +6471,9 @@ paths: /plugins/{name}/set: post: summary: "Configure a plugin" - operationId: "PluginsSet" + operationId: "PostPluginsSet" + consumes: + - "application/json" parameters: - name: "name" in: "path" diff --git a/components/engine/docs/reference/commandline/plugin_set.md b/components/engine/docs/reference/commandline/plugin_set.md index 6dbd6ec389..36a24f2061 100644 --- a/components/engine/docs/reference/commandline/plugin_set.md +++ b/components/engine/docs/reference/commandline/plugin_set.md @@ -27,20 +27,67 @@ Options: Change settings for a plugin. The plugin must be disabled. +The settings currently supported are: + * env variables + * source of mounts + * path of devices + * args -The following example installs change the env variable `DEBUG` of the +The following example change the env variable `DEBUG` on the `no-remove` plugin. ```bash -$ docker plugin inspect -f {{.Config.Env}} tiborvass/no-remove +$ docker plugin inspect -f {{.Settings.Env}} tiborvass/no-remove [DEBUG=0] -$ docker plugin set DEBUG=1 tiborvass/no-remove +$ docker plugin set tiborvass/no-remove DEBUG=1 -$ docker plugin inspect -f {{.Config.Env}} tiborvass/no-remove +$ docker plugin inspect -f {{.Settings.Env}} tiborvass/no-remove [DEBUG=1] ``` +The following example change the source of the `mymount` mount on +the `myplugin` plugin. + +```bash +$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin +/foo + +$ docker plugins set myplugin mymount.source=/bar + +$ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin +/bar +``` + +Note: since only `source` is settable in `mymount`, `docker plugins set mymount=/bar myplugin` would work too. + +The following example change the path of the `mydevice` device on +the `myplugin` plugin. + +```bash +$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin +/dev/foo + +$ docker plugins set myplugin mydevice.path=/dev/bar + +$ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin +/dev/bar +``` + +Note: since only `path` is settable in `mydevice`, `docker plugins set mydevice=/dev/bar myplugin` would work too. + +The following example change the source of the args on the `myplugin` plugin. + +```bash +$ docker plugin inspect -f '{{.Settings.Args}}' myplugin +["foo", "bar"] + +$ docker plugins set myplugin args="foo bar baz" + +$ docker plugin inspect -f '{{.Settings.Args}}' myplugin +["foo", "bar", "baz"] +``` + ## Related information * [plugin create](plugin_create.md)