Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReleaseNodes         = releaseNodes
	DeploymentStatusCall = deploymentStatusCall
	GetMAAS2Controller   = getMAAS2Controller
)

Functions

func IsAuthorisationFailure

func IsAuthorisationFailure(err error) bool

IsAuthorisationFailure determines if the given error has an authorisation failure.

func NewEnviron

func NewEnviron(cloud environscloudspec.CloudSpec, cfg *config.Config, getCaps MaasCapabilities) (*maasEnviron, error)

func NewStorage

func NewStorage(env *maasEnviron) storage.Storage

Types

type MAASRenderer

type MAASRenderer struct{}

func (MAASRenderer) Render

func (MAASRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error)

type MaasCapabilities

type MaasCapabilities func(client *gomaasapi.MAASObject, serverURL string) (set.Strings, error)

MaasCapabilities represents a function that gets the capabilities of a MAAS installation.

type MaasEnvironProvider

type MaasEnvironProvider struct {

	// GetCapabilities is a function that connects to MAAS to return its set of
	// capabilities.
	GetCapabilities MaasCapabilities // contains filtered or unexported fields

}

func (MaasEnvironProvider) CloudSchema

func (p MaasEnvironProvider) CloudSchema() *jsonschema.Schema

CloudSchema returns the schema for adding new clouds of this type.

func (MaasEnvironProvider) ConfigDefaults

func (p MaasEnvironProvider) ConfigDefaults() schema.Defaults

ConfigDefaults returns the default values for the provider specific config attributes.

func (MaasEnvironProvider) ConfigSchema

func (p MaasEnvironProvider) ConfigSchema() schema.Fields

ConfigSchema returns extra config attributes specific to this provider only.

func (MaasEnvironProvider) CredentialSchemas

func (MaasEnvironProvider) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema

CredentialSchemas is part of the environs.ProviderCredentials interface.

func (MaasEnvironProvider) DetectCredentials

func (MaasEnvironProvider) DetectCredentials() (*cloud.CloudCredential, error)

DetectCredentials is part of the environs.ProviderCredentials interface.

func (MaasEnvironProvider) DetectRegions

func (p MaasEnvironProvider) DetectRegions() ([]cloud.Region, error)

DetectRegions is specified in the environs.CloudRegionDetector interface.

func (MaasEnvironProvider) FinalizeCredential

func (MaasEnvironProvider) FinalizeCredential(_ environs.FinalizeCredentialContext, args environs.FinalizeCredentialParams) (*cloud.Credential, error)

FinalizeCredential is part of the environs.ProviderCredentials interface.

func (MaasEnvironProvider) Open

func (MaasEnvironProvider) Ping

Ping tests the connection to the cloud, to verify the endpoint is valid.

func (MaasEnvironProvider) PrepareConfig

PrepareConfig is specified in the EnvironProvider interface.

func (MaasEnvironProvider) Schema

Schema returns the configuration schema for an environment.

func (MaasEnvironProvider) Validate

func (prov MaasEnvironProvider) Validate(cfg, oldCfg *config.Config) (*config.Config, error)

func (MaasEnvironProvider) Version

func (MaasEnvironProvider) Version() int

Version is part of the EnvironProvider interface.