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

package instancemutater

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


Package Files

instancemutater.go machine.go

type Client Uses

type Client struct {
    // contains filtered or unexported fields

func NewClient Uses

func NewClient(caller base.APICaller) *Client

NewState creates a new instance mutater facade using the input caller.

func NewClientFromFacade Uses

func NewClientFromFacade(facadeCaller base.FacadeCaller) *Client

NewStateFromFacade creates a new instance mutater facade using the input facade caller.

func (*Client) Machine Uses

func (c *Client) Machine(tag names.MachineTag) (MutaterMachine, error)

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

func (*Client) WatchMachines Uses

func (c *Client) WatchMachines() (watcher.StringsWatcher, error)

WatchMachines returns a StringsWatcher reporting changes to machines.

type Machine Uses

type Machine struct {
    // contains filtered or unexported fields

Machine represents a juju machine as seen by an instancemutater worker.

func (*Machine) CharmProfilingInfo Uses

func (m *Machine) CharmProfilingInfo() (*UnitProfileInfo, error)

CharmProfilingInfo implements MutaterMachine.CharmProfilingInfo.

func (*Machine) ContainerType Uses

func (m *Machine) ContainerType() (instance.ContainerType, error)

ContainerType implements MutaterMachine.ContainerType.

func (*Machine) InstanceId Uses

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

InstanceId implements MutaterMachine.InstanceId.

func (*Machine) Life Uses

func (m *Machine) Life() life.Value

Life implements MutaterMachine.Life.

func (*Machine) Refresh Uses

func (m *Machine) Refresh() error

Refresh implements MutaterMachine.Refresh.

func (*Machine) SetCharmProfiles Uses

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

SetCharmProfiles implements MutaterMachine.SetCharmProfiles.

func (*Machine) SetModificationStatus Uses

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

SetModificationStatus implements MutaterMachine.SetModificationStatus.

func (*Machine) Tag Uses

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

Tag implements MutaterMachine.Tag.

func (*Machine) WatchContainers Uses

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

WatchContainers returns a StringsWatcher reporting changes to containers.

func (*Machine) WatchLXDProfileVerificationNeeded Uses

func (m *Machine) WatchLXDProfileVerificationNeeded() (watcher.NotifyWatcher, error)

WatchLXDProfileVerificationNeeded implements MutaterMachine.WatchLXDProfileVerificationNeeded.

func (*Machine) WatchUnits Uses

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

WatchUnits implements MutaterMachine.WatchUnits.

type MutaterMachine Uses

type MutaterMachine interface {

    // InstanceId returns the provider specific instance id for this machine
    InstanceId() (string, error)

    // CharmProfilingInfo returns info to update lxd profiles on the machine
    CharmProfilingInfo() (*UnitProfileInfo, error)

    // ContainerType returns the container type for this machine.
    ContainerType() (instance.ContainerType, error)

    // SetCharmProfiles records the given slice of charm profile names.
    SetCharmProfiles([]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() error

    // WatchUnits returns a watcher.StringsWatcher for watching units of a given
    // machine.
    WatchUnits() (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() (watcher.NotifyWatcher, error)

    // WatchContainers returns a watcher.StringsWatcher for watching
    // containers of a given machine.
    WatchContainers() (watcher.StringsWatcher, error)

    // SetModificationStatus sets the provider specific modification status
    // for a machine. Allowing the propagation of status messages to the
    // operator.
    SetModificationStatus(status status.Status, info string, data map[string]interface{}) error

go:generate mockgen -package mocks -destination mocks/caller_mock.go github.com/juju/juju/api/base APICaller,FacadeCaller go:generate mockgen -package mocks -destination mocks/machinemutater_mock.go github.com/juju/juju/api/instancemutater MutaterMachine

type UnitProfileChanges Uses

type UnitProfileChanges struct {
    ApplicationName string
    Revision        int
    Profile         lxdprofile.Profile

type UnitProfileInfo Uses

type UnitProfileInfo struct {
    ModelName       string
    InstanceId      instance.Id
    ProfileChanges  []UnitProfileChanges
    CurrentProfiles []string


mocksPackage mocks is a generated GoMock package.

Package instancemutater imports 12 packages (graph) and is imported by 6 packages. Updated 2020-01-08. Refresh now. Tools for package owners.