modelconfig

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	common.BlockGetter
	ControllerTag() names.ControllerTag
	ModelTag() names.ModelTag
	ModelConfigValues() (config.ConfigValues, error)
	UpdateModelConfig(map[string]interface{}, []string, ...state.ValidateConfigFunc) error
	Sequences() (map[string]int, error)
	SetSLA(level, owner string, credentials []byte) error
	SLALevel() (string, error)
}

Backend contains the state.State methods used in this package, allowing stubs to be created for testing.

func NewStateBackend

func NewStateBackend(m *state.Model) Backend

NewStateBackend creates a backend for the facade to use.

type ModelConfigAPI

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

ModelConfigAPI provides the base implementation of the methods for the V2 and V1 api calls.

func (*ModelConfigAPI) ModelGet

func (c *ModelConfigAPI) ModelGet() (params.ModelConfigResults, error)

ModelGet implements the server-side part of the model-config CLI command.

func (*ModelConfigAPI) ModelSet

func (c *ModelConfigAPI) ModelSet(args params.ModelSet) error

ModelSet implements the server-side part of the set-model-config CLI command.

func (*ModelConfigAPI) ModelUnset

func (c *ModelConfigAPI) ModelUnset(args params.ModelUnset) error

ModelUnset implements the server-side part of the set-model-config CLI command.

func (*ModelConfigAPI) SLALevel

func (c *ModelConfigAPI) SLALevel() (params.StringResult, error)

SLALevel returns the current sla level for the model.

func (*ModelConfigAPI) Sequences

func (c *ModelConfigAPI) Sequences() (params.ModelSequencesResult, error)

Sequences returns the model's sequence names and next values.

func (*ModelConfigAPI) SetSLALevel

func (c *ModelConfigAPI) SetSLALevel(args params.ModelSLA) error

SetSLALevel sets the sla level on the model.

type ModelConfigAPIV1

type ModelConfigAPIV1 struct {
	*ModelConfigAPIV2
}

ModelConfigAPIV1 hides V2 functionality

func NewFacadeV1

func NewFacadeV1(ctx facade.Context) (*ModelConfigAPIV1, error)

NewFacadeV1 is used for API registration.

func (*ModelConfigAPIV1) Sequences

func (a *ModelConfigAPIV1) Sequences(_, _ struct{})

Sequences isn't on the V1 API.

type ModelConfigAPIV2

type ModelConfigAPIV2 struct {
	*ModelConfigAPI
}

ModelConfigAPIV2 is currently the latest.

func NewFacadeV2

func NewFacadeV2(ctx facade.Context) (*ModelConfigAPIV2, error)

NewFacade is used for API registration.

func NewModelConfigAPI

func NewModelConfigAPI(backend Backend, authorizer facade.Authorizer) (*ModelConfigAPIV2, error)

NewModelConfigAPI creates a new instance of the ModelConfig Facade.

Jump to

Keyboard shortcuts

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