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.Logger CredentialAPI common.CredentialAPI }
Config encapsulates the configuration options for instantiating a new instance poller worker.
type Environ ¶
type Environ interface { Instances(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error) NetworkInterfaces(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]network.InterfaceInfos, error) }
Environ specifies the provider-specific methods needed by the instance poller.
type FacadeAPI ¶
type FacadeAPI interface { WatchModelMachines(ctx context.Context) (watcher.StringsWatcher, error) Machine(ctx context.Context, tag names.MachineTag) (Machine, error) }
FacadeAPI specifies the api-server methods needed by the instance poller.
type Machine ¶
type Machine interface { Id() string InstanceId(ctx context.Context) (instance.Id, error) SetProviderNetworkConfig(context.Context, network.InterfaceInfos) (network.ProviderAddresses, bool, error) InstanceStatus(ctx context.Context) (params.StatusResult, error) SetInstanceStatus(context.Context, status.Status, string, map[string]interface{}) error String() string Refresh(ctx context.Context) error Status(ctx context.Context) (params.StatusResult, error) Life() life.Value IsManual(ctx context.Context) (bool, error) }
Machine specifies an interface for machine instances processed by the instance poller.