state

package
v0.0.0-...-1f8c1e5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 47 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValue

type KeyValue struct {
	Key   string `db:"key"`
	Value string `db:"value"`
}

type State

type State struct {
	*domain.StateBase
	// contains filtered or unexported fields
}

func NewState

func NewState(factory database.TxnRunnerFactory, clock clock.Clock, logger logger.Logger) *State

NewState returns a new state reference.

func (*State) AddStorageForUnit

func (st *State) AddStorageForUnit(ctx context.Context, storageName corestorage.Name, unitUUID coreunit.UUID, stor storage.Directive) ([]corestorage.ID, error)

func (*State) AddUnits

func (st *State) AddUnits(ctx context.Context, appUUID coreapplication.ID, args []application.AddUnitArg) error

AddUnits adds the specified units to the application.

func (*State) AttachStorage

func (st *State) AttachStorage(ctx context.Context, storageUUID corestorage.UUID, unitUUID coreunit.UUID) error

func (*State) CreateApplication

func (st *State) CreateApplication(
	ctx context.Context,
	name string,
	args application.AddApplicationArg,
	units []application.AddUnitArg,
) (coreapplication.ID, error)

CreateApplication creates an application, returning an error satisfying applicationerrors.ApplicationAlreadyExists if the application already exists. It returns as error satisfying applicationerrors.CharmNotFound if the charm for the application is not found.

func (*State) DeleteApplication

func (st *State) DeleteApplication(ctx context.Context, name string) error

DeleteApplication deletes the specified application, returning an error satisfying applicationerrors.ApplicationNotFoundError if the application doesn't exist. If the application still has units, as error satisfying applicationerrors.ApplicationHasUnits is returned.

func (*State) DeleteCharm

func (s *State) DeleteCharm(ctx context.Context, id corecharm.ID) error

DeleteCharm removes the charm from the state. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) DeleteUnit

func (st *State) DeleteUnit(ctx context.Context, unitName coreunit.Name) (bool, error)

DeleteUnit deletes the specified unit. If the unit's application is Dying and no other references to it exist, true is returned to indicate the application could be safely deleted. It will fail if the unit is not Dead.

func (*State) DetachStorage

func (st *State) DetachStorage(ctx context.Context, storageUUID corestorage.UUID) error

func (*State) DetachStorageForUnit

func (st *State) DetachStorageForUnit(ctx context.Context, storageUUID corestorage.UUID, unitUUID coreunit.UUID) error

func (*State) GetApplicationConfigAndSettings

func (st *State) GetApplicationConfigAndSettings(ctx context.Context, appID coreapplication.ID) (map[string]application.ApplicationConfig, application.ApplicationSettings, error)

GetApplicationConfigAndSettings returns the application config and settings attributes for the application ID.

If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) GetApplicationConfigHash

func (st *State) GetApplicationConfigHash(ctx context.Context, appID coreapplication.ID) (string, error)

GetApplicationConfigHash returns the SHA256 hash of the application config for the specified application ID. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) GetApplicationConstraints

func (st *State) GetApplicationConstraints(ctx context.Context, appID coreapplication.ID) (constraints.Constraints, error)

GetApplicationConstraints returns the application constraints for the specified application ID. Empty constraints are returned if no constraints exist for the given application ID. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) GetApplicationIDAndNameByUnitName

func (st *State) GetApplicationIDAndNameByUnitName(
	ctx context.Context,
	name coreunit.Name,
) (coreapplication.ID, string, error)

GetApplicationIDAndNameByUnitName returns the application ID and name for the named unit.

Returns an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist.

func (*State) GetApplicationIDByName

func (st *State) GetApplicationIDByName(ctx context.Context, name string) (coreapplication.ID, error)

GetApplicationIDByName returns the application ID for the named application. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) GetApplicationIDByUnitName

func (st *State) GetApplicationIDByUnitName(
	ctx context.Context,
	name coreunit.Name,
) (coreapplication.ID, error)

