model

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 49 Imported by: 0

Documentation

Overview

Copyright 2016 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.

Copyright 2016 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.

Copyright 2018 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDetails

func ConfigDetails() (map[string]interface{}, error)

ConfigDetails gets ModelDetails when a model is not available to use.

func ExtractCert

func ExtractCert() []byte

func NewAbortCommand

func NewAbortCommand() cmd.Command

NewAbortCommand wraps abortCommand with sane model settings.

func NewAddBranchCommand

func NewAddBranchCommand() cmd.Command

NewAddBranchCommand wraps addBranchCommand with sane model settings.

func NewBranchCommand

func NewBranchCommand() cmd.Command

NewBranchCommand wraps branchCommand with sane model settings.

func NewCommitCommand

func NewCommitCommand() cmd.Command

NewCommitCommand wraps commitCommand with sane model settings.

func NewCommitsCommand

func NewCommitsCommand() cmd.Command

NewCommitCommand wraps CommitsCommand with sane model settings.

func NewConfigCommand

func NewConfigCommand() cmd.Command

NewConfigCommand wraps configCommand with sane model settings.

func NewDefaultsCommand

func NewDefaultsCommand() cmd.Command

NewDefaultsCommand wraps defaultsCommand with sane model settings.

func NewDestroyCommand

func NewDestroyCommand() cmd.Command

NewDestroyCommand returns a command used to destroy a model.

func NewDiffCommand

func NewDiffCommand() cmd.Command

NewDiffCommand wraps diffCommand with sane model settings.

func NewDumpCommand

func NewDumpCommand() cmd.Command

NewDumpCommand returns a fully constructed dump-model command.

func NewDumpDBCommand

func NewDumpDBCommand() cmd.Command

NewDumpDBCommand returns a fully constructed dump-db command.

func NewExportBundleCommand

func NewExportBundleCommand() cmd.Command

NewExportBundleCommand returns a fully constructed export bundle command.

func NewGrantCloudCommand

func NewGrantCloudCommand() cmd.Command

NewGrantCloudCommand returns a new grant command.

func NewGrantCommand

func NewGrantCommand() cmd.Command

NewGrantCommand returns a new grant command.

func NewModelCredentialCommand

func NewModelCredentialCommand() cmd.Command

func NewModelGetConstraintsCommand

func NewModelGetConstraintsCommand() cmd.Command

NewModelGetConstraintsCommand returns a command to get model constraints.

func NewModelSetConstraintsCommand

func NewModelSetConstraintsCommand() cmd.Command

NewModelSetConstraintsCommand returns a command to set model constraints.

func NewRetryProvisioningCommand

func NewRetryProvisioningCommand() cmd.Command

func NewRevokeCloudCommand

func NewRevokeCloudCommand() cmd.Command

NewRevokeCloudCommand returns a new revoke command.

func NewRevokeCommand

func NewRevokeCommand() cmd.Command

NewRevokeCommand returns a new revoke command.

func NewShowCommand

func NewShowCommand() cmd.Command

func NewShowCommitCommand

func NewShowCommitCommand() cmd.Command

NewShowCommitCommand wraps NewShowCommitCommand with sane model settings.

func NewTrackBranchCommand

func NewTrackBranchCommand() cmd.Command

NewTrackBranchCommand wraps trackBranchCommand with sane model settings.

func ParseCert

func ParseCert(arg string) error

Types

type AbortCommandAPI

type AbortCommandAPI interface {
	Close() error

	// Abort aborts an existing branch to the model.
	AbortBranch(branchName string) error

	// HasActiveBranch returns true if the model has an
	// "in-flight" branch with the input name.
	HasActiveBranch(branchName string) (bool, error)
}

AbortCommandAPI describes API methods required to execute the branch command.

type AddBranchCommandAPI

type AddBranchCommandAPI interface {
	Close() error

	// AddBranch adds a new branch to the model.
	AddBranch(branchName string) error
}

AddBranchCommandAPI describes API methods required to execute the branch command.

type BranchCommandAPI

type BranchCommandAPI interface {
	Close() error
	// HasActiveBranch returns true if the model has an
	// "in-flight" branch with the input name.
	HasActiveBranch(branchName string) (bool, error)
}

