caasunitprovisioner

package
v0.0.0-...-a753888 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 35 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type Application

type Application interface {
	GetScale() int
	SetScale(int, int64, bool) error
	WatchConfigSettingsHash() state.StringsWatcher
	WatchScale() state.NotifyWatcher
	ApplicationConfig() (coreconfig.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() (charmscommon.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 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
	// 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,
	charmInfoAPI *charmscommon.CharmInfoAPI,
	appCharmInfoAPI *charmscommon.ApplicationCharmInfoAPI,
	clock clock.Clock,
) (*Facade, error)

NewFacade returns a new CAAS unit provisioner Facade facade.

func (*Facade) ApplicationCharmInfo

func (f *Facade) ApplicationCharmInfo(args params.Entity) (params.Charm, error)

ApplicationCharmInfo returns information about an application's charm.

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) ApplicationsTrust

func (f *Facade) ApplicationsTrust(args params.Entities) (params.BoolResults, error)

ApplicationsTrust returns the trust status for specified applications in this model.

func (*Facade) CharmInfo

func (f *Facade) CharmInfo(args params.CharmURL) (params.Charm, error)

CharmInfo returns information about the requested charm.

func (*Facade) ClearApplicationsResources

func (f *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 (f *Facade) SetOperatorStatus(args params.SetStatus) (params.ErrorResults, error)

SetOperatorStatus updates the operator status for each given application.

func (*Facade) UpdateApplicationsService

func (f *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) Watch

Watch starts a NotifyWatcher for each entity given.

func (*Facade) WatchApplications

func (f *Facade) WatchApplications() (params.StringsWatchResult, error)

WatchApplications starts a StringsWatcher to watch applications deployed to this model.

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) WatchApplicationsTrustHash

func (f *Facade) WatchApplicationsTrustHash(args params.Entities) (params.StringsWatchResults, error)

WatchApplicationsTrustHash starts a StringsWatcher to watch changes to the applications' trust status.

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
}

Jump to

Keyboard shortcuts

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