GetApplicationIDByUnitName returns the application ID for the named unit.

Returns an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist.

func (*State) GetApplicationLife

func (st *State) GetApplicationLife(ctx context.Context, appName string) (coreapplication.ID, life.Life, error)

GetApplicationLife looks up the life of the specified application, returning an error satisfying applicationerrors.ApplicationNotFoundError if the application is not found.

func (*State) GetApplicationScaleState

func (st *State) GetApplicationScaleState(ctx context.Context, appUUID coreapplication.ID) (application.ScaleState, error)

GetApplicationScaleState looks up the scale state of the specified application, returning an error satisfying applicationerrors.ApplicationNotFound if the application is not found.

func (*State) GetApplicationStatus

GetApplicationStatus looks up the status of the specified application, returning an error satisfying applicationerrors.ApplicationNotFound if the application is not found.

func (*State) GetApplicationTrustSetting

func (st *State) GetApplicationTrustSetting(ctx context.Context, appID coreapplication.ID) (bool, error)

GetApplicationTrustSetting returns the application trust setting. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) GetApplicationUnitLife

func (st *State) GetApplicationUnitLife(ctx context.Context, appName string, ids ...coreunit.UUID) (map[coreunit.UUID]life.Life, error)

GetApplicationUnitLife returns the life values for the specified units of the given application. The supplied ids may belong to a different application; the application name is used to filter.

func (*State) GetApplicationsForRevisionUpdater

func (st *State) GetApplicationsForRevisionUpdater(ctx context.Context) ([]application.RevisionUpdaterApplication, error)

GetApplicationsForRevisionUpdater returns all the applications for the revision updater. This will only return charmhub charms, for applications that are alive. This will return an empty slice if there are no applications.

func (*State) GetApplicationsWithPendingCharmsFromUUIDs

func (st *State) GetApplicationsWithPendingCharmsFromUUIDs(ctx context.Context, uuids []coreapplication.ID) ([]coreapplication.ID, error)

GetApplicationsWithPendingCharmsFromUUIDs returns the application IDs for the applications with pending charms from the specified UUIDs.

func (*State) GetAsyncCharmDownloadInfo

func (st *State) GetAsyncCharmDownloadInfo(ctx context.Context, appID coreapplication.ID) (application.CharmDownloadInfo, error)

GetAsyncCharmDownloadInfo gets the charm download for the specified application, returning an error satisfying applicationerrors.CharmAlreadyAvailable if the application is already downloading a charm, or applicationerrors.ApplicationNotFound if the application is not found.

func (*State) GetAvailableCharmArchiveSHA256

func (s *State) GetAvailableCharmArchiveSHA256(ctx context.Context, id corecharm.ID) (string, error)

GetAvailableCharmArchiveSHA256 returns the SHA256 hash of the charm archive for the given charm id. If the charm is not available, applicationerrors.CharmNotResolved is returned. Returns applicationerrors.CharmNotFound if the charm is not found.

func (*State) GetCharm

func (s *State) GetCharm(ctx context.Context, id corecharm.ID) (charm.Charm, *charm.DownloadInfo, error)

GetCharm returns the charm using the charm ID. DownloadInfo is optional, and is only returned for charms from a charm store. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmActions

func (s *State) GetCharmActions(ctx context.Context, id corecharm.ID) (charm.Actions, error)

GetCharmActions returns the actions for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmArchiveMetadata

func (s *State) GetCharmArchiveMetadata(ctx context.Context, id corecharm.ID) (archivePath string, hash string, err error)

GetCharmArchiveMetadata returns the archive storage path and the sha256 hash for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmArchivePath

func (s *State) GetCharmArchivePath(ctx context.Context, id corecharm.ID) (string, error)

GetCharmArchivePath returns the archive storage path for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmByApplicationID

func (st *State) GetCharmByApplicationID(ctx context.Context, appUUID coreapplication.ID) (charm.Charm, error)

