provisioner

package
v0.0.0-...-4bd6544 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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

func (m *Machine) DistributionGroup() ([]instance.Id, error)

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

func (m *Machine) EnsureDead() error

EnsureDead sets the machine lifecycle to Dead if it is Alive or Dying. It does nothing otherwise.

func (*Machine) Id

func (m *Machine) Id() string

Id returns the machine id.

func (*Machine) InstanceId

func (m *Machine) InstanceId() (instance.Id, error)

InstanceId returns the provider specific instance id for the machine or an CodeNotProvisioned error, if not set.

func (*Machine) InstanceStatus

func (m *Machine) InstanceStatus() (status.Status, string, error)

InstanceStatus returns the status of the provider instance.

func (*Machine) Life

func (m *Machine) Life() params.Life

Life returns the machine's lifecycle value.

func (*Machine) MarkForRemoval

func (m *Machine) MarkForRemoval() error

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) Refresh

func (m *Machine) Refresh() error

Refresh updates the cached local copy of the machine's data.

func (*Machine) Remove

func (m *Machine) Remove() error

Remove removes the machine from state. It will fail if the machine is not Dead.

func (*Machine) Series

func (m *Machine) Series() (string, error)

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

func (m *Machine) SetPassword(password string) error

SetPassword sets the machine's password.

func (*Machine) SetStatus

func (m *Machine) SetStatus(status status.Status, info string, data map[string]interface{}) error

SetStatus sets the status of the machine.

func (*Machine) SetSupportedContainers

func (m *Machine) SetSupportedContainers(containerTypes ...instance.ContainerType) error

SetSupportedContainers updates the list of containers supported by this machine.

func (*Machine) Status

func (m *Machine) Status() (status.Status, string, error)

Status returns the status of the machine.

func (*Machine) String

func (m *Machine) String() string

String returns the machine as a string.

func (*Machine) SupportsNoContainers

func (m *Machine) SupportsNoContainers() error

SupportsNoContainers records the fact that this machine doesn't support any containers.

func (*Machine) Tag

func (m *Machine) Tag() names.Tag

Tag returns the machine's tag.

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 NewState

func NewState(caller base.APICaller) *State

NewState creates a new client-side Machiner 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

func (st *State) FindTools(v version.Number, series string, arch string) (tools.List, error)

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) Machine

func (st *State) Machine(tag names.MachineTag) (*Machine, error)

Machine provides access to methods of a state.Machine through the facade.

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

func (st *State) ReleaseContainerAddresses(containerTag names.MachineTag) (err error)

ReleaseContainerAddresses releases a static IP address allocated to a container.

func (*State) StateAddresses

func (st *State) StateAddresses() ([]string, error)

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.

Jump to

Keyboard shortcuts

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