Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteCluster(ctx context.Context, c *client.Client, opts *RequestOptions) error
- func EnsureSwarmExists(ctx context.Context, c *client.Client, opts *RequestOptions) error
- func InfoAMPCore(ctx context.Context, c *client.Client) (int, error)
- func InfoCluster(ctx context.Context, c *client.Client) (swarm.Swarm, error)
- func InfoNode(ctx context.Context, c *client.Client) (swarm.Node, error)
- func InfoToJSON(status string, csCount int, usCount int) (string, error)
- func InfoUser(ctx context.Context, c *client.Client) (int, error)
- func LabelNode(ctx context.Context, c *client.Client, opts *RequestOptions) error
- func RunAgent(ctx context.Context, c *client.Client, action string, opts *RequestOptions) error
- func SwarmNodeStatus(client *client.Client) (swarm.LocalNodeState, error)
- type FullSwarmInfo
- type RequestOptions
- type ShortSwarmInfo
Constants ¶
View Source
const ( InitTimeout = 10 ContainerName = "ampagent" ImageName = "appcelerator/ampagent" DockerSocket = "/var/run/docker.sock" DockerSwarmSocket = "/var/run/docker" CoreStackName = "amp" )
Variables ¶
View Source
var (
ContainerLabels = map[string]string{"io.amp.role": "infrastructure"}
)
Functions ¶
func DeleteCluster ¶
DeleteSwarm starts the delete operation
func EnsureSwarmExists ¶
EnsureSwarmExists checks that the Swarm is initialized, and does it if it's not the case
func InfoAMPCore ¶ added in v0.15.0
InfoAMPCore returns the number of AMP core services
func InfoCluster ¶
InfoCluster returns the Swarm info
func RunAgent ¶
RunAgent runs the ampagent image to init (action ="install") or destroy (action="uninstall")
func SwarmNodeStatus ¶ added in v0.15.0
func SwarmNodeStatus(client *client.Client) (swarm.LocalNodeState, error)
SwarmNodeStatus returns the swarm status for this node
Types ¶
type RequestOptions ¶
type RequestOptions struct { InitRequest swarm.InitRequest // Node labels Labels map[string]string // Tag of the ampagent image Tag string Registration string Notifications bool ForceLeave bool SkipTests bool NoMonitoring bool }
RequestOptions stores parameters for the Docker API
type ShortSwarmInfo ¶
Click to show internal directories.
Click to hide internal directories.