GetCharmByApplicationID returns the charm for the specified application ID. This method should be used sparingly, as it is not efficient. It should be only used when you need the whole charm, otherwise use the more specific methods.

If the application does not exist, an error satisfying applicationerrors.ApplicationNotFoundError is returned. If the charm for the application does not exist, an error satisfying applicationerrors.CharmNotFoundError is returned.

func (*State) GetCharmConfig

func (s *State) GetCharmConfig(ctx context.Context, id corecharm.ID) (charm.Config, error)

GetCharmConfig returns the config for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmConfigByApplicationID

func (st *State) GetCharmConfigByApplicationID(ctx context.Context, appID coreapplication.ID) (corecharm.ID, charm.Config, error)

GetCharmConfigByApplicationID returns the charm config for the specified application ID. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned. If the charm for the application does not exist, an error satisfying applicationerrors.CharmNotFoundError is returned.

func (*State) GetCharmDownloadInfo

func (s *State) GetCharmDownloadInfo(ctx context.Context, id corecharm.ID) (*charm.DownloadInfo, error)

GetCharmDownloadInfo returns the download info for the charm using the charm ID. Returns applicationerrors.CharmNotFound if the charm is not found.

func (*State) GetCharmID

func (s *State) GetCharmID(ctx context.Context, name string, revision int, source charm.CharmSource) (corecharm.ID, error)

GetCharmID returns the charm ID by the natural key, for a specific revision and source. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmIDByApplicationName

func (st *State) GetCharmIDByApplicationName(ctx context.Context, name string) (corecharm.ID, error)

GetCharmIDByApplicationName returns a charm ID by application name. It returns an error if the charm can not be found by the name. This can also be used as a cheap way to see if a charm exists without needing to load the charm metadata.

Returns applicationerrors.ApplicationNameNotValid if the name is not valid, applicationerrors.ApplicationNotFound if the application is not found, and applicationerrors.CharmNotFound if the charm is not found.

func (*State) GetCharmLXDProfile

func (s *State) GetCharmLXDProfile(ctx context.Context, id corecharm.ID) ([]byte, charm.Revision, error)

GetCharmLXDProfile returns the LXD profile for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmLocatorByCharmID

func (s *State) GetCharmLocatorByCharmID(ctx context.Context, id corecharm.ID) (charm.CharmLocator, error)

GetCharmLocatorByCharmID returns a charm locator for the given charm ID. The locator allows the reconstruction of the charm URL for the client response. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmManifest

func (s *State) GetCharmManifest(ctx context.Context, id corecharm.ID) (charm.Manifest, error)

GetCharmManifest returns the manifest for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmMetadata

func (s *State) GetCharmMetadata(ctx context.Context, id corecharm.ID) (charm.Metadata, error)

GetCharmMetadata returns the metadata for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmMetadataDescription

func (s *State) GetCharmMetadataDescription(ctx context.Context, id corecharm.ID) (string, error)

GetCharmMetadataDescription returns the description for the metadata for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmMetadataName

func (s *State) GetCharmMetadataName(ctx context.Context, id corecharm.ID) (string, error)

GetCharmMetadataName returns the name from the metadata for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmMetadataResources

func (s *State) GetCharmMetadataResources(ctx context.Context, id corecharm.ID) (map[string]charm.Resource, error)

GetCharmMetadataResources returns the resources metadata for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmMetadataStorage

func (s *State) GetCharmMetadataStorage(ctx context.Context, id corecharm.ID) (map[string]charm.Storage, error)

GetCharmMetadataStorage returns the storage metadata for the charm using the charm ID. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) GetCharmModifiedVersion

func (st *State) GetCharmModifiedVersion(ctx context.Context, id coreapplication.ID) (int, error)

GetCharmModifiedVersion looks up the charm modified version of the given application.

Returns applicationerrors.ApplicationNotFound if the application is not found.

func (*State) GetLatestPendingCharmhubCharm

