2016-06-13 19:52:49 -07:00
|
|
|
package swarm
|
|
|
|
|
|
|
|
import (
|
2016-09-06 11:46:37 -07:00
|
|
|
basictypes "github.com/docker/docker/api/types"
|
|
|
|
types "github.com/docker/docker/api/types/swarm"
|
2016-06-13 19:52:49 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// Backend abstracts an swarm commands manager.
|
|
|
|
type Backend interface {
|
|
|
|
Init(req types.InitRequest) (string, error)
|
|
|
|
Join(req types.JoinRequest) error
|
|
|
|
Leave(force bool) error
|
|
|
|
Inspect() (types.Swarm, error)
|
2016-07-20 11:15:08 -07:00
|
|
|
Update(uint64, types.Spec, types.UpdateFlags) error
|
2016-06-13 19:52:49 -07:00
|
|
|
GetServices(basictypes.ServiceListOptions) ([]types.Service, error)
|
|
|
|
GetService(string) (types.Service, error)
|
2016-06-15 11:50:49 -07:00
|
|
|
CreateService(types.ServiceSpec, string) (string, error)
|
|
|
|
UpdateService(string, uint64, types.ServiceSpec, string) error
|
2016-06-13 19:52:49 -07:00
|
|
|
RemoveService(string) error
|
|
|
|
GetNodes(basictypes.NodeListOptions) ([]types.Node, error)
|
|
|
|
GetNode(string) (types.Node, error)
|
|
|
|
UpdateNode(string, uint64, types.NodeSpec) error
|
2016-07-27 21:17:00 -07:00
|
|
|
RemoveNode(string, bool) error
|
2016-06-13 19:52:49 -07:00
|
|
|
GetTasks(basictypes.TaskListOptions) ([]types.Task, error)
|
|
|
|
GetTask(string) (types.Task, error)
|
|
|
|
}
|