Documentation
¶
Index ¶
- type Service
- func (s *Service) GetMachineTargetAgentVersion(ctx context.Context, machineName machine.Name) (version.Number, error)
- func (s *Service) GetModelTargetAgentVersion(ctx context.Context) (version.Number, error)
- func (s *Service) GetUnitTargetAgentVersion(ctx context.Context, unitName string) (version.Number, error)
- func (s *Service) WatchMachineTargetAgentVersion(ctx context.Context, machineName machine.Name) (watcher.NotifyWatcher, error)
- func (s *Service) WatchModelTargetAgentVersion(ctx context.Context) (watcher.NotifyWatcher, error)
- func (s *Service) WatchUnitTargetAgentVersion(ctx context.Context, unitName string) (watcher.NotifyWatcher, error)
- type State
- type WatcherFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is used to get the target Juju agent version for the current model.
func NewService ¶
func NewService(st State, watcherFactory WatcherFactory) *Service
NewService returns a new Service.
func (*Service) GetMachineTargetAgentVersion ¶
func (s *Service) GetMachineTargetAgentVersion( ctx context.Context, machineName machine.Name, ) (version.Number, error)
GetMachineTargetAgentVersion reports the target agent version that should be running on the provided machine identified by name. The following errors are possible: - machineerrors.MachineNotFound - github.com/juju/juju/domain/model/errors.AgentVersionNotFound
func (*Service) GetModelTargetAgentVersion ¶
GetModelTargetAgentVersion returns the agent version for the specified model. The following errors can be returned:
- errors.NotValid if the model ID is not valid;
- github.com/juju/juju/domain/model/errors.AgentVersionFound if no agent version record exists.
func (*Service) GetUnitTargetAgentVersion ¶
func (s *Service) GetUnitTargetAgentVersion( ctx context.Context, unitName string, ) (version.Number, error)
GetUnitTargetAgentVersion reports the target agent version that should be being run on the provided unit identified by name. The following errors are possible: - applicationerrors.UnitNotFound - When the unit in question does not exist.
- github.com/juju/juju/domain/model/errors.AgentVersionFound if no agent version record exists.
func (*Service) WatchMachineTargetAgentVersion ¶
func (s *Service) WatchMachineTargetAgentVersion( ctx context.Context, machineName machine.Name, ) (watcher.NotifyWatcher, error)
WatchMachineTargetAgentVersion is responsible for watching the target agent version for machine and reporting when there has been a change via a watcher.NotifyWatcher. The following errors can be expected: - machineerrors.NotFound - When no machine exists for the provided name. - [modelerrors.AgentVersionNotFound] - When there is no target version found.
func (*Service) WatchModelTargetAgentVersion ¶
WatchModelTargetAgentVersion is responsible for watching the target agent version of this model and reporting when a change has happened in the version.
func (*Service) WatchUnitTargetAgentVersion ¶
func (s *Service) WatchUnitTargetAgentVersion( ctx context.Context, unitName string, ) (watcher.NotifyWatcher, error)
WatchUnitTargetAgentVersion is responsible for watching the target agent version for unit and reporting when there has been a change via a watcher.NotifyWatcher. The following errors can be expected: - applicationerrors.UnitNotFound - When no unit exists for the provided name. - [modelerrors.AgentVersionNotFound] - When there is no target version found.
type State ¶
type State interface { // CheckMachineExists check to see if the given machine exists in the model. If // the machine does not exist an error satisfying // [machineerrors.MachineNotFound] is returned. CheckMachineExists(context.Context, machine.Name) error // CheckUnitExists check to see if the given unit exists in the model. If // the unit does not exist an error satisfying // [applicationerrors.UnitNotFound] is returned. CheckUnitExists(context.Context, string) error // GetTargetAgentVersion returns the target agent version for this model. GetTargetAgentVersion(context.Context) (version.Number, error) }
type WatcherFactory ¶
type WatcherFactory interface { // NewNamespaceNotifyWatcher returns a new namespace notify watcher // for events based on the input change mask. NewNamespaceNotifyWatcher(namespace string, changeMask changestream.ChangeType) (watcher.NotifyWatcher, error) }
WatcherFactory provides a factory for constructing new watchers.