storageprovisioner

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStateBackends

func NewStateBackends(st *state.State) (Backend, StorageBackend, error)

NewStateBackends creates a Backend from the given *state.State.

func Register

func Register(registry facade.FacadeRegistry)

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

Types

type Backend

type Backend interface {
	state.EntityFinder

	WatchMachine(names.MachineTag) (state.NotifyWatcher, error)
	WatchApplications() state.StringsWatcher
}

type BlockDeviceService

type BlockDeviceService interface {
	// BlockDevices returns the block devices for a specified machine.
	BlockDevices(ctx context.Context, machineId string) ([]blockdevice.BlockDevice, error)
	// WatchBlockDevices returns a new NotifyWatcher watching for
	// changes to block devices associated with the specified machine.
	WatchBlockDevices(ctx context.Context, machineId string) (watcher.NotifyWatcher, error)
}

BlockDeviceService instances can fetch and watch block devices on a machine.

type ControllerConfigService

type ControllerConfigService interface {
	// ControllerConfig returns the config values for the controller.
	ControllerConfig(context.Context) (controller.Config, error)
}

ControllerConfigService provides access to the controller configuration.

type MachineService

type MachineService interface {
	// EnsureDeadMachine sets the provided machine's life status to Dead.
	// No error is returned if the provided machine doesn't exist, just nothing
	// gets updated.
	EnsureDeadMachine(ctx context.Context, machineName machine.Name) error
	// GetMachineUUID returns the UUID of a machine identified by its name.
	GetMachineUUID(ctx context.Context, name machine.Name) (string, error)
	// InstanceID returns the cloud specific instance id for this machine.
	InstanceID(ctx context.Context, mUUID string) (instance.Id, error)
	// InstanceIDAndName returns the cloud specific instance ID and display name for
	// this machine.
	InstanceIDAndName(ctx context.Context, machineUUID string) (instance.Id, string, error)
	// HardwareCharacteristics returns the hardware characteristics of the
	// specified machine.
	HardwareCharacteristics(ctx context.Context, machineUUID string) (*instance.HardwareCharacteristics, error)
}

MachineService defines the methods that the facade assumes from the Machine service.

type ModelConfigService

type ModelConfigService interface {
	// ModelConfig returns the current config for the model.
	ModelConfig(context.Context) (*config.Config, error)
}

ModelConfigService is the interface that the provisioner facade uses to get the model config.

type StorageBackend

