Documentation ¶
Index ¶
- Variables
- func IsAuthorisationFailure(err error) bool
- func NewEnviron(ctx stdcontext.Context, cloud environscloudspec.CloudSpec, cfg *config.Config, ...) (*maasEnviron, error)
- func NewStorage(env *maasEnviron) storage.Storage
- type Capabilities
- type EnvironProvider
- func (p EnvironProvider) CloudSchema() *jsonschema.Schema
- func (p EnvironProvider) ConfigDefaults() schema.Defaults
- func (p EnvironProvider) ConfigSchema() schema.Fields
- func (EnvironProvider) CredentialSchemas() map[cloud.AuthType]cloud.CredentialSchema
- func (EnvironProvider) DetectCredentials(cloudName string) (*cloud.CloudCredential, error)
- func (p EnvironProvider) DetectRegions() ([]cloud.Region, error)
- func (EnvironProvider) FinalizeCredential(_ environs.FinalizeCredentialContext, args environs.FinalizeCredentialParams) (*cloud.Credential, error)
- func (p EnvironProvider) ModelConfigDefaults(_ context.Context) (map[string]any, error)
- func (EnvironProvider) Open(ctx stdcontext.Context, args environs.OpenParams) (environs.Environ, error)
- func (p EnvironProvider) Ping(ctx envcontext.ProviderCallContext, endpoint string) error
- func (p EnvironProvider) PrepareConfig(ctx context.Context, args environs.PrepareConfigParams) (*config.Config, error)
- func (EnvironProvider) Schema() environschema.Fields
- func (p EnvironProvider) Validate(ctx context.Context, cfg, oldCfg *config.Config) (*config.Config, error)
- func (EnvironProvider) Version() int
- type MAASRenderer
Constants ¶
This section is empty.
Variables ¶
var ( DeploymentStatusCall = deploymentStatusCall GetMAASController = getMAASController )
Functions ¶
func IsAuthorisationFailure ¶
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 ¶
Types ¶
type Capabilities ¶
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 ¶
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) Open(ctx stdcontext.Context, args environs.OpenParams) (environs.Environ, error)
func (EnvironProvider) Ping ¶
func (p EnvironProvider) Ping(ctx envcontext.ProviderCallContext, endpoint string) error
Ping tests the connection to the cloud, to verify the endpoint is valid.
func (EnvironProvider) PrepareConfig ¶
func (p EnvironProvider) PrepareConfig(ctx context.Context, args environs.PrepareConfigParams) (*config.Config, error)
PrepareConfig is specified in the EnvironProvider interface.
func (EnvironProvider) Schema ¶
func (EnvironProvider) Schema() environschema.Fields
Schema returns the configuration schema for an environment.
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)