backend.go 1.2 KB

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