Documentation ¶
Index ¶
- Variables
- type Client
- func (st *Client) CACert(ctx context.Context) (string, error)
- func (st *Client) ContainerConfig(ctx context.Context) (result params.ContainerConfig, err error)
- func (st *Client) ContainerManagerConfig(ctx context.Context, args params.ContainerManagerConfigParams) (result params.ContainerManagerConfig, err error)
- func (st *Client) DistributionGroupByMachineId(ctx context.Context, tags ...names.MachineTag) ([]DistributionGroupResult, error)
- func (st *Client) FindTools(ctx context.Context, v version.Number, os string, arch string) (tools.List, error)
- func (st *Client) GetContainerProfileInfo(ctx context.Context, containerTag names.MachineTag) ([]*LXDProfileResult, error)
- func (st *Client) HostChangesForContainer(ctx context.Context, containerTag names.MachineTag) ([]network.DeviceToBridge, int, error)
- func (st *Client) Machines(ctx context.Context, tags ...names.MachineTag) ([]MachineResult, error)
- func (st *Client) MachinesWithTransientErrors(ctx context.Context) ([]MachineStatusResult, error)
- func (st *Client) ModelUUID(ctx context.Context) (string, error)
- func (st *Client) PrepareContainerInterfaceInfo(ctx context.Context, containerTag names.MachineTag) (corenetwork.InterfaceInfos, error)
- func (st *Client) ProvisioningInfo(ctx context.Context, machineTags []names.MachineTag) (params.ProvisioningInfoResults, error)
- func (st *Client) ReleaseContainerAddresses(ctx context.Context, containerTag names.MachineTag) (err error)
- func (st *Client) SetHostMachineNetworkConfig(ctx context.Context, hostMachineTag names.MachineTag, ...) error
- func (st *Client) WatchMachineErrorRetry(ctx context.Context) (watcher.NotifyWatcher, error)
- func (st *Client) WatchModelMachines(ctx context.Context) (watcher.StringsWatcher, error)
- type DistributionGroupResult
- type LXDProfileResult
- type Machine
- func (m *Machine) AvailabilityZone(ctx context.Context) (string, error)
- func (m *Machine) DistributionGroup(ctx context.Context) ([]instance.Id, error)
- func (m *Machine) EnsureDead(ctx context.Context) error
- func (m *Machine) Id() string
- func (m *Machine) InstanceId(ctx context.Context) (instance.Id, error)
- func (m *Machine) InstanceStatus(ctx context.Context) (status.Status, string, error)
- func (m *Machine) KeepInstance(ctx context.Context) (bool, error)
- func (m *Machine) Life() life.Value
- func (m *Machine) MachineTag() names.MachineTag
- func (m *Machine) MarkForRemoval(ctx context.Context) error
- func (m *Machine) ModelAgentVersion(ctx context.Context) (*version.Number, error)
- func (m *Machine) Refresh(ctx context.Context) error
- func (m *Machine) Remove(ctx context.Context) error
- func (m *Machine) SetCharmProfiles(ctx context.Context, profiles []string) error
- func (m *Machine) SetInstanceInfo(ctx context.Context, id instance.Id, displayName string, nonce string, ...) error
- func (m *Machine) SetInstanceStatus(ctx context.Context, status status.Status, message string, ...) error
- func (m *Machine) SetModificationStatus(ctx context.Context, status status.Status, info string, ...) error
- func (m *Machine) SetPassword(ctx context.Context, password string) error
- func (m *Machine) SetStatus(ctx context.Context, status status.Status, info string, ...) error
- func (m *Machine) SetSupportedContainers(ctx context.Context, containerTypes ...instance.ContainerType) error
- func (m *Machine) Status(ctx context.Context) (status.Status, string, error)
- func (m *Machine) String() string
- func (m *Machine) SupportedContainers(ctx context.Context) ([]instance.ContainerType, bool, error)
- func (m *Machine) SupportsNoContainers(ctx context.Context) error
- func (m *Machine) Tag() names.Tag
- func (m *Machine) WatchContainers(ctx context.Context, ctype instance.ContainerType) (watcher.StringsWatcher, error)
- type MachineProvisioner
- type MachineResult
- type MachineStatusResult
- type Option
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 { *common.ModelConfigWatcher *common.APIAddresser *common.ControllerConfigAPI // contains filtered or unexported fields }
Client provides access to the Provisioner API facade.
func (*Client) CACert ¶
CACert returns the certificate used to validate the API and state connections.
func (*Client) ContainerConfig ¶
ContainerConfig returns information from the model config that is needed for container cloud-init.
func (*Client) ContainerManagerConfig ¶
func (st *Client) ContainerManagerConfig(ctx context.Context, args params.ContainerManagerConfigParams) (result params.ContainerManagerConfig, err error)
ContainerManagerConfig returns information from the model config that is needed for configuring the container manager.
func (*Client) DistributionGroupByMachineId ¶
func (st *Client) DistributionGroupByMachineId(ctx context.Context, 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 (*Client) FindTools ¶
func (st *Client) FindTools(ctx context.Context, v version.Number, os 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 (*Client) GetContainerProfileInfo ¶
func (st *Client) GetContainerProfileInfo(ctx context.Context, containerTag names.MachineTag) ([]*LXDProfileResult, error)
GetContainerProfileInfo returns a slice of ContainerLXDProfile, 1 for each unit's charm which contains an lxd-profile.yaml.
func (*Client) HostChangesForContainer ¶
func (*Client) Machines ¶
func (st *Client) Machines(ctx context.Context, tags ...names.MachineTag) ([]MachineResult, error)
Machines provides access to methods of a state.Machine through the facade for the given tags.
func (*Client) MachinesWithTransientErrors ¶
func (st *Client) MachinesWithTransientErrors(ctx context.Context) ([]MachineStatusResult, error)
MachinesWithTransientErrors returns a slice of machines and corresponding status information for those machines which have transient provisioning errors.
func (*Client) ModelUUID ¶
ModelUUID returns the model UUID to connect to the model that the current connection is for.
func (*Client) PrepareContainerInterfaceInfo ¶
func (st *Client) PrepareContainerInterfaceInfo(ctx context.Context, containerTag names.MachineTag) (corenetwork.InterfaceInfos, error)
PrepareContainerInterfaceInfo allocates an address and returns information to configure networking for a container. It accepts container tags as arguments.
func (*Client) ProvisioningInfo ¶
func (st *Client) ProvisioningInfo(ctx context.Context, machineTags []names.MachineTag) (params.ProvisioningInfoResults, error)
ProvisioningInfo implements MachineProvisioner.ProvisioningInfo.
func (*Client) ReleaseContainerAddresses ¶
func (st *Client) ReleaseContainerAddresses(ctx context.Context, containerTag names.MachineTag) (err error)
ReleaseContainerAddresses releases a static IP address allocated to a container.
func (*Client) SetHostMachineNetworkConfig ¶
func (st *Client) SetHostMachineNetworkConfig(ctx context.Context, hostMachineTag names.MachineTag, netConfig []params.NetworkConfig) error
SetHostMachineNetworkConfig sets the network configuration of the machine with netConfig
func (*Client) WatchMachineErrorRetry ¶
func (*Client) WatchModelMachines ¶
WatchModelMachines returns a StringsWatcher that notifies of changes to the lifecycles of the machines (but not containers) in the current model.
type DistributionGroupResult ¶
DistributionGroupResult provides a slice of machine.Ids in the distribution group and any Error related to finding it.
type LXDProfileResult ¶
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 ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine represents a juju machine as seen by the provisioner worker.
func (*Machine) AvailabilityZone ¶
AvailabilityZone implements MachineProvisioner.AvailabilityZone.
func (*Machine) DistributionGroup ¶
DistributionGroup implements MachineProvisioner.DistributionGroup.
func (*Machine) EnsureDead ¶
EnsureDead implements MachineProvisioner.EnsureDead.
func (*Machine) InstanceId ¶
InstanceId implements MachineProvisioner.InstanceId.
func (*Machine) InstanceStatus ¶
InstanceStatus implements MachineProvisioner.InstanceStatus.
func (*Machine) KeepInstance ¶
KeepInstance implements MachineProvisioner.KeepInstance.
func (*Machine) MachineTag ¶
func (m *Machine) MachineTag() names.MachineTag
MachineTag implements MachineProvisioner.MachineTag.
func (*Machine) MarkForRemoval ¶
MarkForRemoval implements MachineProvisioner.MarkForRemoval.
func (*Machine) ModelAgentVersion ¶
ModelAgentVersion implements MachineProvisioner.ModelAgentVersion.
func (*Machine) SetCharmProfiles ¶
SetCharmProfiles implements MachineProvisioner.SetCharmProfiles.
func (*Machine) SetInstanceInfo ¶
func (m *Machine) SetInstanceInfo( ctx context.Context, 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 ¶
func (m *Machine) SetInstanceStatus(ctx context.Context, status status.Status, message string, data map[string]interface{}) error
SetInstanceStatus implements MachineProvisioner.SetInstanceStatus.
func (*Machine) SetModificationStatus ¶
func (m *Machine) SetModificationStatus(ctx context.Context, status status.Status, info string, data map[string]interface{}) error
SetModificationStatus implements MachineProvisioner.SetModificationStatus.
func (*Machine) SetPassword ¶
SetPassword implements MachineProvisioner.SetPassword.
func (*Machine) SetStatus ¶
func (m *Machine) SetStatus(ctx context.Context, status status.Status, info string, data map[string]interface{}) error
SetStatus implements MachineProvisioner.SetStatus.
func (*Machine) SetSupportedContainers ¶
func (m *Machine) SetSupportedContainers(ctx context.Context, containerTypes ...instance.ContainerType) error
SetSupportedContainers implements MachineProvisioner.SetSupportedContainers.
func (*Machine) SupportedContainers ¶
SupportedContainers implements MachineProvisioner.SupportedContainers.
func (*Machine) SupportsNoContainers ¶
SupportsNoContainers implements MachineProvisioner.SupportsNoContainers.
func (*Machine) WatchContainers ¶
func (m *Machine) WatchContainers(ctx context.Context, ctype instance.ContainerType) (watcher.StringsWatcher, error)
WatchContainers implements MachineProvisioner.WatchContainers.
type MachineProvisioner ¶
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(ctx context.Context) (*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() life.Value // Refresh updates the cached local copy of the machine's data. Refresh(context.Context) error // SetInstanceStatus sets the status for the provider instance. SetInstanceStatus(ctx context.Context, status status.Status, message string, data map[string]interface{}) error // InstanceStatus returns the status of the provider instance. InstanceStatus(ctx context.Context) (status.Status, string, error) // SetStatus sets the status of the machine. SetStatus(ctx context.Context, status status.Status, info string, data map[string]interface{}) error // Status returns the status of the machine. Status(ctx context.Context) (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(ctx context.Context, 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(ctx context.Context) error // Remove removes the machine from state. It will fail if the machine // is not Dead. Remove(ctx context.Context) error // MarkForRemoval indicates that the machine is ready to have any // provider-level resources cleaned up and be removed. MarkForRemoval(ctx context.Context) error // AvailabilityZone returns an underlying provider's availability zone // for a machine. AvailabilityZone(ctx context.Context) (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(ctx context.Context) ([]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( ctx context.Context, 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(ctx context.Context) (instance.Id, error) // KeepInstance returns the value of the keep-instance // for the machine. KeepInstance(ctx context.Context) (bool, error) // SetPassword sets the machine's password. SetPassword(ctx context.Context, password string) error // WatchContainers returns a StringsWatcher that notifies of changes // to the lifecycles of containers of the specified type on the machine. WatchContainers(ctx context.Context, ctype instance.ContainerType) (watcher.StringsWatcher, error) // SetSupportedContainers updates the list of containers supported by this machine. SetSupportedContainers(ctx context.Context, containerTypes ...instance.ContainerType) error // SupportsNoContainers records the fact that this machine doesn't support any containers. SupportsNoContainers(ctx context.Context) error // SupportedContainers returns a list of containers supported by this machine. SupportedContainers(ctx context.Context) ([]instance.ContainerType, bool, error) // SetCharmProfiles records the given slice of charm profile names. SetCharmProfiles(context.Context, []string) error }
MachineProvisioner defines what provisioner needs to provision a machine.
type MachineResult ¶
type MachineResult struct { Machine MachineProvisioner Err *params.Error }
MachineResult provides a found Machine and any Error related to finding it.
type MachineStatusResult ¶
type MachineStatusResult struct { Machine MachineProvisioner Status params.StatusResult }
MachineStatusResult provides a found Machine and Status Results for it.