model

package
v0.0.0-...-8ff1004 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func CompareUpgradeSeriesStatus

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 ValidateSeries

func ValidateSeries(modelType ModelType, charmSeries string) error

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

Types

type GenerationVersion

type GenerationVersion string

GenerationVersion indicates a generation to use for model config.

const (
	// GenerationCurrent indicates the current generation for model config.
	// This is the default state of a model.
	GenerationCurrent GenerationVersion = "current"

	// GenerationNext indicates the next generation of model config.
	// Models with an active "next" generation apply the generation config
	// selectively to units added to the generation.
	GenerationNext GenerationVersion = "next"
)

func (GenerationVersion) String

func (g GenerationVersion) String() string

type Model

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

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

func (m ModelType) String() string

String returns m as a string.

type UpgradeSeriesStatus

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

func ValidateUpgradeSeriesStatus(status UpgradeSeriesStatus) (UpgradeSeriesStatus, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL