2016-09-06 14:46:37 -04:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2016-11-21 12:24:01 -05:00
|
|
|
"net/url"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/docker/docker/api/types"
|
2016-09-06 14:46:37 -04:00
|
|
|
"golang.org/x/net/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// PluginEnable enables a plugin
|
2016-11-21 12:24:01 -05:00
|
|
|
func (cli *Client) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error {
|
|
|
|
query := url.Values{}
|
|
|
|
query.Set("timeout", strconv.Itoa(options.Timeout))
|
|
|
|
|
|
|
|
resp, err := cli.post(ctx, "/plugins/"+name+"/enable", query, nil, nil)
|
2016-09-06 14:46:37 -04:00
|
|
|
ensureReaderClosed(resp)
|
|
|
|
return err
|
|
|
|
}
|