backend.go 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. package swarm
  2. import (
  3. basictypes "github.com/docker/docker/api/types"
  4. types "github.com/docker/docker/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. UnlockSwarm(req types.UnlockRequest) error
  14. GetServices(basictypes.ServiceListOptions) ([]types.Service, error)
  15. GetService(string) (types.Service, error)
  16. CreateService(types.ServiceSpec, string) (string, error)
  17. UpdateService(string, uint64, types.ServiceSpec, string, string) error
  18. RemoveService(string) error
  19. GetNodes(basictypes.NodeListOptions) ([]types.Node, error)
  20. GetNode(string) (types.Node, error)
  21. UpdateNode(string, uint64, types.NodeSpec) error
  22. RemoveNode(string, bool) error
  23. GetTasks(basictypes.TaskListOptions) ([]types.Task, error)
  24. GetTask(string) (types.Task, error)
  25. GetSecrets(opts basictypes.SecretListOptions) ([]types.Secret, error)
  26. CreateSecret(s types.SecretSpec) (string, error)
  27. RemoveSecret(id string) error
  28. GetSecret(id string) (types.Secret, error)
  29. UpdateSecret(id string, version uint64, spec types.SecretSpec) error
  30. }