juju: github.com/juju/juju/apiserver/facades/client/modelgeneration Index | Files | Directories

package modelgeneration

import "github.com/juju/juju/apiserver/facades/client/modelgeneration"

Index

Package Files

interface.go modelgeneration.go shim.go

type API Uses

type API struct {
    // contains filtered or unexported fields
}

API is the concrete implementation of the API endpoint.

func NewModelGenerationAPI Uses

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 NewModelGenerationFacadeV2 Uses

func NewModelGenerationFacadeV2(ctx facade.Context) (*API, error)

NewModelGenerationFacadeV2 provides the signature required for facade registration.

func (*API) AbortBranch Uses

func (api *API) AbortBranch(arg params.BranchArg) (params.ErrorResult, error)

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) AddBranch Uses

func (api *API) AddBranch(arg params.BranchArg) (params.ErrorResult, error)

AddBranch adds a new branch with the input name to the model.

func (*API) BranchInfo Uses

func (api *API) BranchInfo(args params.BranchInfoArgs) (params.GenerationResults, 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 Uses

func (api *API) CommitBranch(arg params.BranchArg) (params.IntResult, error)

CommitBranch commits the input branch, making its changes applicable to the whole model and marking it complete.

func (*API) HasActiveBranch Uses

func (api *API) HasActiveBranch(arg params.BranchArg) (params.BoolResult, error)

HasActiveBranch returns a true result if the input model has an "in-flight" branch matching the input name.

func (*API) TrackBranch Uses

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 APIV1 Uses

type APIV1 struct {
    *API
}

func NewModelGenerationFacade Uses

func NewModelGenerationFacade(ctx facade.Context) (*APIV1, error)

NewModelGenerationFacade provides the signature required for facade registration.

type Application Uses

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 Uses

type Generation interface {
    BranchName() string
    Created() int64
    CreatedBy() string
    AssignAllUnits(string) error
    AssignUnit(string) error
    AssignedUnits() map[string][]string
    Commit(string) (int, error)
    Abort(string) error
    Config() map[string]settings.ItemChanges
}

Generation defines the methods used by a generation.

type Model Uses

type Model interface {
    ModelTag() names.ModelTag
    AddBranch(string, string) error
    Branch(string) (Generation, error)
    Branches() ([]Generation, error)
}

Model describes model state used by the model generation API.

type ModelCache Uses

type ModelCache interface {
    Branch(string) (cache.Branch, error)
}

ModelCache describes a cached model used by the model generation API.

type State Uses

type State interface {
    ControllerTag() names.ControllerTag
    Model() (Model, error)
    Application(string) (Application, error)
}

State represents the state of a model required by the model generation API.

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.

Package modelgeneration imports 14 packages (graph) and is imported by 4 packages. Updated 2019-08-23. Refresh now. Tools for package owners.