BranchCommandAPI describes API methods required to execute the branch command.

type BudgetAPIClient

type BudgetAPIClient interface {
	DeleteBudget(string) (string, error)
}

BudgetAPIClient defines the budget API client interface.

type CloudAPI

type CloudAPI interface {
	Close() error
	UserCredentials(names.UserTag, names.CloudTag) ([]names.CloudCredentialTag, error)
	AddCredential(tag string, credential cloud.Credential) error
}

CloudAPI defines methods used to detemine if cloud credential exists on the controller.

type CommitCommandAPI

type CommitCommandAPI interface {
	Close() error

	// CommitBranch commits the branch with the input name to the model,
	// effectively completing it and applying
	// all branch changes across the model.
	// The new generation ID of the model is returned.
	CommitBranch(branchName string) (int, error)
}

CommitCommandAPI defines an API interface to be used during testing.

type CommitsCommand

type CommitsCommand struct {
	modelcmd.ModelCommandBase
	// contains filtered or unexported fields
}

CommitsCommand supplies the "commit" CLI command used to commit changes made under a branch, to the model.

func (*CommitsCommand) Info

func (c *CommitsCommand) Info() *cmd.Info

Info implements part of the cmd.Command interface.

func (*CommitsCommand) Init

func (c *CommitsCommand) Init(args []string) error

Init implements part of the cmd.Command interface.

func (*CommitsCommand) Run

func (c *CommitsCommand) Run(ctx *cmd.Context) error

Run implements the meaty part of the cmd.Command interface.

func (*CommitsCommand) SetFlags

