caasapplicationprovisioner

package
v0.0.0-...-ac56535 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharmStorageParams

func CharmStorageParams(
	controllerUUID string,
	storageClassName string,
	modelCfg *config.Config,
	poolName string,
	poolManager poolmanager.PoolManager,
	registry storage.ProviderRegistry,
) (*params.KubernetesFilesystemParams, error)

CharmStorageParams returns filesystem parameters needed to provision storage used for a charm operator or workload.

func Register

func Register(registry facade.FacadeRegistry)

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

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewCAASApplicationProvisionerAPI

func NewCAASApplicationProvisionerAPI(
	ctrlSt CAASApplicationControllerState,
	st CAASApplicationProvisionerState,
	resources facade.Resources,
	newResourceOpener NewResourceOpenerFunc,
	authorizer facade.Authorizer,
	sb StorageBackend,
	storagePoolManager poolmanager.PoolManager,
	registry storage.ProviderRegistry,
	clock clock.Clock,
) (*API, error)

NewCAASApplicationProvisionerAPI returns a new CAAS operator provisioner API facade.

func (*API) ApplicationOCIResources

func (a *API) ApplicationOCIResources(args params.Entities) (params.CAASApplicationOCIResourceResults, error)

ApplicationOCIResources returns the OCI image resources for an application.

func (*API) ClearApplicationsResources

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

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

func (*API) DestroyUnits

func (a *API) DestroyUnits(args params.DestroyUnitsParams) (params.DestroyUnitResults, error)

DestroyUnits is responsible for scaling down a set of units on the this Application.

func (*API) ProvisionerConfig

func (a *API) ProvisionerConfig() (params.CAASApplicationProvisionerConfigResult, error)

ProvisionerConfig returns the provisioner's configuration.

func (*API) ProvisioningInfo

ProvisioningInfo returns the info needed to provision a caas application.

func (*API) ProvisioningState

func (a *API) ProvisioningState(args params.Entity) (params.CAASApplicationProvisioningStateResult, error)

ProvisioningState returns the provisioning state for the application.

func (*API) SetOperatorStatus

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

SetOperatorStatus sets the status of each given entity.

func (*API) SetProvisioningState

func (a *API) SetProvisioningState(args params.CAASApplicationProvisioningStateArg) (params.ErrorResult, error)

SetProvisioningState sets the provisioning state for the application.

func (*API) Units

func (a *API) Units(args params.Entities) (params.CAASUnitsResults, error)

Units returns all the units for each application specified.

func (*API) UpdateApplicationsUnits

func (a *API) UpdateApplicationsUnits(args params.UpdateApplicationUnitArgs) (params.UpdateApplicationUnitResults, error)

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

func (*API) WatchApplications

func (a *API) WatchApplications() (params.StringsWatchResult, error)

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

func (*API) WatchProvisioningInfo

func (a *API) WatchProvisioningInfo(args params.Entities) (params.NotifyWatchResults, error)

WatchProvisioningInfo provides a watcher for changes that affect the information returned by ProvisioningInfo. This is useful for ensuring the latest application stated is ensured.

func (*API) WatchUnits

func (a *API) WatchUnits(args params.Entities) (params.StringsWatchResults, error)

WatchUnits starts a StringsWatcher to watch changes to the lifecycle states of units for the specified applications in this model.

type APIGroup

type APIGroup struct {
	*common.PasswordChanger
	*common.LifeGetter
	*common.AgentEntityWatcher
	*common.Remover

	*API
	// contains filtered or unexported fields
}

func NewStateCAASApplicationProvisionerAPI

func NewStateCAASApplicationProvisionerAPI(ctx facade.Context) (*APIGroup, error)

NewStateCAASApplicationProvisionerAPI provides the signature required for facade registration.

func (*APIGroup) ApplicationCharmInfo

func (a *APIGroup) ApplicationCharmInfo(args params.Entity) (params.Charm, error)

ApplicationCharmInfo returns information about an application's charm.

func (*APIGroup) CharmInfo

func (a *APIGroup) CharmInfo(args params.CharmURL) (params.Charm, error)

CharmInfo returns information about the requested charm.

type Application

type Application interface {
	Charm() (ch Charm, force bool, err error)
	CharmPendingToBeDownloaded() bool
	SetOperatorStatus(status.StatusInfo) error
	AllUnits() ([]Unit, error)
	UpdateUnits(unitsOp *state.UpdateUnitsOperation) error
	StorageConstraints() (map[string]state.StorageConstraints, error)
	DeviceConstraints() (map[string]state.DeviceConstraints, error)
	Name() string
	Constraints() (constraints.Value, error)
	Life() state.Life
	Base() state.Base
	SetStatus(statusInfo status.StatusInfo) error
	CharmModifiedVersion() int
	CharmURL() (curl *string, force bool)
	ApplicationConfig() (coreconfig.ConfigAttributes, error)
	GetScale() int
	ClearResources() error
	Watch() state.NotifyWatcher
	WatchUnits() state.StringsWatcher
	ProvisioningState() *state.ApplicationProvisioningState
	SetProvisioningState(state.ApplicationProvisioningState) error
}

type CAASApplicationControllerState

type CAASApplicationControllerState interface {
	ControllerConfig() (controller.Config, error)
	Addresses() ([]string, error)
	ModelUUID() string
	APIHostPortsForAgents() ([]network.SpaceHostPorts, error)
	WatchAPIHostPortsForAgents() state.NotifyWatcher
	WatchControllerConfig() state.NotifyWatcher
}

CAASApplicationControllerState provides the subset of controller state required by the CAAS operator provisioner facade.

type CAASApplicationProvisionerState

type CAASApplicationProvisionerState interface {
	ApplyOperation(state.ModelOperation) error
	Model() (Model, error)
	Application(string) (Application, error)
	ResolveConstraints(cons constraints.Value) (constraints.Value, error)
	Resources() Resources
	Unit(string) (Unit, error)
	WatchApplications() state.StringsWatcher
	IsController() bool
}

CAASApplicationProvisionerState provides the subset of model state required by the CAAS operator provisioner facade.

type Charm

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

type Model

type Model interface {
	UUID() string
	ModelConfig() (*config.Config, error)
	Containers(providerIds ...string) ([]state.CloudContainer, error)
	WatchForModelConfigChanges() state.NotifyWatcher
}

type NewResourceOpenerFunc

type NewResourceOpenerFunc func(appName string) (resources.Opener, error)

type Resources

type Resources interface {
	OpenResource(applicationID string, name string) (resources.Resource, io.ReadCloser, error)
}

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 app provisioner facade.

type Unit

type Unit interface {
	Tag() names.Tag
	DestroyOperation() *state.DestroyUnitOperation
	EnsureDead() error
	ContainerInfo() (state.CloudContainer, error)
	UpdateOperation(props state.UnitUpdateProperties) *state.UpdateUnitOperation
	Status() (status.StatusInfo, error)
}

Jump to

Keyboard shortcuts

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