Add support for swarm init lock and swarm unlock
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: dd81022c23
Component: cli
This commit is contained in:
committed by
Aaron Lehmann
parent
8788cdab0b
commit
798fd349f4
@ -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
|
||||
|
||||
17
components/cli/swarm_unlock.go
Normal file
17
components/cli/swarm_unlock.go
Normal file
@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user