Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ShortPoll = 3 * time.Second ShortPollBackoff = 2.0 ShortPollCap = 1 * time.Minute LongPoll = 15 * time.Minute )
ShortPoll and LongPoll hold the polling intervals for the instance updater. When a machine has no address or is not started, it will be polled at ShortPoll intervals until it does, exponentially backing off with an exponent of ShortPollBackoff until a maximum of ShortPollCap is reached.
When a machine has an address and is started LongPoll will be used to check that the instance address or status has not changed.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a Manifold that encapsulates the instancepoller worker.
Types ¶
type Config ¶
type Config struct { Clock clock.Clock Facade FacadeAPI Environ Environ Logger Logger CredentialAPI common.CredentialAPI }
Config encapsulates the configuration options for instantiating a new instance poller worker.
type Environ ¶
type Environ interface { Instances(ctx context.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error) NetworkInterfaces(ctx context.ProviderCallContext, ids []instance.Id) ([]network.InterfaceInfos, error) }
Environ specifies the provider-specific methods needed by the instance poller.
type FacadeAPI ¶
type FacadeAPI interface { WatchModelMachines() (watcher.StringsWatcher, error) Machine(tag names.MachineTag) (Machine, error) }
FacadeAPI specifies the api-server methods needed by the instance poller.
type Logger ¶
type Logger interface { Tracef(string, ...interface{}) Debugf(string, ...interface{}) Infof(string, ...interface{}) Warningf(string, ...interface{}) Errorf(string, ...interface{}) }
Logger represents the methods used by the worker to log details.
type Machine ¶
type Machine interface { Id() string InstanceId() (instance.Id, error) SetProviderNetworkConfig(network.InterfaceInfos) (network.ProviderAddresses, bool, error) InstanceStatus() (params.StatusResult, error) SetInstanceStatus(status.Status, string, map[string]interface{}) error String() string Refresh() error Status() (params.StatusResult, error) Life() life.Value IsManual() (bool, error) }
Machine specifies an interface for machine instances processed by the instance poller.