juju: github.com/juju/juju/core/model Index | Files

package model

import "github.com/juju/juju/core/model"

Index

Package Files

block.go generation.go job.go model.go upgradeseries.go

Constants

const GenerationMaster = "master"

GenerationMaster is used to indicate the main model configuration, i.e. that not dealing with in-flight branches.

Variables

var UpgradeSeriesStatusOrder = map[UpgradeSeriesStatus]int{
    UpgradeSeriesNotStarted:       0,
    UpgradeSeriesPrepareStarted:   1,
    UpgradeSeriesPrepareRunning:   2,
    UpgradeSeriesPrepareCompleted: 3,
    UpgradeSeriesCompleteStarted:  4,
    UpgradeSeriesCompleteRunning:  5,
    UpgradeSeriesCompleted:        6,
    UpgradeSeriesError:            7,
}

func AnyJobNeedsState Uses

func AnyJobNeedsState(jobs ...MachineJob) bool

AnyJobNeedsState returns true if any of the provided jobs require a state connection.

func CompareUpgradeSeriesStatus Uses

func CompareUpgradeSeriesStatus(status1 UpgradeSeriesStatus, status2 UpgradeSeriesStatus) (int, error)

CompareUpgradeSeriesStatus compares two upgrade series statuses and returns an integer; if the first argument equals the second then 0 is returned; if the second is greater -1 is returned; 1 is returned otherwise. An error is returned if either argument is an invalid status.

func ValidateBranchName Uses

func ValidateBranchName(name string) error

ValidateBranchName returns an error if the input name is not suitable for identifying a new in-flight branch.

func ValidateSeries Uses

func ValidateSeries(modelType ModelType, charmSeries string) error

ValidateSeries ensures the charm series is valid for the model type.

type BlockType Uses

type BlockType string

BlockType values define model block type.

const (
    // BlockDestroy type identifies destroy blocks.
    BlockDestroy BlockType = "BlockDestroy"

    // BlockRemove type identifies remove blocks.
    BlockRemove BlockType = "BlockRemove"

    // BlockChange type identifies change blocks.
    BlockChange BlockType = "BlockChange"
)

type Generation Uses

type Generation struct {
    // Created is the formatted time at generation creation.
    Created string `yaml:"created"`

    // Created is the user who created the generation.
    CreatedBy string `yaml:"created-by"`

    // Applications is a collection of applications with changes in this
    // generation including advanced units and modified configuration.
    Applications []GenerationApplication `yaml:"applications"`
}

Generation represents detail of a model generation including config changes.

type GenerationApplication Uses

type GenerationApplication struct {
    // ApplicationsName is the name of the application.
    ApplicationName string `yaml:"application"`

    // UnitProgress is summary information about units tracking the branch.
    UnitProgress string `yaml:"progress,omitempty"`

    // UnitDetail specifies which units are and are not tracking the branch.
    UnitDetail *GenerationUnits `yaml:"units,omitempty"`

    // Config changes are the differing configuration values between this
    // generation and the current.
    // TODO (manadart 2018-02-22) This data-type will evolve as more aspects
    // of the application are made generational.
    ConfigChanges map[string]interface{} `yaml:"config"`
}

GenerationApplication represents changes to an application made under a generation.

type GenerationCommit Uses

type GenerationCommit struct {
    // BranchName uniquely identifies a branch *amongst in-flight branches*.
    BranchName string `yaml:"branch"`

    // Created is the Unix timestamp at generation creation.
    Completed time.Time `yaml:"completed"`

    // Created is the user who created the generation.
    CompletedBy string `yaml:"completed-by"`

    // Created is the Unix timestamp at generation creation.
    Created time.Time `yaml:"created,omitempty"`

    // Created is the user who created the generation.
    CreatedBy string `yaml:"created-by,omitempty"`

    // GenerationId is the id .
    GenerationId int `yaml:"generation-id,omitempty"`

    // Applications holds the collection of application changes
    // made under this generation.
    Applications []GenerationApplication `yaml:"applications,omitempty"`
}

GenerationCommit represents a model generation's commit details.

type GenerationCommits Uses

type GenerationCommits = []GenerationCommit

GenerationCommits is a type alias for a representation of each commit. Keyed by the generation id

type GenerationSummaries Uses

type GenerationSummaries = map[string]Generation

GenerationSummaries is a type alias for a representation of changes-by-generation.

type GenerationUnits Uses

type GenerationUnits struct {
    // UnitsTracking is the names of application units that have been set to
    // track the branch.
    UnitsTracking []string `yaml:"tracking,omitempty"`

    // UnitsPending is the names of application units that are still tracking
    // the master generation.
    UnitsPending []string `yaml:"incomplete,omitempty"`
}

GenerationUnits indicates which units from an application are and are not tracking a model branch.

type MachineJob Uses

type MachineJob string

MachineJob values define responsibilities that machines may be expected to fulfil.

const (
    JobHostUnits   MachineJob = "JobHostUnits"
    JobManageModel MachineJob = "JobManageModel"
)

func (MachineJob) NeedsState Uses

func (job MachineJob) NeedsState() bool

NeedsState returns true if the job requires a state connection.

type Model Uses

type Model struct {
    // Name returns the human friendly name of the model.
    Name string

    // UUID is the universally unique identifier of the model.
    UUID string

    // ModelType is the type of model.
    ModelType ModelType
}

Model represents the state of a model.

type ModelType Uses

type ModelType string

ModelType indicates a model type.

const (
    // IAAS is the type for IAAS models.
    IAAS ModelType = "iaas"

    // CAAS is the type for CAAS models.
    CAAS ModelType = "caas"
)

func (ModelType) String Uses

func (m ModelType) String() string

String returns m as a string.

type UpgradeSeriesStatus Uses

type UpgradeSeriesStatus string

UpgradeSeriesStatus is the current status of a series upgrade for units

const (
    UpgradeSeriesNotStarted       UpgradeSeriesStatus = "not started"
    UpgradeSeriesPrepareStarted   UpgradeSeriesStatus = "prepare started"
    UpgradeSeriesPrepareRunning   UpgradeSeriesStatus = "prepare running"
    UpgradeSeriesPrepareCompleted UpgradeSeriesStatus = "prepare completed"
    UpgradeSeriesCompleteStarted  UpgradeSeriesStatus = "complete started"
    UpgradeSeriesCompleteRunning  UpgradeSeriesStatus = "complete running"
    UpgradeSeriesCompleted        UpgradeSeriesStatus = "completed"
    UpgradeSeriesError            UpgradeSeriesStatus = "error"
)

func ValidateUpgradeSeriesStatus Uses

func ValidateUpgradeSeriesStatus(status UpgradeSeriesStatus) (UpgradeSeriesStatus, error)

ValidateUpgradeSeriesStatus validates a the input status as valid for a unit, returning the valid status or an error.

Package model imports 5 packages (graph) and is imported by 173 packages. Updated 2019-12-07. Refresh now. Tools for package owners.