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