func (s *State) GetLatestPendingCharmhubCharm(ctx context.Context, name string, arch architecture.Architecture) (charm.CharmLocator, error)

GetLatestPendingCharmhubCharm returns the latest charm that is pending from the charmhub store. If there are no charms, returns is not found, as applicationerrors.CharmNotFound. If there are multiple charms, then the latest created at date is returned first.

func (*State) GetModelType

func (st *State) GetModelType(ctx context.Context) (coremodel.ModelType, error)

GetModelType returns the model type for the underlying model. If the model does not exist then an error satisfying modelerrors.NotFound will be returned.

func (*State) GetStoragePoolByName

func (st *State) GetStoragePoolByName(ctx context.Context, name string) (domainstorage.StoragePoolDetails, error)

GetStoragePoolByName returns the storage pool with the specified name, returning an error satisfying storageerrors.PoolNotFoundError if it doesn't exist.

func (*State) GetStorageUUIDByID

func (st *State) GetStorageUUIDByID(ctx context.Context, storageID corestorage.ID) (corestorage.UUID, error)

GetStorageUUIDByID returns the UUID for the specified storage, returning an error satisfying storageerrors.StorageNotFound if the storage doesn't exist.

func (*State) GetUnitCloudContainerStatus

func (st *State) GetUnitCloudContainerStatus(ctx context.Context, uuid coreunit.UUID) (*application.StatusInfo[application.CloudContainerStatusType], error)

GetUnitCloudContainerStatus returns the cloud container status of the specified unit. It returns; - an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist or; - an error satisfying applicationerrors.UnitIsDead if the unit is dead or; - an error satisfying applicationerrors.UnitStatusNotFound if the status is not set.

func (*State) GetUnitCloudContainerStatusesForApplication

func (st *State) GetUnitCloudContainerStatusesForApplication(ctx context.Context, appID coreapplication.ID) (map[coreunit.Name]application.StatusInfo[application.CloudContainerStatusType], error)

GetUnitCloudContainerStatusesForApplication returns the cloud container statuses for all units of the specified application, returning:

func (*State) GetUnitLife

func (st *State) GetUnitLife(ctx context.Context, unitName coreunit.Name) (life.Life, error)

GetUnitLife looks up the life of the specified unit, returning an error satisfying applicationerrors.UnitNotFound if the unit is not found.

func (*State) GetUnitUUID

func (st *State) GetUnitUUID(ctx domain.AtomicContext, unitName coreunit.Name) (coreunit.UUID, error)

GetUnitUUID returns the UUID for the named unit, returning an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist.

func (*State) GetUnitUUIDByName

func (st *State) GetUnitUUIDByName(ctx context.Context, name coreunit.Name) (coreunit.UUID, error)

GetUnitUUIDByName returns the UUID for the named unit, returning an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist.

func (*State) GetUnitWorkloadStatus

func (st *State) GetUnitWorkloadStatus(ctx context.Context, uuid coreunit.UUID) (*application.StatusInfo[application.WorkloadStatusType], error)

GetUnitWorkloadStatus returns the workload status of the specified unit, returning: - an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist or; - an error satisfying applicationerrors.UnitIsDead if the unit is dead or; - an error satisfying applicationerrors.UnitStatusNotFound if the status is not set.

func (*State) GetUnitWorkloadStatusesForApplication

func (st *State) GetUnitWorkloadStatusesForApplication(ctx context.Context, appID coreapplication.ID) (map[coreunit.Name]application.StatusInfo[application.WorkloadStatusType], error)

GetUnitWorkloadStatusesForApplication returns the workload statuses for all units of the specified application, returning:

func (*State) InitialWatchStatementApplicationConfigHash

func (st *State) InitialWatchStatementApplicationConfigHash(appName string) (string, eventsource.NamespaceQuery)

InitialWatchStatementApplicationConfigHash returns the initial namespace query for the application config hash watcher.

