instancemutater

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	CharmURL() *charm.URL
}

Application represents point of use methods from the state Application object.

type Charm

type Charm interface {
	LXDProfile() lxdprofile.Profile
}

Charm represents point of use methods from the state Charm object.

type EntityMachineFunc

type EntityMachineFunc func(state.Entity) (Machine, error)

type InstanceMutaterAPI

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

func NewFacadeV2

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

NewFacadeV2 is used for API registration.

func NewInstanceMutaterAPI

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

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

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

ContainerType returns the container type of a machine.

func (*InstanceMutaterAPI) SetCharmProfiles

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

SetCharmProfiles records the given slice of charm profile names.

func (*InstanceMutaterAPI) SetModificationStatus

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

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

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

func (*InstanceMutaterAPI) WatchLXDProfileVerificationNeeded

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

WatchLXDProfileVerificationNeeded starts a watcher to track Applications with LXD Profiles.

func (*InstanceMutaterAPI) WatchMachines

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

type InstanceMutaterAPIV1 struct {
	*InstanceMutaterAPI
}

func NewFacadeV1

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

NewFacadeV1 is used for API registration.

type InstanceMutaterState

type InstanceMutaterState interface {
	state.EntityFinder

	Application(appName string) (Application, error)
	Charm(curl *charm.URL) (Charm, error)
	ControllerTimestamp() (*time.Time, error)
}

InstanceMutaterState represents point of use methods from the state object.

type InstanceMutaterV1

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

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 Machine

type Machine interface {
	InstanceId() (instance.Id, error)
	CharmProfiles() ([]string, error)
	SetCharmProfiles([]string) error
	SetModificationStatus(status.StatusInfo) error
	Units() ([]Unit, error)
}

Machine represents point of use methods from the state Machine object.

type ModelCache

type ModelCache interface {
	Name() string
	Machine(machineId string) (ModelCacheMachine, error)
	WatchMachines() (cache.StringsWatcher, error)
}

ModelCache represents point of use methods from the cache model

type ModelCacheMachine

type ModelCacheMachine interface {
	ContainerType() instance.ContainerType
	IsManual() bool
	WatchLXDProfileVerificationNeeded() (cache.NotifyWatcher, error)
	WatchContainers() (cache.StringsWatcher, error)
}

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

type Unit

type Unit interface {
	Application() string
}

Unit represents a point of use methods from the state Unit object.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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