type StorageBackend interface {
	WatchModelFilesystems() state.StringsWatcher
	WatchModelFilesystemAttachments() state.StringsWatcher
	WatchMachineFilesystems(names.MachineTag) state.StringsWatcher
	WatchUnitFilesystems(tag names.ApplicationTag) state.StringsWatcher
	WatchMachineFilesystemAttachments(names.MachineTag) state.StringsWatcher
	WatchUnitFilesystemAttachments(tag names.ApplicationTag) state.StringsWatcher
	WatchModelVolumes() state.StringsWatcher
	WatchModelVolumeAttachments() state.StringsWatcher
	WatchMachineVolumes(names.MachineTag) state.StringsWatcher
	WatchMachineVolumeAttachments(names.MachineTag) state.StringsWatcher
	WatchUnitVolumeAttachments(tag names.ApplicationTag) state.StringsWatcher
	WatchVolumeAttachment(names.Tag, names.VolumeTag) state.NotifyWatcher
	WatchMachineAttachmentsPlans(names.MachineTag) state.StringsWatcher

	StorageInstance(names.StorageTag) (state.StorageInstance, error)
	AllStorageInstances() ([]state.StorageInstance, error)
	StorageInstanceVolume(names.StorageTag) (state.Volume, error)
	StorageInstanceFilesystem(names.StorageTag) (state.Filesystem, error)
	ReleaseStorageInstance(names.StorageTag, bool, bool, time.Duration) error
	DetachStorage(names.StorageTag, names.UnitTag, bool, time.Duration) error

	Filesystem(names.FilesystemTag) (state.Filesystem, error)
	FilesystemAttachment(names.Tag, names.FilesystemTag) (state.FilesystemAttachment, error)

	Volume(names.VolumeTag) (state.Volume, error)
	VolumeAttachment(names.Tag, names.VolumeTag) (state.VolumeAttachment, error)
	VolumeAttachments(names.VolumeTag) ([]state.VolumeAttachment, error)
	VolumeAttachmentPlan(names.Tag, names.VolumeTag) (state.VolumeAttachmentPlan, error)
	VolumeAttachmentPlans(volume names.VolumeTag) ([]state.VolumeAttachmentPlan, error)

	RemoveFilesystem(names.FilesystemTag) error
	RemoveFilesystemAttachment(names.Tag, names.FilesystemTag, bool) error
	RemoveVolume(names.VolumeTag) error
	RemoveVolumeAttachment(names.Tag, names.VolumeTag, bool) error
	DetachFilesystem(names.Tag, names.FilesystemTag) error
	DestroyFilesystem(names.FilesystemTag, bool) error
	DetachVolume(names.Tag, names.VolumeTag, bool) error
	DestroyVolume(names.VolumeTag, bool) error

	SetFilesystemInfo(names.FilesystemTag, state.FilesystemInfo) error
	SetFilesystemAttachmentInfo(names.Tag, names.FilesystemTag, state.FilesystemAttachmentInfo) error
	SetVolumeInfo(names.VolumeTag, state.VolumeInfo) error
	SetVolumeAttachmentInfo(names.Tag, names.VolumeTag, state.VolumeAttachmentInfo) error

	CreateVolumeAttachmentPlan(names.Tag, names.VolumeTag, state.VolumeAttachmentPlanInfo) error
	RemoveVolumeAttachmentPlan(names.Tag, names.VolumeTag, bool) error
	SetVolumeAttachmentPlanBlockInfo(machineTag names.Tag, volumeTag names.VolumeTag, info state.BlockDeviceInfo) error
}

type StoragePoolGetter

type StoragePoolGetter interface {
	// GetStoragePoolByName returns the storage pool with the specified name.
	GetStoragePoolByName(ctx context.Context, name string) (*storage.Config, error)
}

StoragePoolGetter instances get a storage pool by name.

type StorageProvisionerAPIv4

type StorageProvisionerAPIv4 struct {
	*common.LifeGetter
	*common.DeadEnsurer
	*common.InstanceIdGetter
	*common.StatusSetter
	// contains filtered or unexported fields
}

StorageProvisionerAPIv4 provides the StorageProvisioner API v4 facade.

func NewStorageProvisionerAPIv4

func NewStorageProvisionerAPIv4(
	ctx context.Context,
	watcherRegistry facade.WatcherRegistry,
	st Backend,
	sb StorageBackend,
	blockDeviceService BlockDeviceService,
	modelConfigService ModelConfigService,
	machineService MachineService,
	resources facade.Resources,
	authorizer facade.Authorizer,
	registry storage.ProviderRegistry,
	storagePoolGetter StoragePoolGetter,
	logger logger.Logger,
	modelUUID model.UUID,
	controllerUUID string,
) (*StorageProvisionerAPIv4, error)

NewStorageProvisionerAPIv4 creates a new server-side StorageProvisioner v3 facade.

func (*StorageProvisionerAPIv4) AttachmentLife

AttachmentLife returns the lifecycle state of each specified machine storage attachment.

func (*StorageProvisionerAPIv4) CreateVolumeAttachmentPlans

func (s *StorageProvisionerAPIv4) CreateVolumeAttachmentPlans(ctx context.Context, args params.VolumeAttachmentPlans) (params.ErrorResults, error)

func (*StorageProvisionerAPIv4) FilesystemAttachmentParams

FilesystemAttachmentParams returns the parameters for creating the filesystem attachments with the specified IDs.

func (*StorageProvisionerAPIv4) FilesystemAttachments

FilesystemAttachments returns details of filesystem attachments with the specified IDs.

func (*StorageProvisionerAPIv4) FilesystemParams

FilesystemParams returns the parameters for creating the filesystems with the specified tags.

func (*StorageProvisionerAPIv4) Filesystems

Filesystems returns details of filesystems with the specified tags.

func (*StorageProvisionerAPIv4) Remove