func (*State) InitialWatchStatementApplicationsWithPendingCharms

func (st *State) InitialWatchStatementApplicationsWithPendingCharms() (string, eventsource.NamespaceQuery)

InitialWatchStatementApplicationsWithPendingCharms returns the initial namespace query for the applications with pending charms watcher.

func (*State) InitialWatchStatementUnitLife

func (st *State) InitialWatchStatementUnitLife(appName string) (string, eventsource.NamespaceQuery)

InitialWatchStatementUnitLife returns the initial namespace query for the application unit life watcher.

func (*State) InsertCAASUnit

func (st *State) InsertCAASUnit(ctx context.Context, appUUID coreapplication.ID, arg application.RegisterCAASUnitArg) error

InsertCAASUnit inserts the specified CAAS application unit, returning an error satisfying applicationerrors.UnitAlreadyExists if the unit exists, or applicationerrors.UnitNotAssigned if the unit was not assigned.

func (*State) InsertUnit

func (st *State) InsertUnit(
	ctx context.Context, appUUID coreapplication.ID, args application.InsertUnitArg,
) error

InsertUnit insert the specified application unit, returning an error satisfying applicationerrors.UnitAlreadyExists if the unit exists.

func (*State) IsCharmAvailable

func (s *State) IsCharmAvailable(ctx context.Context, id corecharm.ID) (bool, error)

IsCharmAvailable returns whether the charm is available for use. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) IsControllerCharm

func (s *State) IsControllerCharm(ctx context.Context, id corecharm.ID) (bool, error)

IsControllerCharm returns whether the charm is a controller charm. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) IsSubordinateCharm

func (s *State) IsSubordinateCharm(ctx context.Context, id corecharm.ID) (bool, error)

IsSubordinateCharm returns whether the charm is a subordinate charm. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) ListCharmLocators

func (s *State) ListCharmLocators(ctx context.Context) ([]charm.CharmLocator, error)

ListCharmLocatorsByNames returns a list of charm locators. The locator allows the reconstruction of the charm URL for the client response.

func (*State) ListCharmLocatorsByNames

func (s *State) ListCharmLocatorsByNames(ctx context.Context, names []string) ([]charm.CharmLocator, error)

ListCharmLocatorsByNames returns a list of charm locators for the specified charm names. The locator allows the reconstruction of the charm URL for the client response. If no names are provided, then nothing is returned.

func (*State) ResolveCharmDownload

func (st *State) ResolveCharmDownload(ctx context.Context, id corecharm.ID, info application.ResolvedCharmDownload) error

ResolveCharmDownload resolves the charm download for the specified application, updating the charm with the specified charm information. This will only set mutable charm fields. Currently this will also set actions.yaml, although that will be removed once the charmhub store provides this information. Returns an error satisfying applicationerrors.CharmNotFound if the charm is not found, and applicationerrors.CharmAlreadyResolved if the charm is already resolved.

func (*State) ResolveMigratingUploadedCharm

func (s *State) ResolveMigratingUploadedCharm(ctx context.Context, id corecharm.ID, info charm.ResolvedMigratingUploadedCharm) (charm.CharmLocator, error)

ResolveMigratingUploadedCharm resolves the charm that is migrating from the uploaded state to the available state. If the charm is not found, a applicationerrors.CharmNotFound error is returned.

func (*State) SetApplicationConfigAndSettings

func (st *State) SetApplicationConfigAndSettings(
	ctx context.Context,
	appID coreapplication.ID,
	cID corecharm.ID,
	config map[string]application.ApplicationConfig,
	settings application.ApplicationSettings,
) error

SetApplicationConfig sets the application config attributes using the configuration.

func (*State) SetApplicationConstraints

func (st *State) SetApplicationConstraints(ctx context.Context, appID coreapplication.ID, cons constraints.Constraints) error

SetApplicationConstraints sets the application constraints for the specified application ID. This method overwrites the full constraints on every call. If invalid constraints are provided (e.g. invalid container type or non-existing space), a applicationerrors.InvalidApplicationConstraints error is returned. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) SetApplicationLife

