Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelState ¶
func NewModelState ¶
func NewModelState(factory database.TxnRunnerFactory) *ModelState
NewModelState returns a new ModelState object.
func (*ModelState) CheckMachineExists ¶
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.
func (*ModelState) CheckUnitExists ¶
func (m *ModelState) CheckUnitExists( ctx context.Context, name string, ) error
CheckUnitExists checks to see if the given unit exists in the model. If the unit does not exist an error satisfying applicationerrors.UnitNotFound is returned.
func (*ModelState) GetModelUUID ¶
GetModelUUID returns the uuid for the model represented by this state.
type State ¶
State is responsible for retrieving a model's running agent version from the database.
func NewState ¶
func NewState(factory database.TxnRunnerFactory) *State
NewState returns a new State object.
func (*State) GetModelTargetAgentVersion ¶
func (st *State) GetModelTargetAgentVersion(ctx context.Context, modelID model.UUID) (version.Number, error)
GetModelTargetAgentVersion returns the agent version for the specified model. If the agent version cannot be found, an error satisfying modelerrors.NotFound will be returned.