mirror of https://github.com/docker/cli.git
Add support for swarm init lock and swarm unlock
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
ab6c38e014
commit
dd81022c23
|
@ -119,6 +119,7 @@ type ServiceAPIClient interface {
|
|||
type SwarmAPIClient interface {
|
||||
SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error)
|
||||
SwarmJoin(ctx context.Context, req swarm.JoinRequest) error
|
||||
SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error
|
||||
SwarmLeave(ctx context.Context, force bool) error
|
||||
SwarmInspect(ctx context.Context) (swarm.Swarm, error)
|
||||
SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// SwarmUnlock unlockes locked swarm.
|
||||
func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
|
||||
serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ensureReaderClosed(serverResp)
|
||||
return err
|
||||
}
|
Loading…
Reference in New Issue