backend.go 1.8 KB

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