func (c *CommitsCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements part of the cmd.Command interface.

type CommitsCommandAPI

type CommitsCommandAPI interface {
	Close() error

	// ListCommitsBranch commits the branch with the input name to the model,
	// effectively completing it and applying
	// all branch changes across the model.
	// The new generation ID of the model is returned.
	ListCommits() (model.GenerationCommits, error)
}

CommitsCommandAPI defines an API interface to be used during testing.

type ConfigAPI

type ConfigAPI interface {
	Close() error
	Get(branchName string, application string) (*params.ApplicationGetResults, error)
}

ConfigAPI specifies the used function calls of the ApplicationFacade.

type ConstraintsAPI

type ConstraintsAPI interface {
	Close() error
	GetModelConstraints() (constraints.Value, error)
	SetModelConstraints(constraints.Value) error
}

ConstraintsAPI defines methods on the client API that the get-constraints and set-constraints commands call

type DestroyModelAPI

type DestroyModelAPI interface {
	Close() error
	BestAPIVersion() int
	DestroyModel(tag names.ModelTag, destroyStorage, force *bool, maxWait *time.Duration) error
	ModelStatus(models ...names.ModelTag) ([]base.ModelStatus, error)
}

DestroyModelAPI defines the methods on the modelmanager API that the destroy command calls. It is exported for mocking in tests.

type DiffCommandAPI

type DiffCommandAPI interface {
	Close() error

	// BranchInfo returns information about "in-flight" branches.
	// If a non-empty string is supplied for branch name,
	// then only information for that branch is returned.
	// Supplying true for detailed returns extra unit detail for the branch.
	BranchInfo(branchName string, detailed bool, formatTime func(time.Time) string) (model.GenerationSummaries, error)
}

DiffCommandAPI describes API methods required to execute the diff command.

type DumpDBAPI

type DumpDBAPI interface {
	Close() error
	DumpModelDB(names.ModelTag) (map[string]interface{}, error)
}

DumpDBAPI specifies the used function calls of the ModelManager.

type DumpModelAPI

type DumpModelAPI interface {
	Close() error
	DumpModel(names.ModelTag, bool) (map[string]interface{}, error)
}

DumpModelAPI specifies the used function calls of the ModelManager.

type ExportBundleAPI

type ExportBundleAPI interface {
	BestAPIVersion() int
	Close() error
	ExportBundle() (string, error)
}

ExportBundleAPI specifies the used function calls of the BundleFacade.

type GrantCloudAPI

type GrantCloudAPI interface {
	Close() error
	GrantCloud(user, access string, clouds ...string) error
}

GrantCloudAPI defines the API functions used by the grant command.

type GrantControllerAPI

type GrantControllerAPI interface {
	Close() error
	GrantController(user, access string) error
}

GrantControllerAPI defines the API functions used by the grant command.

type GrantModelAPI

type GrantModelAPI interface {
	Close() error
	GrantModel(user, access string, modelUUIDs ...string) error
}

GrantModelAPI defines the API functions used by the grant command.

type GrantOfferAPI

type GrantOfferAPI interface {
	Close() error
	GrantOffer(user, access string, offerURLs ...string) error
}

GrantOfferAPI defines the API functions used by the grant command.

type ModelConfigAPI

type ModelConfigAPI interface {
	Close() error
	SLALevel() (string, error)
}

ModelConfigAPI defines the methods on the modelconfig API that the destroy command calls. It is exported for mocking in tests.

type ModelCredentialAPI

type ModelCredentialAPI interface {
	Close() error
	ChangeModelCredential(model names.ModelTag, credential names.CloudCredentialTag) error
}

ModelCredentialAPI defines methods used to replace model credential.

type RetryProvisioningAPI

type RetryProvisioningAPI interface {
	Close() error
	RetryProvisioning(machines ...names.MachineTag) ([]params.ErrorResult, error)
}

RetryProvisioningAPI defines methods on the client API that the retry-provisioning command calls.

type RevokeCloudAPI

type RevokeCloudAPI interface {
	Close() error
	RevokeCloud(user, access string, clouds ...string) error
}

RevokeCloudAPI defines the API functions used by the revoke cloud command.

type RevokeControllerAPI

type RevokeControllerAPI interface {
	Close() error
	RevokeController(user, access string) error
}

RevokeControllerAPI defines the API functions used by the revoke command.

type RevokeModelAPI

type RevokeModelAPI interface {
	Close() error
	RevokeModel(user, access string, modelUUIDs ...string) error
}

RevokeModelAPI defines the API functions used by the revoke command.

type RevokeOfferAPI

type RevokeOfferAPI interface {
	Close() error
	RevokeOffer(user, access string, offerURLs ...string) error
}

RevokeOfferAPI defines the API functions used by the revoke command.

type ShowCommitCommand

type ShowCommitCommand struct {
	modelcmd.ModelCommandBase
	// contains filtered or unexported fields
}

ShowCommitCommand supplies the "show-commit" CLI command used to show commits

func (*ShowCommitCommand) Info

func (c *ShowCommitCommand) Info() *cmd.Info

Info implements part of the cmd.Command interface.

func (*ShowCommitCommand) Init

func (c *ShowCommitCommand) Init(args []string) error

Init implements part of the cmd.Command interface.

func (*ShowCommitCommand) Run

func (c *ShowCommitCommand) Run(ctx *cmd.Context) error

Run implements the meaty part of the cmd.Command interface.

func (*ShowCommitCommand) SetFlags

func (c *ShowCommitCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags implements part of the cmd.Command interface.

type ShowCommitCommandAPI

type ShowCommitCommandAPI interface {
	Close() error

	// ShowCommit shows the branches which were committed
	ShowCommit(int) (model.GenerationCommit, error)
}

ShowCommitCommandAPI defines an API interface to be used during testing.

type ShowModelAPI

type ShowModelAPI interface {
	Close() error
	ModelInfo([]names.ModelTag) ([]params.ModelInfoResult, error)
}

ShowModelAPI defines the methods on the client API that the users command calls.

type StorageAPI

type StorageAPI interface {
	Close() error
	ListStorageDetails() ([]params.StorageDetails, error)
}

StorageAPI defines the storage client API interface.

type TrackBranchCommandAPI

type TrackBranchCommandAPI interface {
	Close() error

	// TrackBranch sets the input units and/or applications
	// to track changes made under the input branch name.
	TrackBranch(branchName string, entities []string, numUnits int) error
	HasActiveBranch(branchName string) (bool, error)
}

TrackBranchCommandAPI describes API methods required to execute the track command.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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