juju: github.com/juju/juju/apiserver/facades/agent/instancemutater Index | Files | Directories

package instancemutater

import "github.com/juju/juju/apiserver/facades/agent/instancemutater"

Index

Package Files

instancemutater.go interface.go shim.go

type InstanceMutaterAPI Uses

type InstanceMutaterAPI struct {
    *common.LifeGetter
    // contains filtered or unexported fields
}

func NewFacadeV2 Uses

func NewFacadeV2(ctx facade.Context) (*InstanceMutaterAPI, error)

NewFacadeV2 is used for API registration.

func NewInstanceMutaterAPI Uses

func NewInstanceMutaterAPI(st InstanceMutaterState,
    model ModelCache,
    resources facade.Resources,
    authorizer facade.Authorizer,
) (*InstanceMutaterAPI, error)

NewInstanceMutaterAPI creates a new API server endpoint for managing charm profiles on juju lxd machines and containers.

func (*InstanceMutaterAPI) CharmProfilingInfo Uses

func (api *InstanceMutaterAPI) CharmProfilingInfo(arg params.Entity) (params.CharmProfilingInfoResult, error)

CharmProfilingInfo returns info to update lxd profiles on the machine. If the machine is not provisioned, no profile change info will be returned, nor will an error.

func (*InstanceMutaterAPI) ContainerType Uses

func (api *InstanceMutaterAPI) ContainerType(arg params.Entity) (params.ContainerTypeResult, error)

ContainerType returns the container type of a machine.

func (*InstanceMutaterAPI) SetCharmProfiles Uses

func (api *InstanceMutaterAPI) SetCharmProfiles(args params.SetProfileArgs) (params.ErrorResults, error)

SetCharmProfiles records the given slice of charm profile names.

func (*InstanceMutaterAPI) SetModificationStatus Uses

func (api *InstanceMutaterAPI) SetModificationStatus(args params.SetStatus) (params.ErrorResults, error)

SetModificationStatus updates the instance whilst changes are occurring. This is different from SetStatus and SetInstanceStatus, by the fact this holds information about the ongoing changes that are happening to instances. Consider LXD Profile updates that can modify a instance, but may not cause the instance to be placed into a error state. This modification status serves the purpose of highlighting that to the operator. Only machine tags are accepted.

func (*InstanceMutaterAPI) WatchContainers Uses

func (api *InstanceMutaterAPI) WatchContainers(arg params.Entity) (params.StringsWatchResult, error)

WatchContainers starts a watcher to track Containers on a given machine.

func (*InstanceMutaterAPI) WatchLXDProfileVerificationNeeded Uses

func (api *InstanceMutaterAPI) WatchLXDProfileVerificationNeeded(args params.Entities) (params.NotifyWatchResults, error)

WatchLXDProfileVerificationNeeded starts a watcher to track Applications with LXD Profiles.

func (*InstanceMutaterAPI) WatchMachines Uses

func (api *InstanceMutaterAPI) WatchMachines() (params.StringsWatchResult, error)

WatchMachines starts a watcher to track machines. WatchMachines does not consume the initial event of the watch response, as that returns the initial set of machines that are currently available.

type InstanceMutaterAPIV1 Uses

type InstanceMutaterAPIV1 struct {
    *InstanceMutaterAPI
}

func NewFacadeV1 Uses

func NewFacadeV1(ctx facade.Context) (*InstanceMutaterAPIV1, error)

NewFacadeV1 is used for API registration.

type InstanceMutaterState Uses

type InstanceMutaterState interface {
    state.EntityFinder

    ControllerTimestamp() (*time.Time, error)
}

type InstanceMutaterV1 Uses

type InstanceMutaterV1 interface {
    Life(args params.Entities) (params.LifeResults, error)

    CharmProfilingInfo(arg params.Entity) (params.CharmProfilingInfoResult, error)
    SetCharmProfiles(args params.SetProfileArgs) (params.ErrorResults, error)
    SetModificationStatus(args params.SetStatus) (params.ErrorResults, error)
    WatchMachines() (params.StringsWatchResult, error)
    WatchLXDProfileVerificationNeeded(args params.Entities) (params.NotifyWatchResults, error)
}

InstanceMutaterV1 defines the methods on the instance mutater API facade, version 1.

type InstanceMutaterV2 Uses

type InstanceMutaterV2 interface {
    Life(args params.Entities) (params.LifeResults, error)

    CharmProfilingInfo(arg params.Entity) (params.CharmProfilingInfoResult, error)
    ContainerType(arg params.Entity) (params.ContainerTypeResult, error)
    SetCharmProfiles(args params.SetProfileArgs) (params.ErrorResults, error)
    SetModificationStatus(args params.SetStatus) (params.ErrorResults, error)
    WatchMachines() (params.StringsWatchResult, error)
    WatchLXDProfileVerificationNeeded(args params.Entities) (params.NotifyWatchResults, error)
}

InstanceMutaterV2 defines the methods on the instance mutater API facade, version 2.

type LXDProfile Uses

type LXDProfile interface {
    Config() map[string]string
    Description() string
    Devices() map[string]map[string]string
    Empty() bool
    ValidateConfigDevices() error
}

type Machine Uses

type Machine interface {
    SetCharmProfiles([]string) error
    SetModificationStatus(status.StatusInfo) error
}

Machine represents point of use methods from the state machine object

type ModelCache Uses

type ModelCache interface {
    Name() string
    Application(appName string) (ModelCacheApplication, error)
    Charm(charmURL string) (ModelCacheCharm, error)
    Machine(machineId string) (ModelCacheMachine, error)
    WatchMachines() (cache.StringsWatcher, error)
}

ModelCache represents point of use methods from the cache model

type ModelCacheApplication Uses

type ModelCacheApplication interface {
    CharmURL() string
}

ModelCacheApplication represents a point of use Application from the cache package.

type ModelCacheCharm Uses

type ModelCacheCharm interface {
    LXDProfile() lxdprofile.Profile
}

ModelCacheCharm represents point of use methods from the cache charm object

type ModelCacheMachine Uses

type ModelCacheMachine interface {
    InstanceId() (instance.Id, error)
    CharmProfiles() []string
    ContainerType() instance.ContainerType
    WatchLXDProfileVerificationNeeded() (cache.NotifyWatcher, error)
    WatchContainers() (cache.StringsWatcher, error)
    Units() ([]ModelCacheUnit, error)
}

ModelCacheMachine represents a point of use Machine from the cache package.

type ModelCacheUnit Uses

type ModelCacheUnit interface {
    Application() string
}

ModelCacheUnit represents a point of use Unit from the cache package.

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package instancemutater imports 13 packages (graph) and is imported by 3 packages. Updated 2019-09-01. Refresh now. Tools for package owners.