github.com/cookieai-jar/moby@v17.12.1-ce-rc2+incompatible/api/server/router/swarm/backend.go (about)

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