juju: github.com/juju/juju/api/provisioner Index | Files | Directories

package provisioner

import "github.com/juju/juju/api/provisioner"

Index

Package Files

machine.go provisioner.go

type DistributionGroupResult Uses

type DistributionGroupResult struct {
    MachineIds []string
    Err        *params.Error
}

DistributionGroupResult provides a slice of machine.Ids in the distribution group and any Error related to finding it.

type LXDProfileResult Uses

type LXDProfileResult struct {
    Config      map[string]string            `json:"config" yaml:"config"`
    Description string                       `json:"description" yaml:"description"`
    Devices     map[string]map[string]string `json:"devices" yaml:"devices"`
    Name        string                       `json:"name" yaml:"name"`
}

LXDProfileResult provides a charm.LXDProfile, adding the name.

type Machine Uses

type Machine struct {
    // contains filtered or unexported fields
}

Machine represents a juju machine as seen by the provisioner worker.

func (*Machine) AvailabilityZone Uses

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

AvailabilityZone implements MachineProvisioner.AvailabilityZone.

func (*Machine) DistributionGroup Uses

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

DistributionGroup implements MachineProvisioner.DistributionGroup.

func (*Machine) EnsureDead Uses

func (m *Machine) EnsureDead() error

EnsureDead implements MachineProvisioner.EnsureDead.

func (*Machine) Id Uses

func (m *Machine) Id() string

Id implements MachineProvisioner.Id.

func (*Machine) InstanceId Uses

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

InstanceId implements MachineProvisioner.InstanceId.

func (*Machine) InstanceStatus Uses

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

InstanceStatus implements MachineProvisioner.InstanceStatus.

func (*Machine) KeepInstance Uses

func (m *Machine) KeepInstance() (bool, error)

KeepInstance implements MachineProvisioner.KeepInstance.

func (*Machine) Life Uses

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

Life implements MachineProvisioner..

func (*Machine) MachineTag Uses

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

MachineTag implements MachineProvisioner.MachineTag.

func (*Machine) MarkForRemoval Uses

func (m *Machine) MarkForRemoval() error

MarkForRemoval implements MachineProvisioner.MarkForRemoval.

func (*Machine) ModelAgentVersion Uses

func (m *Machine) ModelAgentVersion() (*version.Number, error)

ModelAgentVersion implements MachineProvisioner.ModelAgentVersion.

func (*Machine) ProvisioningInfo Uses

func (m *Machine) ProvisioningInfo() (*params.ProvisioningInfo, error)

ProvisioningInfo implements MachineProvisioner.ProvisioningInfo.

func (*Machine) Refresh Uses

func (m *Machine) Refresh() error

Refresh implements MachineProvisioner.Refresh.

func (*Machine) Remove Uses

func (m *Machine) Remove() error

Remove implements MachineProvisioner.Remove.

func (*Machine) SetCharmProfiles Uses

func (m *Machine) SetCharmProfiles(profiles []string) error

SetCharmProfiles implements MachineProvisioner.SetCharmProfiles.

func (*Machine) SetInstanceInfo Uses

func (m *Machine) SetInstanceInfo(
    id instance.Id, displayName string, nonce string, characteristics *instance.HardwareCharacteristics,
    networkConfig []params.NetworkConfig, volumes []params.Volume,
    volumeAttachments map[string]params.VolumeAttachmentInfo, charmProfiles []string,
) error

SetInstanceInfo implements MachineProvisioner.SetInstanceInfo.

func (*Machine) SetInstanceStatus Uses

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

SetInstanceStatus implements MachineProvisioner.SetInstanceStatus.

func (*Machine) SetModificationStatus Uses

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

SetModificationStatus implements MachineProvisioner.SetModificationStatus.

func (*Machine) SetPassword Uses

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

SetPassword implements MachineProvisioner.SetPassword.

func (*Machine) SetStatus Uses

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

SetStatus implements MachineProvisioner.SetStatus.

func (*Machine) SetSupportedContainers Uses

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

SetSupportedContainers implements MachineProvisioner.SetSupportedContainers.

func (*Machine) Status Uses

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

Status implements MachineProvisioner.Status.

func (*Machine) String Uses

func (m *Machine) String() string

String implements MachineProvisioner.String.

func (*Machine) SupportedContainers Uses

func (m *Machine) SupportedContainers() ([]instance.ContainerType, bool, error)

SupportedContainers implements MachineProvisioner.SupportedContainers.

func (*Machine) SupportsNoContainers Uses

func (m *Machine) SupportsNoContainers() error

SupportsNoContainers implements MachineProvisioner.SupportsNoContainers.

func (*Machine) Tag Uses

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

Tag implements MachineProvisioner.Tag.

func (*Machine) WatchAllContainers Uses

func (m *Machine) WatchAllContainers() (watcher.StringsWatcher, error)

WatchAllContainers implements MachineProvisioner.WatchAllContainers.

func (*Machine) WatchContainers Uses

func (m *Machine) WatchContainers(ctype instance.ContainerType) (watcher.StringsWatcher, error)

WatchContainers implements MachineProvisioner.WatchContainers.

type MachineProvisioner Uses

