Documentation ¶
Index ¶
- type Machine
- func (m *Machine) DistributionGroup() ([]instance.Id, error)
- func (m *Machine) EnsureDead() error
- func (m *Machine) Id() string
- func (m *Machine) InstanceId() (instance.Id, error)
- func (m *Machine) InstanceStatus() (status.Status, string, error)
- func (m *Machine) Life() params.Life
- func (m *Machine) MarkForRemoval() error
- func (m *Machine) ProvisioningInfo() (*params.ProvisioningInfo, error)
- func (m *Machine) Refresh() error
- func (m *Machine) Remove() error
- func (m *Machine) Series() (string, error)
- func (m *Machine) SetInstanceInfo(id instance.Id, nonce string, ...) error
- func (m *Machine) SetInstanceStatus(status status.Status, message string, data map[string]interface{}) error
- func (m *Machine) SetPassword(password string) error
- func (m *Machine) SetStatus(status status.Status, info string, data map[string]interface{}) error
- func (m *Machine) SetSupportedContainers(containerTypes ...instance.ContainerType) error
- func (m *Machine) Status() (status.Status, string, error)
- func (m *Machine) String() string
- func (m *Machine) SupportsNoContainers() error
- func (m *Machine) Tag() names.Tag
- func (m *Machine) WatchAllContainers() (watcher.StringsWatcher, error)
- func (m *Machine) WatchContainers(ctype instance.ContainerType) (watcher.StringsWatcher, error)
- type State
- func (st *State) ContainerConfig() (result params.ContainerConfig, err error)
- func (st *State) ContainerManagerConfig(args params.ContainerManagerConfigParams) (result params.ContainerManagerConfig, err error)
- func (st *State) FindTools(v version.Number, series string, arch string) (tools.List, error)
- func (st *State) GetContainerInterfaceInfo(containerTag names.MachineTag) ([]network.InterfaceInfo, error)
- func (st *State) Machine(tag names.MachineTag) (*Machine, error)
- func (st *State) MachinesWithTransientErrors() ([]*Machine, []params.StatusResult, error)
- func (st *State) PrepareContainerInterfaceInfo(containerTag names.MachineTag) ([]network.InterfaceInfo, error)
- func (st *State) ReleaseContainerAddresses(containerTag names.MachineTag) (err error)
- func (st *State) StateAddresses() ([]string, error)
- func (st *State) WatchMachineErrorRetry() (watcher.NotifyWatcher, error)
- func (st *State) WatchModelMachines() (watcher.StringsWatcher, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine represents a juju machine as seen by the provisioner worker.
func (*Machine) DistributionGroup ¶
DistributionGroup returns a slice of instance.Ids that belong to the same distribution group as this Machine. The provisioner may use this information to distribute instances for high availability.
func (*Machine) EnsureDead ¶
EnsureDead sets the machine lifecycle to Dead if it is Alive or Dying. It does nothing otherwise.
func (*Machine) InstanceId ¶
InstanceId returns the provider specific instance id for the machine or an CodeNotProvisioned error, if not set.
func (*Machine) InstanceStatus ¶
InstanceStatus returns the status of the provider instance.
func (*Machine) MarkForRemoval ¶
MarkForRemoval indicates that the machine is ready to have any provider-level resources cleaned up and be removed.
func (*Machine) ProvisioningInfo ¶
func (m *Machine) ProvisioningInfo() (*params.ProvisioningInfo, error)
ProvisioningInfo returns the information required to provision a machine.
func (*Machine) Remove ¶
Remove removes the machine from state. It will fail if the machine is not Dead.
func (*Machine) Series ¶
Series returns the operating system series running on the machine.
NOTE: Unlike state.Machine.Series(), this method returns an error as well, because it needs to do an API call.
func (*Machine) SetInstanceInfo ¶
func (m *Machine) SetInstanceInfo( id instance.Id, nonce string, characteristics *instance.HardwareCharacteristics, networkConfig []params.NetworkConfig, volumes []params.Volume, volumeAttachments map[string]params.VolumeAttachmentInfo, ) error
SetInstanceInfo sets the provider specific instance id, nonce, metadata, network config for this machine. Once set, the instance id cannot be changed.
func (*Machine) SetInstanceStatus ¶
func (m *Machine) SetInstanceStatus(status status.Status, message string, data map[string]interface{}) error
SetInstanceStatus sets the status for the provider instance.
func (*Machine) SetPassword ¶
SetPassword sets the machine's password.
func (*Machine) SetSupportedContainers ¶
func (m *Machine) SetSupportedContainers(containerTypes ...instance.ContainerType) error
SetSupportedContainers updates the list of containers supported by this machine.
func (*Machine) SupportsNoContainers ¶
SupportsNoContainers records the fact that this machine doesn't support any containers.
func (*Machine) WatchAllContainers ¶
func (m *Machine) WatchAllContainers() (watcher.StringsWatcher, error)
WatchAllContainers returns a StringsWatcher that notifies of changes to the lifecycles of all containers on the machine.
func (*Machine) WatchContainers ¶
func (m *Machine) WatchContainers(ctype instance.ContainerType) (watcher.StringsWatcher, error)
WatchContainers returns a StringsWatcher that notifies of changes to the lifecycles of containers of the specified type on the machine.
type State ¶
type State struct { *common.ModelWatcher *common.APIAddresser *common.ControllerConfigAPI // contains filtered or unexported fields }
State provides access to the Machiner API facade.
func (*State) ContainerConfig ¶
func (st *State) ContainerConfig() (result params.ContainerConfig, err error)
ContainerConfig returns information from the model config that is needed for container cloud-init.
func (*State) ContainerManagerConfig ¶
func (st *State) ContainerManagerConfig(args params.ContainerManagerConfigParams) (result params.ContainerManagerConfig, err error)
ContainerManagerConfig returns information from the model config that is needed for configuring the container manager.
func (*State) FindTools ¶
FindTools returns al ist of tools matching the specified version number and series, and, arch. If arch is blank, a default will be used.
func (*State) GetContainerInterfaceInfo ¶
func (st *State) GetContainerInterfaceInfo(containerTag names.MachineTag) ([]network.InterfaceInfo, error)
GetContainerInterfaceInfo returns information to configure networking for a container. It accepts container tags as arguments.
func (*State) MachinesWithTransientErrors ¶
func (st *State) MachinesWithTransientErrors() ([]*Machine, []params.StatusResult, error)
MachinesWithTransientErrors returns a slice of machines and corresponding status information for those machines which have transient provisioning errors.
func (*State) PrepareContainerInterfaceInfo ¶
func (st *State) PrepareContainerInterfaceInfo(containerTag names.MachineTag) ([]network.InterfaceInfo, error)
PrepareContainerInterfaceInfo allocates an address and returns information to configure networking for a container. It accepts container tags as arguments.
func (*State) ReleaseContainerAddresses ¶
ReleaseContainerAddresses releases a static IP address allocated to a container.
func (*State) StateAddresses ¶
StateAddresses returns the list of addresses used to connect to the state.
func (*State) WatchMachineErrorRetry ¶
func (st *State) WatchMachineErrorRetry() (watcher.NotifyWatcher, error)
func (*State) WatchModelMachines ¶
func (st *State) WatchModelMachines() (watcher.StringsWatcher, error)
WatchModelMachines returns a StringsWatcher that notifies of changes to the lifecycles of the machines (but not containers) in the current model.