deployer

package
v0.0.0-...-a002913 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeployer

func NewDeployer(st *apideployer.State, ctx Context) worker.Worker

NewDeployer returns a Worker that deploys and recalls unit agents via ctx, taking a machine id to operate on.

Types

type APICalls

type APICalls interface {
	ConnectionInfo() (params.DeployerConnectionValues, error)
}

APICalls defines the interface to the API that the simple context needs.

type Context

type Context interface {
	// DeployUnit causes the agent for the specified unit to be started and run
	// continuously until further notice without further intervention. It will
	// return an error if the agent is already deployed.
	DeployUnit(unitName, initialPassword string) error

	// RecallUnit causes the agent for the specified unit to be stopped, and
	// the agent's data to be destroyed. It will return an error if the agent
	// was not deployed by the manager.
	RecallUnit(unitName string) error

	// DeployedUnits returns the names of all units deployed by the manager.
	DeployedUnits() ([]string, error)

	// AgentConfig returns the agent config for the machine agent that is
	// running the deployer.
	AgentConfig() agent.Config
}

Context abstracts away the differences between different unit deployment strategies; where a Deployer is responsible for what to deploy, a Context is responsible for how to deploy.

type Deployer

type Deployer struct {
	// contains filtered or unexported fields
}

Deployer is responsible for deploying and recalling unit agents, according to changes in a set of state units; and for the final removal of its agents' units from state when they are no longer needed.

func (*Deployer) Handle

func (d *Deployer) Handle(unitNames []string) error

func (*Deployer) SetUp

func (d *Deployer) SetUp() (watcher.StringsWatcher, error)

func (*Deployer) TearDown

func (d *Deployer) TearDown() error

type SimpleContext

type SimpleContext struct {
	// contains filtered or unexported fields
}

SimpleContext is a Context that manages unit deployments on the local system.

func NewSimpleContext

func NewSimpleContext(agentConfig agent.Config, api APICalls) *SimpleContext

NewSimpleContext returns a new SimpleContext, acting on behalf of the specified deployer, that deploys unit agents. Paths to which agents and tools are installed are relative to dataDir.

func (*SimpleContext) AgentConfig

func (ctx *SimpleContext) AgentConfig() agent.Config

func (*SimpleContext) DeployUnit

func (ctx *SimpleContext) DeployUnit(unitName, initialPassword string) (err error)

func (*SimpleContext) DeployedUnits

func (ctx *SimpleContext) DeployedUnits() ([]string, error)

func (*SimpleContext) RecallUnit

func (ctx *SimpleContext) RecallUnit(unitName string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL