Documentation
¶
Index ¶
- type State
- func (st *State) CheckFilesystemForIDExists(ctx context.Context, fsID string) (bool, error)
- func (st *State) CheckMachineIsDead(ctx context.Context, uuid coremachine.UUID) (bool, error)
- func (st *State) CheckVolumeForIDExists(ctx context.Context, volID string) (bool, error)
- func (st *State) CreateVolumeAttachmentPlan(ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, ...) error
- func (st *State) GetBlockDeviceForVolumeAttachment(ctx context.Context, uuid domainstorage.VolumeAttachmentUUID) (domainblockdevice.BlockDeviceUUID, error)
- func (st *State) GetContainerMountsForApplication(ctx context.Context, appUUID coreapplication.UUID) (map[string][]internal.ContainerMount, error)
- func (st *State) GetFilesystem(ctx context.Context, uuid domainstorage.FilesystemUUID) (storageprovisioning.Filesystem, error)
- func (st *State) GetFilesystemAttachment(ctx context.Context, uuid domainstorage.FilesystemAttachmentUUID) (storageprovisioning.FilesystemAttachment, error)
- func (st *State) GetFilesystemAttachmentIDs(ctx context.Context, uuids []string) (map[string]storageprovisioning.FilesystemAttachmentID, error)
- func (st *State) GetFilesystemAttachmentLife(ctx context.Context, uuid domainstorage.FilesystemAttachmentUUID) (domainlife.Life, error)
- func (st *State) GetFilesystemAttachmentLifeForNetNode(ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID) (map[string]domainlife.Life, error)
- func (st *State) GetFilesystemAttachmentParams(ctx context.Context, uuid domainstorage.FilesystemAttachmentUUID) (storageprovisioning.FilesystemAttachmentParams, error)
- func (st *State) GetFilesystemAttachmentUUIDForFilesystemNetNode(ctx context.Context, fsUUID domainstorage.FilesystemUUID, ...) (domainstorage.FilesystemAttachmentUUID, error)
- func (st *State) GetFilesystemLife(ctx context.Context, uuid domainstorage.FilesystemUUID) (domainlife.Life, error)
- func (st *State) GetFilesystemLifeForNetNode(ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID) (map[string]domainlife.Life, error)
- func (st *State) GetFilesystemParams(ctx context.Context, uuid domainstorage.FilesystemUUID) (storageprovisioning.FilesystemParams, error)
- func (st *State) GetFilesystemRemovalParams(ctx context.Context, uuid domainstorage.FilesystemUUID) (storageprovisioning.FilesystemRemovalParams, error)
- func (st *State) GetFilesystemTemplatesForApplication(ctx context.Context, appUUID coreapplication.UUID) ([]internal.FilesystemTemplate, error)
- func (st *State) GetFilesystemUUIDForID(ctx context.Context, fsID string) (domainstorage.FilesystemUUID, error)
- func (st *State) GetMachineModelProvisionedVolumeAttachmentParams(ctx context.Context, uuid coremachine.UUID) ([]internal.MachineVolumeAttachmentProvisioningParams, error)
- func (st *State) GetMachineModelProvisionedVolumeParams(ctx context.Context, uuid coremachine.UUID) ([]internal.MachineVolumeProvisioningParams, error)
- func (st *State) GetMachineNetNodeUUID(ctx context.Context, uuid coremachine.UUID) (domainnetwork.NetNodeUUID, error)
- func (st *State) GetProvisionedFilesystemAttachmentsForApplication(ctx context.Context, uuid coreapplication.UUID) (map[string][]storageprovisioning.ProvisionedFilesystemAttachment, error)
- func (st *State) GetStorageAttachmentIDsForUnit(ctx context.Context, unitUUID coreunit.UUID) ([]string, error)
- func (st *State) GetStorageAttachmentInfo(ctx context.Context, uuid storage.StorageAttachmentUUID) (storageprovisioning.StorageAttachmentInfo, error)
- func (st *State) GetStorageAttachmentLife(ctx context.Context, unitUUID coreunit.UUID, ...) (domainlife.Life, error)
- func (st *State) GetStorageAttachmentLifeForUnit(ctx context.Context, unitUUID coreunit.UUID) (map[string]domainlife.Life, error)
- func (st *State) GetStorageAttachmentUUIDForUnit(ctx context.Context, storageInstanceID string, unitUUID coreunit.UUID) (storage.StorageAttachmentUUID, error)
- func (st *State) GetStorageInstanceUUIDByID(ctx context.Context, storageIDStr string) (storage.StorageInstanceUUID, error)
- func (st *State) GetStorageResourceTagInfoForApplication(ctx context.Context, appUUID application.UUID, ...) (storageprovisioning.ApplicationResourceTagInfo, error)
- func (st *State) GetStorageResourceTagInfoForModel(ctx context.Context, resourceTagModelConfigKey string) (storageprovisioning.ModelResourceTagInfo, error)
- func (st *State) GetUnitNetNodeUUID(ctx context.Context, uuid coreunit.UUID) (domainnetwork.NetNodeUUID, error)
- func (st *State) GetVolume(ctx context.Context, uuid domainstorage.VolumeUUID) (storageprovisioning.Volume, error)
- func (st *State) GetVolumeAttachment(ctx context.Context, uuid domainstorage.VolumeAttachmentUUID) (storageprovisioning.VolumeAttachment, error)
- func (st *State) GetVolumeAttachmentIDs(ctx context.Context, uuids []string) (map[string]storageprovisioning.VolumeAttachmentID, error)
- func (st *State) GetVolumeAttachmentLife(ctx context.Context, uuid domainstorage.VolumeAttachmentUUID) (domainlife.Life, error)
- func (st *State) GetVolumeAttachmentLifeForNetNode(ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID) (map[string]domainlife.Life, error)
- func (st *State) GetVolumeAttachmentParams(ctx context.Context, uuid domainstorage.VolumeAttachmentUUID) (storageprovisioning.VolumeAttachmentParams, error)
- func (st *State) GetVolumeAttachmentPlan(ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID) (storageprovisioning.VolumeAttachmentPlan, error)
- func (st *State) GetVolumeAttachmentPlanLifeForNetNode(ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID) (map[string]domainlife.Life, error)
- func (st *State) GetVolumeAttachmentPlanUUIDForVolumeNetNode(ctx context.Context, vUUID domainstorage.VolumeUUID, ...) (domainstorage.VolumeAttachmentPlanUUID, error)
- func (st *State) GetVolumeAttachmentUUIDForVolumeNetNode(ctx context.Context, vUUID domainstorage.VolumeUUID, ...) (domainstorage.VolumeAttachmentUUID, error)
- func (st *State) GetVolumeLife(ctx context.Context, uuid domainstorage.VolumeUUID) (domainlife.Life, error)
- func (st *State) GetVolumeLifeForNetNode(ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID) (map[string]domainlife.Life, error)
- func (st *State) GetVolumeParams(ctx context.Context, uuid domainstorage.VolumeUUID) (storageprovisioning.VolumeParams, error)
- func (st *State) GetVolumeRemovalParams(ctx context.Context, uuid domainstorage.VolumeUUID) (storageprovisioning.VolumeRemovalParams, error)
- func (st *State) GetVolumeUUIDForID(ctx context.Context, vID string) (domainstorage.VolumeUUID, error)
- func (st *State) InitialWatchStatementForUnitStorageAttachments(ctx context.Context, unitUUID coreunit.UUID) (string, eventsource.Query[map[string]domainlife.Life])
- func (st *State) InitialWatchStatementMachineProvisionedFilesystemAttachments(netNodeUUID domainnetwork.NetNodeUUID) (string, eventsource.Query[map[string]domainlife.Life])
- func (st *State) InitialWatchStatementMachineProvisionedFilesystems(netNodeUUID domainnetwork.NetNodeUUID) (string, eventsource.Query[map[string]domainlife.Life])
- func (st *State) InitialWatchStatementMachineProvisionedVolumeAttachments(netNodeUUID domainnetwork.NetNodeUUID) (string, eventsource.Query[map[string]domainlife.Life])
- func (st *State) InitialWatchStatementMachineProvisionedVolumes(netNodeUUID domainnetwork.NetNodeUUID) (string, eventsource.Query[map[string]domainlife.Life])
- func (st *State) InitialWatchStatementModelProvisionedFilesystemAttachments() (string, string, eventsource.NamespaceQuery)
- func (st *State) InitialWatchStatementModelProvisionedFilesystems() (string, string, eventsource.NamespaceQuery)
- func (st *State) InitialWatchStatementModelProvisionedVolumeAttachments() (string, eventsource.NamespaceQuery)
- func (st *State) InitialWatchStatementModelProvisionedVolumes() (string, eventsource.NamespaceQuery)
- func (st *State) InitialWatchStatementVolumeAttachmentPlans(netNodeUUID domainnetwork.NetNodeUUID) (string, eventsource.Query[map[string]domainlife.Life])
- func (st *State) NamespaceForStorageAttachment() string
- func (st *State) NamespaceForWatchMachineCloudInstance() string
- func (st *State) SetFilesystemAttachmentProvisionedInfo(ctx context.Context, ...) error
- func (st *State) SetFilesystemProvisionedInfo(ctx context.Context, filesystemUUID domainstorage.FilesystemUUID, ...) error
- func (st *State) SetVolumeAttachmentPlanProvisionedBlockDevice(ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, ...) error
- func (st *State) SetVolumeAttachmentPlanProvisionedInfo(ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, ...) error
- func (st *State) SetVolumeAttachmentProvisionedInfo(ctx context.Context, uuid domainstorage.VolumeAttachmentUUID, ...) error
- func (st *State) SetVolumeProvisionedInfo(ctx context.Context, uuid domainstorage.VolumeUUID, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
func NewState ¶
func NewState( factory coredatabase.TxnRunnerFactory, ) *State
NewState creates and returns a new State for provisioning storage in the model.
func (*State) CheckFilesystemForIDExists ¶
CheckFilesystemForIDExists checks if a filesystem exists for the supplied filesystem id. True is returned when a filesystem exists for the supplied id.
func (*State) CheckMachineIsDead ¶
CheckMachineIsDead checks to see if a machine is not dead returning true when the life of the machine is dead.
The following errors may be returned: - github.com/juju/juju/domain/machine/errors.MachineNotFound when no machine exists for the provided uuid.
func (*State) CheckVolumeForIDExists ¶
CheckVolumeForIDExists checks if a filesystem exists for the supplied volume ID. True is returned when a volume exists for the supplied id.
func (*State) CreateVolumeAttachmentPlan ¶
func (st *State) CreateVolumeAttachmentPlan( ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, attachmentUUID domainstorage.VolumeAttachmentUUID, deviceType domainstorage.VolumeDeviceType, attrs map[string]string, ) error
CreateVolumeAttachmentPlan creates a volume attachment plan for the provided volume attachment uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the provided uuid. - storageprovisioningerrors.VolumeAttachmentPlanAlreadyExists when a volume attachment plan already exists for the given volume attachnment.
func (*State) GetBlockDeviceForVolumeAttachment ¶
func (st *State) GetBlockDeviceForVolumeAttachment( ctx context.Context, uuid domainstorage.VolumeAttachmentUUID, ) (domainblockdevice.BlockDeviceUUID, error)
GetBlockDeviceForVolumeAttachment returns the uuid of the block device set for the specified volume attachment.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the provided uuid. - storageprovisioningerrors.VolumeAttachmentWithoutBlockDevice when the volume attachment does not yet have a block device.
func (*State) GetContainerMountsForApplication ¶
func (st *State) GetContainerMountsForApplication( ctx context.Context, appUUID coreapplication.UUID, ) (map[string][]internal.ContainerMount, error)
GetContainerMountsForApplication returns the map of mount locations for an application. The map entry is keyed by the storage name. An empty map will be returned if there are no records because it is perfectly valid for a workload container to not have a mount point defined.
func (*State) GetFilesystem ¶
func (st *State) GetFilesystem( ctx context.Context, uuid domainstorage.FilesystemUUID, ) (storageprovisioning.Filesystem, error)
GetFilesystem retrieves the [domainstorageprovisioning.Filesystem] for the supplied filesystem uuid.
The following errors may be returned: - storageprovisioningerrors.FilesystemNotFound when no filesystem exists for the provided filesystem uuid.
func (*State) GetFilesystemAttachment ¶
func (st *State) GetFilesystemAttachment( ctx context.Context, uuid domainstorage.FilesystemAttachmentUUID, ) (storageprovisioning.FilesystemAttachment, error)
GetFilesystemAttachment retrieves the [domainstorageprovisioning.FilesystemAttachment] for the supplied filesystem attachment uuid.
The following errors may be returned: - storageprovisioningerrors.FilesystemAttachmentNotFound when no filesystem attachment exists for the provided filesystem attachment uuid.
func (*State) GetFilesystemAttachmentIDs ¶
func (st *State) GetFilesystemAttachmentIDs( ctx context.Context, uuids []string, ) (map[string]storageprovisioning.FilesystemAttachmentID, error)
GetFilesystemAttachmentIDs returns the [domainstorageprovisioning.FilesystemAttachmentID] information for each filesystem attachment uuid supplied. If a uuid does not exist or isn't attached to either a machine or a unit then it will not exist in the result.
It is not considered an error if a filesystem attachment uuid no longer exists as it is expected the caller has already satisfied this requirement themselves.
All returned values will have either the machine name or unit name value filled out in the [domainstorageprovisioning.FilesystemAttachmentID] struct.
func (*State) GetFilesystemAttachmentLife ¶
func (st *State) GetFilesystemAttachmentLife( ctx context.Context, uuid domainstorage.FilesystemAttachmentUUID, ) (domainlife.Life, error)
GetFilesystemAttachmentLife returns the current life value for a filesystem attachment uuid.
The following errors may be returned: - storageprovisioningerrors.FilesystemAttachmentNotFound when no filesystem attachment exists for the provided uuid.
func (*State) GetFilesystemAttachmentLifeForNetNode ¶
func (st *State) GetFilesystemAttachmentLifeForNetNode( ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID, ) (map[string]domainlife.Life, error)
GetFilesystemAttachmentLifeForNetNode returns a mapping of filesystem attachment uuids to the current life value for each machine provisioned filesystem attachment that is to be provisioned by the machine owning the supplied net node.
func (*State) GetFilesystemAttachmentParams ¶
func (st *State) GetFilesystemAttachmentParams( ctx context.Context, uuid domainstorage.FilesystemAttachmentUUID, ) (storageprovisioning.FilesystemAttachmentParams, error)
GetFilesystemAttachmentParams retrieves the attachment params for the given filesystem attachment.
The following errors may be returned: - storageprovisioningerrors.FilesystemAttachmentNotFound when no filesystem attachment exists for the supplied uuid.
func (*State) GetFilesystemAttachmentUUIDForFilesystemNetNode ¶
func (st *State) GetFilesystemAttachmentUUIDForFilesystemNetNode( ctx context.Context, fsUUID domainstorage.FilesystemUUID, nodeUUID domainnetwork.NetNodeUUID, ) (domainstorage.FilesystemAttachmentUUID, error)
GetFilesystemAttachmentUUIDForFilesystemNetNode returns the filesystem attachment uuid for the supplied filesystem uuid which is attached to the given net node uuid.
The following errors may be returned: - storageprovisioningerrors.FilesystemNotFound when no filesystem exists for the supplied uuid. - networkerrors.NetNodeNotFound when no net node exists for the supplied net node uuid. - storageprovisioningerrors.FilesystemAttachmentNotFound when no filesystem attachment exists for the supplied values.
func (*State) GetFilesystemLife ¶
func (st *State) GetFilesystemLife( ctx context.Context, uuid domainstorage.FilesystemUUID, ) (domainlife.Life, error)
GetFilesystemLife returns the current life value for a filesystem uuid.
The following errors may be returned: - storageprovisioningerrors.FilesystemNotFound when no filesystem exists for the provided uuid.
func (*State) GetFilesystemLifeForNetNode ¶
func (st *State) GetFilesystemLifeForNetNode( ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID, ) (map[string]domainlife.Life, error)
GetFilesystemLifeForNetNode returns a mapping of filesystem ids to current life value for each machine provisioned filesystem that is to be provisioned by the machine owning the supplied net node.
func (*State) GetFilesystemParams ¶
func (st *State) GetFilesystemParams( ctx context.Context, uuid domainstorage.FilesystemUUID, ) (storageprovisioning.FilesystemParams, error)
func (*State) GetFilesystemRemovalParams ¶
func (st *State) GetFilesystemRemovalParams( ctx context.Context, uuid domainstorage.FilesystemUUID, ) (storageprovisioning.FilesystemRemovalParams, error)
GetFilesystemRemovalParams returns the parameters needed to remove a filesystem.
The following errors may be returned: - storageprovisioningerrors.FilesystemNotFound when no filesystem exists for the provided uuid.
func (*State) GetFilesystemTemplatesForApplication ¶
func (st *State) GetFilesystemTemplatesForApplication( ctx context.Context, appUUID coreapplication.UUID, ) ([]internal.FilesystemTemplate, error)
GetFilesystemTemplatesForApplication returns all the filesystem templates for a given application.
The following errors may be returned: - applicationerrors.ApplicationNotFound when the application does not exist.
func (*State) GetFilesystemUUIDForID ¶
func (st *State) GetFilesystemUUIDForID( ctx context.Context, fsID string, ) (domainstorage.FilesystemUUID, error)
GetFilesystemUUIDForID returns the uuid for a filesystem with the supplied id.
The following errors may be returned: - storageprovisioningerrors.FilesystemNotFound when no filesystem exists for the provided filesystem id.
func (*State) GetMachineModelProvisionedVolumeAttachmentParams ¶
func (st *State) GetMachineModelProvisionedVolumeAttachmentParams( ctx context.Context, uuid coremachine.UUID, ) ([]internal.MachineVolumeAttachmentProvisioningParams, error)
GetMachineModelProvisionedVolumeAttachmentParams returns the volume attachment parameters for all attachments onto a machine that are provisioned by the model. Should the machine have no volumes that are model provisioned then an empty result is returned.
The following errors may be returned: - domainmachineerrors.MachineNotFound when no machine exists for the uuid.
func (*State) GetMachineModelProvisionedVolumeParams ¶
func (st *State) GetMachineModelProvisionedVolumeParams( ctx context.Context, uuid coremachine.UUID, ) ([]internal.MachineVolumeProvisioningParams, error)
GetMachineModelProvisionedVolumeParams returns the volume parameters for all volumes of a machine that are provisioned by the model. The decision of if a volume in the model is for a machine is made by checking if the volume has an attachment onto the machine. Should the machine have no volumes that are model provisioned then an empty result is returned.
The following errors may be returned: - domainmachineerrors.MachineNotFound when no machine exists for the uuid.
func (*State) GetMachineNetNodeUUID ¶
func (st *State) GetMachineNetNodeUUID( ctx context.Context, uuid coremachine.UUID, ) (domainnetwork.NetNodeUUID, error)
GetMachineNetNodeUUID retrieves the net node uuid associated with provided machine.
The following errors may be returned: - machineerrors.MachineNotFound when no machine exists for the provided uuid.
func (*State) GetProvisionedFilesystemAttachmentsForApplication ¶
func (st *State) GetProvisionedFilesystemAttachmentsForApplication( ctx context.Context, uuid coreapplication.UUID, ) (map[string][]storageprovisioning.ProvisionedFilesystemAttachment, error)
GetProvisionedFilesystemAttachmentsForApplication returns the provisioned filesystem attachments indexed by storage name for the given application UUID. It returns an error satisfying applicationerrors.ApplicationNotFound if the application does not exist.
func (*State) GetStorageAttachmentIDsForUnit ¶
func (st *State) GetStorageAttachmentIDsForUnit( ctx context.Context, unitUUID coreunit.UUID, ) ([]string, error)
GetStorageAttachmentIDsForUnit returns the storage attachment IDs for the given unit UUID.
The following errors may be returned: - applicationerrors.UnitNotFound when no unit exists for the supplied unit UUID.
func (*State) GetStorageAttachmentInfo ¶
func (st *State) GetStorageAttachmentInfo( ctx context.Context, uuid storage.StorageAttachmentUUID, ) (storageprovisioning.StorageAttachmentInfo, error)
GetStorageAttachmentInfo returns information about a storage attachment for the given storage attachment UUID.
The following errors may be returned: - storageprovisioningerrors.StorageAttachmentNotFound when the storage attachment does not exist.
func (*State) GetStorageAttachmentLife ¶
func (st *State) GetStorageAttachmentLife( ctx context.Context, unitUUID coreunit.UUID, storageInstanceUUID storage.StorageInstanceUUID, ) (domainlife.Life, error)
GetStorageAttachmentLife retrieves the life of a storage attachment for a unit and the storage instance.
The following errors may be returned: - applicationerrors.UnitNotFound when no unit exists for the supplied unit UUID. - storageerrors.StorageInstanceNotFound when no storage instance exists for the provided storage instance UUID. - storageerrors.StorageAttachmentNotFound when the storage attachment does not exist for the unit and storage instance.
func (*State) GetStorageAttachmentLifeForUnit ¶
func (st *State) GetStorageAttachmentLifeForUnit( ctx context.Context, unitUUID coreunit.UUID, ) (map[string]domainlife.Life, error)
GetStorageAttachmentLifeForUnit returns a mapping of storage IDs to the current life value of each storage attachment for the unit.
The following errors may be returned: - applicationerrors.UnitNotFound if the unit does not exist.
func (*State) GetStorageAttachmentUUIDForUnit ¶
func (st *State) GetStorageAttachmentUUIDForUnit( ctx context.Context, storageInstanceID string, unitUUID coreunit.UUID, ) (storage.StorageAttachmentUUID, error)
GetStorageAttachmentUUIDForUnit returns the UUID of the storage attachment for a given storage ID and network node UUID.
The following errors may be returned: - storageerrors.StorageInstanceNotFound if the storage instance does not exist for the provided storage ID. - applicationerrors.UnitNotFound if the unit does not exist. - storageerrors.StorageAttachmentNotFound if the storage attachment does not exist.
func (*State) GetStorageInstanceUUIDByID ¶
func (st *State) GetStorageInstanceUUIDByID( ctx context.Context, storageIDStr string, ) (storage.StorageInstanceUUID, error)
GetStorageInstanceUUIDByID retrieves the UUID of a storage instance by its ID.
The following errors may be returned: - storageerrors.StorageInstanceNotFound when no storage instance exists for the provided ID.
func (*State) GetStorageResourceTagInfoForApplication ¶
func (st *State) GetStorageResourceTagInfoForApplication( ctx context.Context, appUUID application.UUID, resourceTagModelConfigKey string, ) (storageprovisioning.ApplicationResourceTagInfo, error)
GetStorageResourceTagInfoForApplication returns information required to build resource tags for storage created for the given application.
The following errors may be returned: - applicationerrors.ApplicationNotFound when no application exists for the supplied uuid.
func (*State) GetStorageResourceTagInfoForModel ¶
func (st *State) GetStorageResourceTagInfoForModel( ctx context.Context, resourceTagModelConfigKey string, ) (storageprovisioning.ModelResourceTagInfo, error)
GetStorageResourceTagInfoForModel retrieves the model based resource tag information for storage entities.
func (*State) GetUnitNetNodeUUID ¶
func (st *State) GetUnitNetNodeUUID( ctx context.Context, uuid coreunit.UUID, ) (domainnetwork.NetNodeUUID, error)
GetUnitNetNodeUUID retrieves the net node uuid associated with provided unit.
The following errors may be returned: - applicationerrors.UnitNotFound when no unit exists for the provided uuid.
func (*State) GetVolume ¶
func (st *State) GetVolume( ctx context.Context, uuid domainstorage.VolumeUUID, ) (storageprovisioning.Volume, error)
GetVolume returns the volume information for the specified volume uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the provided volume uuid.
func (*State) GetVolumeAttachment ¶
func (st *State) GetVolumeAttachment( ctx context.Context, uuid domainstorage.VolumeAttachmentUUID, ) (storageprovisioning.VolumeAttachment, error)
GetVolumeAttachment returns the volume attachment for the supplied volume attachment uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the provided uuid.
func (*State) GetVolumeAttachmentIDs ¶
func (st *State) GetVolumeAttachmentIDs( ctx context.Context, uuids []string, ) (map[string]storageprovisioning.VolumeAttachmentID, error)
GetVolumeAttachmentIDs returns the storageprovisioning.VolumeAttachmentID information for each volume attachment uuid supplied. If a uuid does not exist or isn't attached to either a machine or a unit then it will not exist in the result.
func (*State) GetVolumeAttachmentLife ¶
func (st *State) GetVolumeAttachmentLife( ctx context.Context, uuid domainstorage.VolumeAttachmentUUID, ) (domainlife.Life, error)
GetVolumeAttachmentLife returns the current life value for a volume attachment uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the provided uuid.
func (*State) GetVolumeAttachmentLifeForNetNode ¶
func (st *State) GetVolumeAttachmentLifeForNetNode( ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID, ) (map[string]domainlife.Life, error)
GetVolumeAttachmentLifeForNetNode returns a mapping of volume attachment uuid to the current life value for each machine provisioned volume attachment that is to be provisioned by the machine owning the supplied net node.
func (*State) GetVolumeAttachmentParams ¶
func (st *State) GetVolumeAttachmentParams( ctx context.Context, uuid domainstorage.VolumeAttachmentUUID, ) (storageprovisioning.VolumeAttachmentParams, error)
GetVolumeAttachmentParams retrieves the attachment params for the given volume attachment.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the supplied uuid.
func (*State) GetVolumeAttachmentPlan ¶
func (st *State) GetVolumeAttachmentPlan( ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, ) (storageprovisioning.VolumeAttachmentPlan, error)
GetVolumeAttachmentPlan gets the volume attachment plan for the provided uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotPlanFound when no volume attachment plan exists for the provided uuid.
func (*State) GetVolumeAttachmentPlanLifeForNetNode ¶
func (st *State) GetVolumeAttachmentPlanLifeForNetNode( ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID, ) (map[string]domainlife.Life, error)
GetVolumeAttachmentPlanLifeForNetNode returns a mapping of volume attachment plan volume id to the current life value for each volume attachment plan. The volume id of the attachment plans is returned instead of the uuid because the caller for the watcher works off of this information.
func (*State) GetVolumeAttachmentPlanUUIDForVolumeNetNode ¶
func (st *State) GetVolumeAttachmentPlanUUIDForVolumeNetNode( ctx context.Context, vUUID domainstorage.VolumeUUID, nodeUUID domainnetwork.NetNodeUUID, ) (domainstorage.VolumeAttachmentPlanUUID, error)
GetVolumeAttachmentPlanUUIDForVolumeNetNode returns the volume attachment uuid for the supplied volume uuid which is attached to the given net node uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the supplied uuid. - networkerrors.NetNodeNotFound when no net node exists for the supplied net node uuid. - storageprovisioningerrors.VolumeAttachmentPlanNotFound when no volume attachment plan exists for the supplied values.
func (*State) GetVolumeAttachmentUUIDForVolumeNetNode ¶
func (st *State) GetVolumeAttachmentUUIDForVolumeNetNode( ctx context.Context, vUUID domainstorage.VolumeUUID, nodeUUID domainnetwork.NetNodeUUID, ) (domainstorage.VolumeAttachmentUUID, error)
GetVolumeAttachmentUUIDForVolumeNetNode returns the volume attachment uuid for the supplied volume uuid which is attached to the given net node uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the supplied uuid. - networkerrors.NetNodeNotFound when no net node exists for the supplied net node uuid. - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the supplied values.
func (*State) GetVolumeLife ¶
func (st *State) GetVolumeLife( ctx context.Context, uuid domainstorage.VolumeUUID, ) (domainlife.Life, error)
GetVolumeLife returns the current life value for a volume uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the provided uuid.
func (*State) GetVolumeLifeForNetNode ¶
func (st *State) GetVolumeLifeForNetNode( ctx context.Context, netNodeUUID domainnetwork.NetNodeUUID, ) (map[string]domainlife.Life, error)
GetVolumeLifeForNetNode returns a mapping of volume id to current life value for each machine provisioned volume that is to be provisioned by the machine owning the supplied net node.
func (*State) GetVolumeParams ¶
func (st *State) GetVolumeParams( ctx context.Context, uuid domainstorage.VolumeUUID, ) (storageprovisioning.VolumeParams, error)
GetVolumeParams returns the volume params for the supplied uuid.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the uuid.
func (*State) GetVolumeRemovalParams ¶
func (st *State) GetVolumeRemovalParams( ctx context.Context, uuid domainstorage.VolumeUUID, ) (storageprovisioning.VolumeRemovalParams, error)
GetVolumeRemovalParams returns the parameters needed to removal a volume.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the uuid.
func (*State) GetVolumeUUIDForID ¶
func (st *State) GetVolumeUUIDForID( ctx context.Context, vID string, ) (domainstorage.VolumeUUID, error)
GetVolumeUUIDForID returns the uuid for a volume with the supplied id.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the provided volume uuid.
func (*State) InitialWatchStatementForUnitStorageAttachments ¶
func (st *State) InitialWatchStatementForUnitStorageAttachments( ctx context.Context, unitUUID coreunit.UUID, ) (string, eventsource.Query[map[string]domainlife.Life])
InitialWatchStatementForUnitStorageAttachments returns the initial watch statement for unit storage attachments.
func (*State) InitialWatchStatementMachineProvisionedFilesystemAttachments ¶
func (st *State) InitialWatchStatementMachineProvisionedFilesystemAttachments( netNodeUUID domainnetwork.NetNodeUUID, ) (string, eventsource.Query[map[string]domainlife.Life])
InitialWatchStatementMachineProvisionedFilesystemAttachments returns both the namespace for watching filesystem attachment life changes where the filesystem attachment is machine provisioned and the initial query for getting the current set of machine provisioned filesystem attachments.
Only filesystem attachments that can be provisioned by the machine connected to the supplied net node will be emitted.
func (*State) InitialWatchStatementMachineProvisionedFilesystems ¶
func (st *State) InitialWatchStatementMachineProvisionedFilesystems( netNodeUUID domainnetwork.NetNodeUUID, ) (string, eventsource.Query[map[string]domainlife.Life])
InitialWatchStatementMachineProvisionedFilesystems returns both the namespace for watching filesystem life changes where the filesystem is machine provisioned. On top of this the initial query for getting all filesystems in the model that are machine provisioned is returned.
Only filesystems that can be provisioned by the machine connected to the supplied net node will be emitted.
func (*State) InitialWatchStatementMachineProvisionedVolumeAttachments ¶
func (st *State) InitialWatchStatementMachineProvisionedVolumeAttachments( netNodeUUID domainnetwork.NetNodeUUID, ) (string, eventsource.Query[map[string]domainlife.Life])
InitialWatchStatementMachineProvisionedVolumeAttachments returns both the namespace for watching volume attachment life changes where the volume attachment is machine provisioned. On top of this the initial query for getting all volume attachments in the model that are machine provisioned is returned.
Only volume attachments that can be provisioned by the machine connected to the supplied net node will be emitted.
func (*State) InitialWatchStatementMachineProvisionedVolumes ¶
func (st *State) InitialWatchStatementMachineProvisionedVolumes( netNodeUUID domainnetwork.NetNodeUUID, ) (string, eventsource.Query[map[string]domainlife.Life])
InitialWatchStatementMachineProvisionedVolumes returns both the namespace for watching volume life changes where the volume is machine provisioned. On top of this the initial query for getting all volumes in the model that are machine provisioned is returned.
Only volumes that can be provisioned by the machine connected to the supplied net node will be emitted.
func (*State) InitialWatchStatementModelProvisionedFilesystemAttachments ¶
func (st *State) InitialWatchStatementModelProvisionedFilesystemAttachments() (string, string, eventsource.NamespaceQuery)
InitialWatchStatementModelProvisionedFilesystemAttachments returns both the namespace for watching filesystem life changes where the filesystem is model provisioned. On top of this the initial query for getting all filesystems in the model that model provisioned is returned.
func (*State) InitialWatchStatementModelProvisionedFilesystems ¶
func (st *State) InitialWatchStatementModelProvisionedFilesystems() (string, string, eventsource.NamespaceQuery)
InitialWatchStatementModelProvisionedFilesystems returns both the namespace for watching filesystem life changes where the filesystem is model provisioned. On top of this the initial query for getting all filesystems in the model that model provisioned is returned.
func (*State) InitialWatchStatementModelProvisionedVolumeAttachments ¶
func (st *State) InitialWatchStatementModelProvisionedVolumeAttachments() ( string, eventsource.NamespaceQuery, )
InitialWatchStatementModelProvisionedVolumeAttachments returns both the namespace for watching volume attachment life changes where the volume attachment is model provisioned. On top of this the initial query for getting all volume attachments in the model that are model provisioned is returned.
func (*State) InitialWatchStatementModelProvisionedVolumes ¶
func (st *State) InitialWatchStatementModelProvisionedVolumes() (string, eventsource.NamespaceQuery)
InitialWatchStatementModelProvisionedVolumes returns both the namespace for watching volume life changes where the volume is model provisioned. On top of this the initial query for getting all volumes in the model that are model provisioned is returned.
func (*State) InitialWatchStatementVolumeAttachmentPlans ¶
func (st *State) InitialWatchStatementVolumeAttachmentPlans( netNodeUUID domainnetwork.NetNodeUUID, ) (string, eventsource.Query[map[string]domainlife.Life])
InitialWatchStatementVolumeAttachmentPlans returns both the namespace for watching volume attachment plan life changes. On top of this the initial query for getting all volume attachment plan volume ids in the model that are for the given net node uuid.
func (*State) NamespaceForStorageAttachment ¶
NamespaceForStorageAttachment returns the change stream namespace for watching storage attachment changes.
func (*State) NamespaceForWatchMachineCloudInstance ¶
func (*State) SetFilesystemAttachmentProvisionedInfo ¶
func (st *State) SetFilesystemAttachmentProvisionedInfo( ctx context.Context, filesystemAttachmentUUID domainstorage.FilesystemAttachmentUUID, info storageprovisioning.FilesystemAttachmentProvisionedInfo, ) error
SetFilesystemAttachmentProvisionedInfo sets on the provided filesystem attachment information about the provisioned filesystem attachment.
func (*State) SetFilesystemProvisionedInfo ¶
func (st *State) SetFilesystemProvisionedInfo( ctx context.Context, filesystemUUID domainstorage.FilesystemUUID, info storageprovisioning.FilesystemProvisionedInfo, ) error
SetFilesystemProvisionedInfo sets on the provided filesystem the information about the provisioned filesystem.
func (*State) SetVolumeAttachmentPlanProvisionedBlockDevice ¶
func (st *State) SetVolumeAttachmentPlanProvisionedBlockDevice( ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, blockDeviceUUID domainblockdevice.BlockDeviceUUID, ) error
SetVolumeAttachmentPlanProvisionedBlockDevice sets on the provided volume attachment plan the information about the provisioned block device.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentPlanNotFound when no volume attachment plan exists for the provided uuid. - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the provided attachment plan. - blockdeviceerrors.BlockDeviceNotFound when no block device exists for the provided block device uuid.
func (*State) SetVolumeAttachmentPlanProvisionedInfo ¶
func (st *State) SetVolumeAttachmentPlanProvisionedInfo( ctx context.Context, uuid domainstorage.VolumeAttachmentPlanUUID, info storageprovisioning.VolumeAttachmentPlanProvisionedInfo, ) error
SetVolumeAttachmentPlanProvisionedInfo sets on the provided volume attachment plan information.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentPlanNotFound when no volume attachment plan exists for the provided uuid.
func (*State) SetVolumeAttachmentProvisionedInfo ¶
func (st *State) SetVolumeAttachmentProvisionedInfo( ctx context.Context, uuid domainstorage.VolumeAttachmentUUID, info storageprovisioning.VolumeAttachmentProvisionedInfo, ) error
SetVolumeAttachmentProvisionedInfo sets on the provided volume the information about the provisioned volume attachment.
The following errors may be returned: - storageprovisioningerrors.VolumeAttachmentNotFound when no volume attachment exists for the provided volume attachment uuid. - blockdeviceerrors.BlockDeviceNotFound when no block device exists for a given block device uuid.
func (*State) SetVolumeProvisionedInfo ¶
func (st *State) SetVolumeProvisionedInfo( ctx context.Context, uuid domainstorage.VolumeUUID, info storageprovisioning.VolumeProvisionedInfo, ) error
SetVolumeProvisionedInfo sets the provisioned information for the given volume.
The following errors may be returned: - storageprovisioningerrors.VolumeNotFound when no volume exists for the provided volume uuid.