Documentation ¶
Index ¶
- Variables
- type Cluster
- func (c *Cluster) Cleanup()
- func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
- func (c *Cluster) CreateService(s types.ServiceSpec) (string, error)
- func (c *Cluster) GetListenAddress() string
- func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error)
- func (c *Cluster) GetNetworks() ([]apitypes.NetworkResource, error)
- func (c *Cluster) GetNode(input string) (types.Node, error)
- func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, error)
- func (c *Cluster) GetRemoteAddress() string
- func (c *Cluster) GetService(input string) (types.Service, error)
- func (c *Cluster) GetServices(options apitypes.ServiceListOptions) ([]types.Service, error)
- func (c *Cluster) GetTask(input string) (types.Task, error)
- func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, error)
- func (c *Cluster) Info() types.Info
- func (c *Cluster) Init(req types.InitRequest) (string, error)
- func (c *Cluster) Inspect() (types.Swarm, error)
- func (c *Cluster) IsAgent() bool
- func (c *Cluster) IsManager() bool
- func (c *Cluster) Join(req types.JoinRequest) error
- func (c *Cluster) Leave(force bool) error
- func (c *Cluster) ListenClusterEvents() <-chan struct{}
- func (c *Cluster) RemoveNetwork(input string) error
- func (c *Cluster) RemoveNode(input string) error
- func (c *Cluster) RemoveService(input string) error
- func (c *Cluster) Update(version uint64, spec types.Spec) error
- func (c *Cluster) UpdateNode(nodeID string, version uint64, spec types.NodeSpec) error
- func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.ServiceSpec) error
- type Config
Constants ¶
This section is empty.
Variables ¶
var ErrNoManager = fmt.Errorf("This node is not participating as a Swarm manager")
ErrNoManager is returned then a manager-only function is called on non-manager
var ErrNoSwarm = fmt.Errorf("This node is not part of Swarm")
ErrNoSwarm is returned on leaving a cluster that was never initialized
var ErrPendingSwarmExists = fmt.Errorf("This node is processing an existing join request that has not succeeded yet. Use \"docker swarm leave\" to cancel the current request.")
ErrPendingSwarmExists is returned on initialize or join request for a cluster that is already processing a similar request but has not succeeded yet.
var ErrSwarmExists = fmt.Errorf("This node is already part of a Swarm cluster. Use \"docker swarm leave\" to leave this cluster and join another one.")
ErrSwarmExists is returned on initialize or join request for a cluster that has already been activated
var ErrSwarmJoinTimeoutReached = fmt.Errorf("Timeout was reached before node was joined. Attempt to join the cluster will continue in the background. Use \"docker info\" command to see the current Swarm status of your node.")
ErrSwarmJoinTimeoutReached is returned when cluster join could not complete before timeout was reached.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
Cluster provides capabilities to pariticipate in a cluster as worker or a manager and a worker.
func (*Cluster) Cleanup ¶
func (c *Cluster) Cleanup()
Cleanup stops active swarm node. This is run before daemon shutdown.
func (*Cluster) CreateNetwork ¶
func (c *Cluster) CreateNetwork(s apitypes.NetworkCreateRequest) (string, error)
CreateNetwork creates a new cluster managed network.
func (*Cluster) CreateService ¶
func (c *Cluster) CreateService(s types.ServiceSpec) (string, error)
CreateService creates a new service in a managed swarm cluster.
func (*Cluster) GetListenAddress ¶ added in v1.12.2
GetListenAddress returns the listening address for current maanger's consensus and dispatcher APIs.
func (*Cluster) GetNetwork ¶
func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error)
GetNetwork returns a cluster network by ID.
func (*Cluster) GetNetworks ¶
func (c *Cluster) GetNetworks() ([]apitypes.NetworkResource, error)
GetNetworks returns all current cluster managed networks.
func (*Cluster) GetRemoteAddress ¶
GetRemoteAddress returns a known advertise address of a remote maanger if available. todo: change to array/connect with info
func (*Cluster) GetService ¶
GetService returns a service based on a ID or name.
func (*Cluster) GetServices ¶
GetServices returns all services of a managed swarm cluster.
func (*Cluster) Init ¶
func (c *Cluster) Init(req types.InitRequest) (string, error)
Init initializes new cluster from user provided request.
func (*Cluster) Join ¶
func (c *Cluster) Join(req types.JoinRequest) error
Join makes current Cluster part of an existing swarm cluster.
func (*Cluster) ListenClusterEvents ¶
func (c *Cluster) ListenClusterEvents() <-chan struct{}
ListenClusterEvents returns a channel that receives messages on cluster participation changes. todo: make cancelable and accessible to multiple callers
func (*Cluster) RemoveNetwork ¶
RemoveNetwork removes a cluster network.
func (*Cluster) RemoveNode ¶
RemoveNode removes a node from a cluster
func (*Cluster) RemoveService ¶
RemoveService removes a service from a managed swarm cluster.
func (*Cluster) UpdateNode ¶
UpdateNode updates existing nodes properties.
func (*Cluster) UpdateService ¶
UpdateService updates existing service to match new properties.