backend.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package swarm // import "github.com/docker/docker/api/server/router/swarm"
  2. import (
  3. "context"
  4. "github.com/docker/docker/api/types"
  5. "github.com/docker/docker/api/types/backend"
  6. "github.com/docker/docker/api/types/container"
  7. "github.com/docker/docker/api/types/swarm"
  8. )
  9. // Backend abstracts a swarm manager.
  10. type Backend interface {
  11. Init(req swarm.InitRequest) (string, error)
  12. Join(req swarm.JoinRequest) error
  13. Leave(ctx context.Context, force bool) error
  14. Inspect() (swarm.Swarm, error)
  15. Update(uint64, swarm.Spec, swarm.UpdateFlags) error
  16. GetUnlockKey() (string, error)
  17. UnlockSwarm(req swarm.UnlockRequest) error
  18. GetServices(types.ServiceListOptions) ([]swarm.Service, error)
  19. GetService(idOrName string, insertDefaults bool) (swarm.Service, error)
  20. CreateService(swarm.ServiceSpec, string, bool) (*swarm.ServiceCreateResponse, error)
  21. UpdateService(string, uint64, swarm.ServiceSpec, types.ServiceUpdateOptions, bool) (*swarm.ServiceUpdateResponse, error)
  22. RemoveService(string) error
  23. ServiceLogs(context.Context, *backend.LogSelector, *container.LogsOptions) (<-chan *backend.LogMessage, error)
  24. GetNodes(types.NodeListOptions) ([]swarm.Node, error)
  25. GetNode(string) (swarm.Node, error)
  26. UpdateNode(string, uint64, swarm.NodeSpec) error
  27. RemoveNode(string, bool) error
  28. GetTasks(types.TaskListOptions) ([]swarm.Task, error)
  29. GetTask(string) (swarm.Task, error)
  30. GetSecrets(opts types.SecretListOptions) ([]swarm.Secret, error)
  31. CreateSecret(s swarm.SecretSpec) (string, error)
  32. RemoveSecret(idOrName string) error
  33. GetSecret(id string) (swarm.Secret, error)
  34. UpdateSecret(idOrName string, version uint64, spec swarm.SecretSpec) error
  35. GetConfigs(opts types.ConfigListOptions) ([]swarm.Config, error)
  36. CreateConfig(s swarm.ConfigSpec) (string, error)
  37. RemoveConfig(id string) error
  38. GetConfig(id string) (swarm.Config, error)
  39. UpdateConfig(idOrName string, version uint64, spec swarm.ConfigSpec) error
  40. }