type MachineProvisioner interface {
    // Tag returns the machine's tag.
    Tag() names.Tag

    // ModelAgentVersion returns the agent version the machine's model is currently
    // running or an error.
    ModelAgentVersion() (*version.Number, error)

    // MachineTag returns the identifier for the machine as the most specific type.
    MachineTag() names.MachineTag

    // Id returns the machine id.
    Id() string

    // String returns the machine as a string.
    String() string

    // Life returns the machine's lifecycle value.
    Life() params.Life

    // Refresh updates the cached local copy of the machine's data.
    Refresh() error

    // ProvisioningInfo returns the information required to provision a machine.
    ProvisioningInfo() (*params.ProvisioningInfo, error)

    // SetInstanceStatus sets the status for the provider instance.
    SetInstanceStatus(status status.Status, message string, data map[string]interface{}) error

    // InstanceStatus returns the status of the provider instance.
    InstanceStatus() (status.Status, string, error)

    // SetStatus sets the status of the machine.
    SetStatus(status status.Status, info string, data map[string]interface{}) error

    // Status returns the status of the machine.
    Status() (status.Status, string, error)

    // SetModificationStatus sets the status of the machine changes whilst it's
    // running. Example of this could be LXD profiles being applied.
    SetModificationStatus(status status.Status, message string, data map[string]interface{}) error

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

    // Remove removes the machine from state. It will fail if the machine
    // is not Dead.
    Remove() error

    // MarkForRemoval indicates that the machine is ready to have any
    // provider-level resources cleaned up and be removed.
    MarkForRemoval() error

    // AvailabilityZone returns an underlying provider's availability zone
    // for a machine.
    AvailabilityZone() (string, 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.
    DistributionGroup() ([]instance.Id, error)

    // SetInstanceInfo sets the provider specific instance id, nonce, metadata,
    // network config for this machine. Once set, the instance id cannot be changed.
    SetInstanceInfo(
        id instance.Id, displayName string, nonce string, characteristics *instance.HardwareCharacteristics,
        networkConfig []params.NetworkConfig, volumes []params.Volume,
        volumeAttachments map[string]params.VolumeAttachmentInfo, charmProfiles []string,
    ) error

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

    // KeepInstance returns the value of the keep-instance
    // for the machine.
    KeepInstance() (bool, error)

    // SetPassword sets the machine's password.
    SetPassword(password string) error

    // WatchContainers returns a StringsWatcher that notifies of changes
    // to the lifecycles of containers of the specified type on the machine.
    WatchContainers(ctype instance.ContainerType) (watcher.StringsWatcher, error)

    // WatchAllContainers returns a StringsWatcher that notifies of changes
    // to the lifecycles of all containers on the machine.
    WatchAllContainers() (watcher.StringsWatcher, error)

    // SetSupportedContainers updates the list of containers supported by this machine.
    SetSupportedContainers(containerTypes ...instance.ContainerType) error

    // SupportsNoContainers records the fact that this machine doesn't support any containers.
    SupportsNoContainers() error

    // SupportedContainers returns a list of containers supported by this machine.
    SupportedContainers() ([]instance.ContainerType, bool, error)

    // SetCharmProfiles records the given slice of charm profile names.
    SetCharmProfiles([]string) error
}

MachineProvisioner defines what provisioner needs to provision a machine.

type MachineResult Uses

type MachineResult struct {
    Machine MachineProvisioner
    Err     *params.Error
}

MachineResult provides a found Machine and any Error related to finding it.

type MachineStatusResult Uses

type MachineStatusResult struct {
    Machine MachineProvisioner
    Status  params.StatusResult
}

MachineStatusResult provides a found Machine and Status Results for it.

type State Uses

type State struct {
    *common.ModelWatcher
    *common.APIAddresser
    *common.ControllerConfigAPI
    // contains filtered or unexported fields
}

State provides access to the Machiner API facade.

func NewState Uses

func NewState(caller base.APICaller) *State

NewState creates a new provisioner facade using the input caller.

func NewStateFromFacade Uses

func NewStateFromFacade(facadeCaller base.FacadeCaller) *State

NewStateFromFacade creates a new provisioner facade using the input facade caller.

func (*State) CACert Uses

func (a *State) CACert() (string, error)

CACert returns the certificate used to validate the API and state connections.

func (*State) ContainerConfig Uses

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 Uses

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) DistributionGroupByMachineId Uses

func (st *State) DistributionGroupByMachineId(tags ...names.MachineTag) ([]DistributionGroupResult, error)

DistributionGroupByMachineId returns a slice of machine.Ids that belong to the same distribution group as the given Machine. The provisioner may use this information to distribute instances for high availability.

func (*State) FindTools Uses

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 Uses

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) GetContainerProfileInfo Uses

func (st *State) GetContainerProfileInfo(containerTag names.MachineTag) ([]*LXDProfileResult, error)

GetContainerProfileInfo returns a slice of ContainerLXDProfile, 1 for each unit's charm which contains an lxd-profile.yaml.

func (*State) HostChangesForContainer Uses

func (st *State) HostChangesForContainer(containerTag names.MachineTag) ([]network.DeviceToBridge, int, error)

func (*State) Machines Uses

func (st *State) Machines(tags ...names.MachineTag) ([]MachineResult, error)

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

func (*State) MachinesWithTransientErrors Uses

func (st *State) MachinesWithTransientErrors() ([]MachineStatusResult, error)

MachinesWithTransientErrors returns a slice of machines and corresponding status information for those machines which have transient provisioning errors.

func (*State) PrepareContainerInterfaceInfo Uses

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 Uses

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

ReleaseContainerAddresses releases a static IP address allocated to a container.

func (*State) SetHostMachineNetworkConfig Uses

func (st *State) SetHostMachineNetworkConfig(hostMachineTag names.MachineTag, netConfig []params.NetworkConfig) error

SetHostMachineNetworkConfig sets the network configuration of the machine with netConfig

func (*State) StateAddresses Uses

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

StateAddresses returns the list of addresses used to connect to the state.

func (*State) WatchMachineErrorRetry Uses

func (st *State) WatchMachineErrorRetry() (watcher.NotifyWatcher, error)

func (*State) WatchModelMachines Uses

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.

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package provisioner imports 14 packages (graph) and is imported by 114 packages. Updated 2019-10-03. Refresh now. Tools for package owners.