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, encodedAuth string) (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, encodedAuth string) error
- type Config
Constants ¶
This section is empty.
Variables ¶
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 participate in a cluster as a worker or a manager.
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 ¶
CreateService creates a new service in a managed swarm cluster.
func (*Cluster) GetListenAddress ¶
GetListenAddress returns the listening address for current manager's consensus and dispatcher APIs.
func (*Cluster) GetNetwork ¶
func (c *Cluster) GetNetwork(input string) (apitypes.NetworkResource, error)
GetNetwork returns a cluster network by an 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 manager if available. todo: change to array/connect with info
func (*Cluster) GetService ¶
GetService returns a service based on an 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) Inspect ¶
Inspect retrieves the configuration properties of a managed swarm cluster.
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 ¶
func (c *Cluster) UpdateService(serviceID string, version uint64, spec types.ServiceSpec, encodedAuth string) error
UpdateService updates existing service to match new properties.