maas

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DeploymentStatusCall = deploymentStatusCall
	GetMAASController    = getMAASController
)

Functions

func IsAuthorisationFailure

func IsAuthorisationFailure(err error) bool

IsAuthorisationFailure determines if the given error has an authorisation failure.

func NewEnviron

func NewEnviron(ctx stdcontext.Context, cloud environscloudspec.CloudSpec, cfg *config.Config, getCaps Capabilities) (*maasEnviron, error)

func NewStorage

func NewStorage(env *maasEnviron) storage.Storage

Types

type Capabilities

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

Capabilities is an alias for a function that gets the capabilities of a MAAS installation.

type EnvironProvider

type EnvironProvider struct {

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

func (EnvironProvider) CloudSchema

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

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

func (EnvironProvider) ConfigDefaults

func (p EnvironProvider) ConfigDefaults() schema.Defaults

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

func (EnvironProvider) ConfigSchema

func (p EnvironProvider) ConfigSchema() schema.Fields

ConfigSchema returns extra config attributes specific to this provider only.

func (EnvironProvider) CredentialSchemas

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

CredentialSchemas is part of the environs.ProviderCredentials interface.

func (EnvironProvider) DetectCredentials

func (EnvironProvider) DetectCredentials(cloudName string) (*cloud.CloudCredential, error)

DetectCredentials is part of the environs.ProviderCredentials interface.

func (EnvironProvider) DetectRegions

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

DetectRegions is specified in the environs.CloudRegionDetector interface.

func (EnvironProvider) FinalizeCredential

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

FinalizeCredential is part of the environs.ProviderCredentials interface.

func (EnvironProvider) ModelConfigDefaults

func (p EnvironProvider) ModelConfigDefaults(_ context.Context) (map[string]any, error)

ModelConfigDefaults provides a set of default model config attributes that should be set on a models config if they have not been specified by the user.

func (EnvironProvider) Open

func (EnvironProvider) Ping

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

func (EnvironProvider) PrepareConfig

PrepareConfig is specified in the EnvironProvider interface.

func (EnvironProvider) Schema

Schema returns the configuration schema for an environment.

func (EnvironProvider) Validate

func (p EnvironProvider) Validate(ctx context.Context, cfg, oldCfg *config.Config) (*config.Config, error)

func (EnvironProvider) Version

func (EnvironProvider) Version() int

Version is part of the EnvironProvider interface.

type MAASRenderer

type MAASRenderer struct{}

func (MAASRenderer) Render

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

Jump to

Keyboard shortcuts

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