Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPrerequisites(opts *RequestOptions) error
- func DeleteCluster(ctx context.Context, c *docker.Client, opts *RequestOptions) error
- func EnsureSwarmExists(ctx context.Context, c *docker.Client, opts *RequestOptions) error
- func InfoAMPCore(ctx context.Context, c *docker.Client) (int, error)
- func InfoCluster(ctx context.Context, c *docker.Client) (swarm.Swarm, error)
- func InfoNode(ctx context.Context, c *docker.Client) (swarm.Node, error)
- func InfoToJSON(status string, csCount int, usCount int) (string, error)
- func InfoUser(ctx context.Context, c *docker.Client) (int, error)
- func LabelNode(ctx context.Context, c *docker.Client, opts *RequestOptions) error
- func RunAgent(ctx context.Context, c *docker.Client, action string, opts *RequestOptions) error
- func SwarmNodeStatus(c *docker.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" MaxMapCountRequirement = 262144 // as specified here: https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html )
Variables ¶
View Source
var (
ContainerLabels = map[string]string{"io.amp.role": "infrastructure"}
)
Functions ¶
func CheckPrerequisites ¶ added in v0.18.0
func CheckPrerequisites(opts *RequestOptions) error
Check prerequisites
func DeleteCluster ¶
func DeleteCluster(ctx context.Context, c *docker.Client, opts *RequestOptions) error
DeleteSwarm starts the delete operation
func EnsureSwarmExists ¶
func EnsureSwarmExists(ctx context.Context, c *docker.Client, opts *RequestOptions) error
EnsureSwarmExists checks that the Swarm is initialized, and does it if it's not the case
func InfoAMPCore ¶
InfoAMPCore returns the number of AMP core services
func InfoCluster ¶
InfoCluster returns the Swarm info
func RunAgent ¶
func RunAgent(ctx context.Context, c *docker.Client, action string, opts *RequestOptions) error
RunAgent runs the ampagent image to init (action ="install") or destroy (action="uninstall")
func SwarmNodeStatus ¶
func SwarmNodeStatus(c *docker.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 NoLogs bool NoMetrics bool NoProxy bool NoRollback bool }
RequestOptions stores parameters for the Docker API
type ShortSwarmInfo ¶
Click to show internal directories.
Click to hide internal directories.