Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	GetScale() int
	SetScale(int, int64, bool) error
	WatchScale() state.NotifyWatcher
	ApplicationConfig() (application.ConfigAttributes, error)
	AllUnits() (units []Unit, err error)
	AddOperation(state.UnitUpdateProperties) *state.AddUnitOperation
	UpdateUnits(*state.UpdateUnitsOperation) error
	UpdateCloudService(providerId string, addresses []network.SpaceAddress) error
	StorageConstraints() (map[string]state.StorageConstraints, error)
	DeviceConstraints() (map[string]state.DeviceConstraints, error)
	Life() state.Life
	Name() string
	Tag() names.Tag
	Constraints() (constraints.Value, error)
	GetPlacement() string
	SetOperatorStatus(sInfo status.StatusInfo) error
	SetStatus(statusInfo status.StatusInfo) error
	Charm() (Charm, bool, error)
	ClearResources() error
	CharmModifiedVersion() int
}

Application provides the subset of application state required by the CAAS unit provisioner facade.

type CAASUnitProvisionerState

type CAASUnitProvisionerState interface {
	network.SpaceLookup

	ControllerConfig() (controller.Config, error)
	Application(string) (Application, error)
	FindEntity(names.Tag) (state.Entity, error)
	Model() (Model, error)
	WatchApplications() state.StringsWatcher
	ResolveConstraints(cons constraints.Value) (constraints.Value, error)
}

CAASUnitProvisionerState provides the subset of global state required by the CAAS unit provisioner facade.

type Charm

type Charm interface {
	Meta() *charm.Meta
}

type DeviceBackend

type DeviceBackend interface {
	DeviceConstraints(id string) (map[string]state.DeviceConstraints, error)
}

DeviceBackend provides the subset of backend Device functionality required by the CAAS unit provisioner facade.

type Facade

type Facade struct {
	*common.LifeGetter
	*common.ApplicationWatcherFacade

	// contains filtered or unexported fields

}

func NewFacade

func NewFacade(
	resources facade.Resources,
	authorizer facade.Authorizer,
	st CAASUnitProvisionerState,
	sb StorageBackend,
	db DeviceBackend,
	storagePoolManager poolmanager.PoolManager,
	registry storage.ProviderRegistry,
	applicationWatcherFacade *common.ApplicationWatcherFacade,
	clock clock.Clock,
) (*Facade, error)

NewFacade returns a new CAAS unit provisioner Facade facade.

func NewStateFacade

func NewStateFacade(ctx facade.Context) (*Facade, error)

NewStateFacade provides the signature required for facade registration.

func (*Facade) ApplicationsConfig

func (f *Facade) ApplicationsConfig(args params.Entities) (params.ApplicationGetConfigResults, error)

ApplicationsConfig returns the config for the specified applications.

func (*Facade) ApplicationsScale

func (f *Facade) ApplicationsScale(args params.Entities) (params.IntResults, error)

ApplicationsScale returns the scaling info for specified applications in this model.

func (*Facade) ClearApplicationsResources

func (a *Facade) ClearApplicationsResources(args params.Entities) (params.ErrorResults, error)

ClearApplicationsResources clears the flags which indicate applications still have resources in the cluster.

func (*Facade) DeploymentMode

func (f *Facade) DeploymentMode(args params.Entities) (params.StringResults, error)

DeploymentMode returns the deployment mode of the given applications' charms.

func (*Facade) ProvisioningInfo

func (f *Facade) ProvisioningInfo(args params.Entities) (params.KubernetesProvisioningInfoResults, error)

ProvisioningInfo returns the provisioning info for specified applications in this model.

func (*Facade) SetOperatorStatus

func (a *Facade) SetOperatorStatus(args params.SetStatus) (params.ErrorResults, error)

SetOperatorStatus updates the operator status for each given application.

func (*Facade) UpdateApplicationsService

func (a *Facade) UpdateApplicationsService(args params.UpdateApplicationServiceArgs) (params.ErrorResults, error)

UpdateApplicationsService updates the Juju data model to reflect the given service details of the specified application.

func (*Facade) UpdateApplicationsUnits

UpdateApplicationsUnits updates the Juju data model to reflect the given units of the specified application.

func (*Facade) WatchApplicationsScale

func (f *Facade) WatchApplicationsScale(args params.Entities) (params.NotifyWatchResults, error)

WatchApplicationsScale starts a NotifyWatcher to watch changes to the applications' scale.

func (*Facade) WatchPodSpec

func (f *Facade) WatchPodSpec(args params.Entities) (params.NotifyWatchResults, error)

WatchPodSpec starts a NotifyWatcher to watch changes to the pod spec for specified units in this model.

type Model

type Model interface {
	ModelConfig() (*config.Config, error)
	PodSpec(tag names.ApplicationTag) (string, error)
	RawK8sSpec(tag names.ApplicationTag) (string, error)
	WatchPodSpec(tag names.ApplicationTag) (state.NotifyWatcher, error)
	Containers(providerIds ...string) ([]state.CloudContainer, error)
}

Model provides the subset of CAAS model state required by the CAAS unit provisioner facade.

type StorageBackend

type StorageBackend interface {
	StorageInstance(names.StorageTag) (state.StorageInstance, error)
	Filesystem(names.FilesystemTag) (state.Filesystem, error)
	StorageInstanceFilesystem(names.StorageTag) (state.Filesystem, error)
	UnitStorageAttachments(unit names.UnitTag) ([]state.StorageAttachment, error)
	SetFilesystemInfo(names.FilesystemTag, state.FilesystemInfo) error
	SetFilesystemAttachmentInfo(names.Tag, names.FilesystemTag, state.FilesystemAttachmentInfo) error
	Volume(tag names.VolumeTag) (state.Volume, error)
	StorageInstanceVolume(tag names.StorageTag) (state.Volume, error)
	SetVolumeInfo(names.VolumeTag, state.VolumeInfo) error
	SetVolumeAttachmentInfo(names.Tag, names.VolumeTag, state.VolumeAttachmentInfo) error

	// These are for cleanup up orphaned filesystems when pods are recreated.
	// TODO(caas) - record unit id on the filesystem so we can query by unit
	AllFilesystems() ([]state.Filesystem, error)
	DestroyStorageInstance(tag names.StorageTag, destroyAttachments bool, force bool, maxWait time.Duration) (err error)
	DestroyFilesystem(tag names.FilesystemTag, force bool) (err error)
}

StorageBackend provides the subset of backend storage functionality required by the CAAS unit provisioner facade.

type Unit

type Unit interface {
	Name() string
	Life() state.Life
	UnitTag() names.UnitTag
	ContainerInfo() (state.CloudContainer, error)
	AgentStatus() (status.StatusInfo, error)
	UpdateOperation(props state.UnitUpdateProperties) *state.UpdateUnitOperation
	DestroyOperation() *state.DestroyUnitOperation
}