func (st *State) SetApplicationLife(ctx context.Context, appUUID coreapplication.ID, l life.Life) error

SetApplicationLife sets the life of the specified application.

func (*State) SetApplicationScalingState

func (st *State) SetApplicationScalingState(ctx context.Context, appUUID coreapplication.ID, scale *int, targetScale int, scaling bool) error

SetApplicationScalingState sets the scaling details for the given caas application Scale is optional and is only set if not nil.

func (*State) SetApplicationStatus

func (st *State) SetApplicationStatus(
	ctx context.Context,
	applicationID coreapplication.ID,
	status *application.StatusInfo[application.WorkloadStatusType],
) error

SetApplicationStatus saves the given application status, overwriting any current status data. If returns an error satisfying applicationerrors.ApplicationNotFound if the application doesn't exist.

func (*State) SetCharm

func (s *State) SetCharm(ctx context.Context, ch charm.Charm, downloadInfo *charm.DownloadInfo, requiresSequencing bool) (corecharm.ID, charm.CharmLocator, error)

SetCharm persists the charm metadata, actions, config and manifest to state.

func (*State) SetCharmAvailable

func (s *State) SetCharmAvailable(ctx context.Context, id corecharm.ID) error

SetCharmAvailable sets the charm as available for use. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) SetDesiredApplicationScale

func (st *State) SetDesiredApplicationScale(ctx context.Context, appUUID coreapplication.ID, scale int) error

SetDesiredApplicationScale updates the desired scale of the specified application.

func (*State) SetUnitLife

func (st *State) SetUnitLife(ctx context.Context, unitName coreunit.Name, l life.Life) error

SetUnitLife sets the life of the specified unit, returning an error satisfying applicationerrors.UnitNotFound if the unit is not found.

func (*State) SetUnitPassword

func (st *State) SetUnitPassword(ctx context.Context, unitUUID coreunit.UUID, password application.PasswordInfo) error

SetUnitPassword updates the password for the specified unit UUID.

func (*State) SetUnitWorkloadStatus

func (st *State) SetUnitWorkloadStatus(ctx context.Context, unitUUID coreunit.UUID, status *application.StatusInfo[application.WorkloadStatusType]) error

SetUnitWorkloadStatus updates the workload status of the specified unit, returning an error satisfying applicationerrors.UnitNotFound if the unit doesn't exist.

func (*State) StorageDefaults

func (st *State) StorageDefaults(ctx context.Context) (domainstorage.StorageDefaults, error)

StorageDefaults returns the default storage sources for a model.

func (*State) SupportsContainers

func (s *State) SupportsContainers(ctx context.Context, id corecharm.ID) (bool, error)

SupportsContainers returns whether the charm supports containers. If the charm does not exist, a errors.CharmNotFound error is returned.

func (*State) UnsetApplicationConfigKeys

func (st *State) UnsetApplicationConfigKeys(ctx context.Context, appID coreapplication.ID, keys []string) error

UnsetApplicationConfigKeys removes the specified keys from the application config. If the key does not exist, it is ignored. If no application is found, an error satisfying applicationerrors.ApplicationNotFound is returned.

func (*State) UpdateCAASUnit

func (st *State) UpdateCAASUnit(ctx context.Context, unitName coreunit.Name, params application.UpdateCAASUnitParams) error

UpdateCAASUnit updates the cloud container for specified unit, returning an error satisfying applicationerrors.UnitNotFoundError if the unit doesn't exist.

func (*State) UpsertCloudService

func (st *State) UpsertCloudService(ctx context.Context, applicationName, providerID string, sAddrs network.SpaceAddresses) error

UpsertCloudService updates the cloud service for the specified application, returning an error satisfying applicationerrors.ApplicationNotFoundError if the application doesn't exist.

Jump to

Keyboard shortcuts

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