backend.go 930 B

1234567891011121314151617181920212223242526
  1. package swarm
  2. import (
  3. basictypes "github.com/docker/engine-api/types"
  4. types "github.com/docker/engine-api/types/swarm"
  5. )
  6. // Backend abstracts an swarm commands manager.
  7. type Backend interface {
  8. Init(req types.InitRequest) (string, error)
  9. Join(req types.JoinRequest) error
  10. Leave(force bool) error
  11. Inspect() (types.Swarm, error)
  12. Update(uint64, types.Spec, types.UpdateFlags) error
  13. GetServices(basictypes.ServiceListOptions) ([]types.Service, error)
  14. GetService(string) (types.Service, error)
  15. CreateService(types.ServiceSpec, string) (string, error)
  16. UpdateService(string, uint64, types.ServiceSpec, string) error
  17. RemoveService(string) error
  18. GetNodes(basictypes.NodeListOptions) ([]types.Node, error)
  19. GetNode(string) (types.Node, error)
  20. UpdateNode(string, uint64, types.NodeSpec) error
  21. RemoveNode(string, bool) error
  22. GetTasks(basictypes.TaskListOptions) ([]types.Task, error)
  23. GetTask(string) (types.Task, error)
  24. }