Documentation ¶
Index ¶
- func Register(registry facade.FacadeRegistry)
- type API
- func (api *API) AbortBranch(arg params.BranchArg) (params.ErrorResult, error)
- func (api *API) AddBranch(arg params.BranchArg) (params.ErrorResult, error)
- func (api *API) BranchInfo(args params.BranchInfoArgs) (params.BranchResults, error)
- func (api *API) CommitBranch(arg params.BranchArg) (params.IntResult, error)
- func (api *API) HasActiveBranch(arg params.BranchArg) (params.BoolResult, error)
- func (api *API) ListCommits() (params.BranchResults, error)
- func (api *API) ShowCommit(arg params.GenerationId) (params.GenerationResult, error)
- func (api *API) TrackBranch(arg params.BranchTrackArg) (params.ErrorResults, error)
- type Application
- type Generation
- type Model
- type ModelCache
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(registry facade.FacadeRegistry)
Register is called to expose a package of facades onto a given registry.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the concrete implementation of the API endpoint.
func NewModelGenerationAPI ¶
func NewModelGenerationAPI( st State, authorizer facade.Authorizer, m Model, mc ModelCache, ) (*API, error)
NewModelGenerationAPI creates a new API endpoint for dealing with model generations.
func (*API) AbortBranch ¶
AbortBranch aborts the input branch, marking it complete. However no changes are made applicable to the whole model. No units may be assigned to the branch when aborting.
func (*API) BranchInfo ¶
func (api *API) BranchInfo( args params.BranchInfoArgs) (params.BranchResults, error)
BranchInfo will return details of branch identified by the input argument, including units on the branch and the configuration disjoint with the master generation. An error is returned if no in-flight branch matching in input is found.
func (*API) CommitBranch ¶
CommitBranch commits the input branch, making its changes applicable to the whole model and marking it complete.
func (*API) HasActiveBranch ¶
HasActiveBranch returns a true result if the input model has an "in-flight" branch matching the input name.
func (*API) ListCommits ¶
func (api *API) ListCommits() (params.BranchResults, error)
ListCommits will return the commits, hence only branches with generation_id higher than 0
func (*API) ShowCommit ¶
func (api *API) ShowCommit(arg params.GenerationId) (params.GenerationResult, error)
ShowCommit will return details a commit given by its generationId An error is returned if either no branch can be found corresponding to the generation id. Or the generation id given is below 1.
func (*API) TrackBranch ¶
func (api *API) TrackBranch(arg params.BranchTrackArg) (params.ErrorResults, error)
TrackBranch marks the input units and/or applications as tracking the input branch, causing them to realise changes made under that branch.
type Application ¶
type Application interface { UnitNames() ([]string, error) // DefaultCharmConfig is the only abstraction in these shims. // It saves us having to shim out Charm as well. DefaultCharmConfig() (charm.Settings, error) }
Application describes application state used by the model generation API.
type Generation ¶
type Generation interface { BranchName() string Created() int64 CreatedBy() string Completed() int64 CompletedBy() string AssignAllUnits(string) error AssignUnits(string, int) error AssignUnit(string) error AssignedUnits() map[string][]string Commit(string) (int, error) Abort(string) error Config() map[string]settings.ItemChanges GenerationId() int }
Generation defines the methods used by a generation.
type Model ¶
type Model interface { ModelTag() names.ModelTag AddBranch(string, string) error Branch(string) (Generation, error) Branches() ([]Generation, error) Generation(int) (Generation, error) Generations() ([]Generation, error) }
Model describes model state used by the model generation API.
type ModelCache ¶
ModelCache describes a cached model used by the model generation API.