Documentation
¶
Index ¶
- Variables
- type Client
- type Machine
- func (m *Machine) CharmProfilingInfo(ctx context.Context) (*UnitProfileInfo, error)
- func (m *Machine) ContainerType(ctx context.Context) (instance.ContainerType, error)
- func (m *Machine) InstanceId(ctx context.Context) (string, error)
- func (m *Machine) Life() life.Value
- func (m *Machine) Refresh(ctx context.Context) error
- func (m *Machine) SetCharmProfiles(ctx context.Context, profiles []string) error
- func (m *Machine) SetModificationStatus(ctx context.Context, status status.Status, info string, ...) error
- func (m *Machine) Tag() names.MachineTag
- func (m *Machine) WatchContainers(ctx context.Context) (watcher.StringsWatcher, error)
- func (m *Machine) WatchLXDProfileVerificationNeeded(ctx context.Context) (watcher.NotifyWatcher, error)
- func (m *Machine) WatchUnits(ctx context.Context) (watcher.StringsWatcher, error)
- type MutaterMachine
- type Option
- type UnitProfileChanges
- type UnitProfileInfo
Constants ¶
This section is empty.
Variables ¶
var WithTracer = base.WithTracer
WithTracer returns an Option that configures the Client to use the supplied tracer.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientFromFacade ¶
func NewClientFromFacade(facadeCaller base.FacadeCaller) *Client
NewClientFromFacade creates a new instance mutater facade using the input facade caller.
func (*Client) Machine ¶
func (c *Client) Machine(ctx context.Context, tag names.MachineTag) (MutaterMachine, error)
Machine provides access to methods of a state.Machine through the facade.
func (*Client) WatchModelMachines ¶
WatchModelMachines returns a StringsWatcher reporting changes to machines and not containers.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine represents a juju machine as seen by an instancemutater worker.
func (*Machine) CharmProfilingInfo ¶
func (m *Machine) CharmProfilingInfo(ctx context.Context) (*UnitProfileInfo, error)
CharmProfilingInfo implements MutaterMachine.CharmProfilingInfo.
func (*Machine) ContainerType ¶
ContainerType implements MutaterMachine.ContainerType.
func (*Machine) InstanceId ¶
InstanceId implements MutaterMachine.InstanceId.
func (*Machine) SetCharmProfiles ¶
SetCharmProfiles implements MutaterMachine.SetCharmProfiles.
func (*Machine) SetModificationStatus ¶
func (m *Machine) SetModificationStatus(ctx context.Context, status status.Status, info string, data map[string]interface{}) error
SetModificationStatus implements MutaterMachine.SetModificationStatus.
func (*Machine) WatchContainers ¶
WatchContainers returns a StringsWatcher reporting changes to containers.
func (*Machine) WatchLXDProfileVerificationNeeded ¶
func (m *Machine) WatchLXDProfileVerificationNeeded(ctx context.Context) (watcher.NotifyWatcher, error)
WatchLXDProfileVerificationNeeded implements MutaterMachine.WatchLXDProfileVerificationNeeded.
func (*Machine) WatchUnits ¶
WatchUnits implements MutaterMachine.WatchUnits.
type MutaterMachine ¶
type MutaterMachine interface {
// InstanceId returns the provider specific instance id for this machine
InstanceId(context.Context) (string, error)
// CharmProfilingInfo returns info to update lxd profiles on the machine
CharmProfilingInfo(context.Context) (*UnitProfileInfo, error)
// ContainerType returns the container type for this machine.
ContainerType(context.Context) (instance.ContainerType, error)
// SetCharmProfiles records the given slice of charm profile names.
SetCharmProfiles(context.Context, []string) error
// Tag returns the current machine tag
Tag() names.MachineTag
// Life returns the machine's lifecycle value.
Life() life.Value
// Refresh updates the cached local copy of the machine's data.
Refresh(context.Context) error
// WatchUnits returns a watcher.StringsWatcher for watching units of a given
// machine.
WatchUnits(context.Context) (watcher.StringsWatcher, error)
// WatchLXDProfileVerificationNeeded returns a NotifyWatcher, notifies when the
// following changes happen:
// - application charm URL changes and there is a lxd profile
// - unit is add or removed and there is a lxd profile
WatchLXDProfileVerificationNeeded(context.Context) (watcher.NotifyWatcher, error)
// WatchContainers returns a watcher.StringsWatcher for watching
// containers of a given machine.
WatchContainers(ctx context.Context) (watcher.StringsWatcher, error)
// SetModificationStatus sets the provider specific modification status
// for a machine. Allowing the propagation of status messages to the
// operator.
SetModificationStatus(ctx context.Context, status status.Status, info string, data map[string]interface{}) error
}
MutatorMachine represents the machine methods required for the instancemutater.
type UnitProfileChanges ¶
type UnitProfileChanges struct {
ApplicationName string
Revision int
Profile lxdprofile.Profile
}
UnitProfileChanges provides the application name, revision and profile of the current charm referenced by this application.
type UnitProfileInfo ¶
type UnitProfileInfo struct {
ModelName string
InstanceId instance.Id
ProfileChanges []UnitProfileChanges
CurrentProfiles []string
}
UnitProfileInfo is data required by the instancemutater to determine what any changes are required to a machine's lxd profiles.