Remove removes volumes and filesystems from state.

func (*StorageProvisionerAPIv4) RemoveAttachment

RemoveAttachment removes the specified machine storage attachments from state.

func (*StorageProvisionerAPIv4) RemoveFilesystemParams

RemoveFilesystemParams returns the parameters for destroying or releasing the filesystems with the specified tags.

func (*StorageProvisionerAPIv4) RemoveVolumeAttachmentPlan

func (s *StorageProvisionerAPIv4) RemoveVolumeAttachmentPlan(ctx context.Context, args params.MachineStorageIds) (params.ErrorResults, error)

func (*StorageProvisionerAPIv4) RemoveVolumeParams

RemoveVolumeParams returns the parameters for destroying or releasing the volumes with the specified tags.

func (*StorageProvisionerAPIv4) SetFilesystemAttachmentInfo

func (s *StorageProvisionerAPIv4) SetFilesystemAttachmentInfo(
	ctx context.Context,
	args params.FilesystemAttachments,
) (params.ErrorResults, error)

SetFilesystemAttachmentInfo records the details of newly provisioned filesystem attachments.

func (*StorageProvisionerAPIv4) SetFilesystemInfo

SetFilesystemInfo records the details of newly provisioned filesystems.

func (*StorageProvisionerAPIv4) SetVolumeAttachmentInfo

func (s *StorageProvisionerAPIv4) SetVolumeAttachmentInfo(
	ctx context.Context,
	args params.VolumeAttachments,
) (params.ErrorResults, error)

SetVolumeAttachmentInfo records the details of newly provisioned volume attachments.

func (*StorageProvisionerAPIv4) SetVolumeAttachmentPlanBlockInfo

func (s *StorageProvisionerAPIv4) SetVolumeAttachmentPlanBlockInfo(ctx context.Context, args params.VolumeAttachmentPlans) (params.ErrorResults, error)

func (*StorageProvisionerAPIv4) SetVolumeInfo

func (s *StorageProvisionerAPIv4) SetVolumeInfo(args params.Volumes) (params.ErrorResults, error)

SetVolumeInfo records the details of newly provisioned volumes.

func (*StorageProvisionerAPIv4) VolumeAttachmentParams

VolumeAttachmentParams returns the parameters for creating the volume attachments with the specified IDs.

func (*StorageProvisionerAPIv4) VolumeAttachmentPlans

VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs.

func (*StorageProvisionerAPIv4) VolumeAttachments

VolumeAttachments returns details of volume attachments with the specified IDs.

func (*StorageProvisionerAPIv4) VolumeBlockDevices

VolumeBlockDevices returns details of the block devices corresponding to the volume attachments with the specified IDs.

func (*StorageProvisionerAPIv4) VolumeParams

VolumeParams returns the parameters for creating or destroying the volumes with the specified tags.

func (*StorageProvisionerAPIv4) Volumes

Volumes returns details of volumes with the specified tags.

func (*StorageProvisionerAPIv4) WatchApplications

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

func (*StorageProvisionerAPIv4) WatchBlockDevices

WatchBlockDevices watches for changes to the specified machines' block devices.

func (*StorageProvisionerAPIv4) WatchFilesystemAttachments

WatchFilesystemAttachments watches for changes to filesystem attachments scoped to the entity with the tag passed to NewState.

func (*StorageProvisionerAPIv4) WatchFilesystems

WatchFilesystems watches for changes to filesystems scoped to the entity with the tag passed to NewState.

func (*StorageProvisionerAPIv4) WatchMachines

WatchMachines watches for changes to the specified machines.

func (*StorageProvisionerAPIv4) WatchVolumeAttachmentPlans

WatchVolumeAttachmentPlans watches for changes to volume attachments for a machine for the purpose of allowing that machine to run any initialization needed, for that volume to actually appear as a block device (ie: iSCSI)

func (*StorageProvisionerAPIv4) WatchVolumeAttachments

WatchVolumeAttachments watches for changes to volume attachments scoped to the entity with the tag passed to NewState.

func (*StorageProvisionerAPIv4) WatchVolumes

WatchVolumes watches for changes to volumes scoped to the entity with the tag passed to NewState.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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