providers

package
v22.11.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	// PublicVirtualIP indicates if the provider has the capability to provide a Virtual IP with public IP address
	PublicVirtualIP bool
	// PrivateVirtualIP indicates if the provider has the capability to provide a Virtual IP with private IP address
	PrivateVirtualIP bool
	// Layer3Networking indicates if the provider uses Layer3 networking
	Layer3Networking bool
	// CanDisableSecurityGroup indicates if the provider supports to disable a Security Group
	CanDisableSecurityGroup bool
}

Capabilities represents key/value configuration.

type Config

type Config interface {
	// Config gets a string configuration value and a
	// bool indicating whether the value was present or not.
	Config(name string) (interface{}, bool)
	// Get is an alias to Config()
	Get(name string) (interface{}, bool)
	// Set sets the configuration name to specified value
	Set(name string, value interface{})
	// GetString returns a string corresponding to the key, empty string if it doesn't exist
	GetString(name string) string
	// GetSliceOfStrings returns a slice of strings corresponding to the key, empty string slice if it doesn't exist
	GetSliceOfStrings(name string) []string
	// GetMapOfStrings returns a string map of strings corresponding to the key, empty map if it doesn't exist
	GetMapOfStrings(name string) map[string]string
	// GetInteger returns an integer corresponding to the key, 0 if it doesn't exist
	GetInteger(name string) int
}

Config represents key/value configuration.

type ConfigMap

type ConfigMap map[string]interface{}

ConfigMap is a map[string]string that implements the Config method.

func (ConfigMap) Config

func (c ConfigMap) Config(name string) (interface{}, bool)

Config gets a string configuration value and a bool indicating whether the value was present or not.

func (ConfigMap) Get

func (c ConfigMap) Get(name string) (interface{}, bool)

Get is an alias to Config()

func (ConfigMap) GetInteger

func (c ConfigMap) GetInteger(name string) int

GetInteger returns an integer corresponding to the key, 0 if it doesn't exist

func (ConfigMap) GetMapOfStrings

func (c ConfigMap) GetMapOfStrings(name string) map[string]string

GetMapOfStrings returns a string map of strings corresponding to the key, empty map if it doesn't exist

func (ConfigMap) GetSliceOfStrings

func (c ConfigMap) GetSliceOfStrings(name string) []string

GetSliceOfStrings returns a string slice corresponding to the key, empty string slice if it doesn't exist

func (ConfigMap) GetString

func (c ConfigMap) GetString(name string) string

GetString returns a string corresponding to the key, empty string if it doesn't exist

func (ConfigMap) Set

func (c ConfigMap) Set(name string, value interface{})

Set sets name configuration to value

type Provider

type Provider interface {
	api.Stack

	// Build builds a new Client from configuration parameter and can be called from nil
	Build(map[string]interface{}) (Provider, fail.Error)

	// ListImages lists available OS images, all bool is unused here but used at upper levels to filter using whitelists and blacklists
	ListImages(ctx context.Context, all bool) ([]*abstract.Image, fail.Error)

	// ListTemplates lists available host templates, all bool is unused here but used at upper levels to filter using whitelists and blacklists, Host templates are sorted using Dominant Resource Fairness Algorithm
	ListTemplates(ctx context.Context, all bool) ([]*abstract.HostTemplate, fail.Error)

	// GetAuthenticationOptions returns authentication options as a Config
	GetAuthenticationOptions(ctx context.Context) (Config, fail.Error)

	// GetConfigurationOptions returns configuration options as a Config
	GetConfigurationOptions(ctx context.Context) (Config, fail.Error)

	GetName() (string, fail.Error)     // GetName returns the tenant name
	GetStack() (api.Stack, fail.Error) // Returns the stack object used by the provider. Use with caution

	GetRegexpsOfTemplatesWithGPU() ([]*regexp.Regexp, fail.Error)

	// GetCapabilities returns the capabilities of the provider
	GetCapabilities(ctx context.Context) (Capabilities, fail.Error)

	// GetTenantParameters returns the tenant parameters as read
	GetTenantParameters() (map[string]interface{}, fail.Error)
}

Provider is the interface to cloud stack It has to recall Stack api, to serve as Provider AND as Stack

type ProviderProxy

type ProviderProxy struct {
	Provider
	Name string
}

ProviderProxy ...

func (ProviderProxy) AddPublicIPToVIP

func (s ProviderProxy) AddPublicIPToVIP(ctx context.Context, ip *abstract.VirtualIP) (ferr fail.Error)

func (ProviderProxy) AddRuleToSecurityGroup

func (s ProviderProxy) AddRuleToSecurityGroup(ctx context.Context, sgParam stacks.SecurityGroupParameter, rule *abstract.SecurityGroupRule) (_ *abstract.SecurityGroup, ferr fail.Error)

func (ProviderProxy) BindHostToVIP

func (s ProviderProxy) BindHostToVIP(ctx context.Context, ip *abstract.VirtualIP, s2 string) (ferr fail.Error)

func (ProviderProxy) BindSecurityGroupToHost

func (s ProviderProxy) BindSecurityGroupToHost(ctx context.Context, sgParam stacks.SecurityGroupParameter, hostParam stacks.HostParameter) (ferr fail.Error)

func (ProviderProxy) Build

func (s ProviderProxy) Build(m map[string]interface{}) (_ Provider, ferr fail.Error)

func (ProviderProxy) ChangeSecurityGroupSecurity

func (s ProviderProxy) ChangeSecurityGroupSecurity(ctx context.Context, b bool, b2 bool, net string, s2 string) fail.Error

func (ProviderProxy) ClearHostStartupScript

func (s ProviderProxy) ClearHostStartupScript(ctx context.Context, parameter stacks.HostParameter) (ferr fail.Error)

func (ProviderProxy) ClearSecurityGroup

func (s ProviderProxy) ClearSecurityGroup(ctx context.Context, sgParam stacks.SecurityGroupParameter) (_ *abstract.SecurityGroup, ferr fail.Error)

func (ProviderProxy) CreateHost

func (s ProviderProxy) CreateHost(ctx context.Context, request abstract.HostRequest, extra interface{}) (_ *abstract.HostFull, _ *userdata.Content, ferr fail.Error)

func (ProviderProxy) CreateKeyPair

func (s ProviderProxy) CreateKeyPair(ctx context.Context, name string) (_ *abstract.KeyPair, ferr fail.Error)

func (ProviderProxy) CreateNetwork

func (s ProviderProxy) CreateNetwork(ctx context.Context, req abstract.NetworkRequest) (_ *abstract.Network, ferr fail.Error)

func (ProviderProxy) CreateSecurityGroup

func (s ProviderProxy) CreateSecurityGroup(ctx context.Context, networkRef, name, description string, rules abstract.SecurityGroupRules) (_ *abstract.SecurityGroup, ferr fail.Error)

func (ProviderProxy) CreateSubnet

func (s ProviderProxy) CreateSubnet(ctx context.Context, req abstract.SubnetRequest) (_ *abstract.Subnet, ferr fail.Error)

func (ProviderProxy) CreateVIP

func (s ProviderProxy) CreateVIP(ctx context.Context, networkID, subnetID, name string, securityGroups []string) (_ *abstract.VirtualIP, ferr fail.Error)

func (ProviderProxy) CreateVolume

func (s ProviderProxy) CreateVolume(ctx context.Context, request abstract.VolumeRequest) (_ *abstract.Volume, ferr fail.Error)

func (ProviderProxy) CreateVolumeAttachment

func (s ProviderProxy) CreateVolumeAttachment(ctx context.Context, request abstract.VolumeAttachmentRequest) (_ string, ferr fail.Error)

func (ProviderProxy) DeleteHost

func (s ProviderProxy) DeleteHost(ctx context.Context, parameter stacks.HostParameter) (ferr fail.Error)

func (ProviderProxy) DeleteKeyPair

func (s ProviderProxy) DeleteKeyPair(ctx context.Context, id string) (ferr fail.Error)

func (ProviderProxy) DeleteNetwork

func (s ProviderProxy) DeleteNetwork(ctx context.Context, id string) (ferr fail.Error)

func (ProviderProxy) DeleteRuleFromSecurityGroup

func (s ProviderProxy) DeleteRuleFromSecurityGroup(ctx context.Context, sgParam stacks.SecurityGroupParameter, rule *abstract.SecurityGroupRule) (_ *abstract.SecurityGroup, ferr fail.Error)

func (ProviderProxy) DeleteSecurityGroup

func (s ProviderProxy) DeleteSecurityGroup(ctx context.Context, group *abstract.SecurityGroup) (ferr fail.Error)

func (ProviderProxy) DeleteSubnet

func (s ProviderProxy) DeleteSubnet(ctx context.Context, id string) (ferr fail.Error)

func (ProviderProxy) DeleteVIP

func (s ProviderProxy) DeleteVIP(ctx context.Context, ip *abstract.VirtualIP) (ferr fail.Error)

func (ProviderProxy) DeleteVolume

func (s ProviderProxy) DeleteVolume(ctx context.Context, id string) (ferr fail.Error)

func (ProviderProxy) DeleteVolumeAttachment

func (s ProviderProxy) DeleteVolumeAttachment(ctx context.Context, serverID, id string) (ferr fail.Error)

func (ProviderProxy) ExportFromState added in v22.11.9

func (s ProviderProxy) ExportFromState(ctx context.Context, kind abstract.Enum, state *tfjson.State, input any, id string) (_ any, ferr fail.Error)

func (ProviderProxy) GetAuthenticationOptions

func (s ProviderProxy) GetAuthenticationOptions(ctx context.Context) (_ Config, ferr fail.Error)

func (ProviderProxy) GetCapabilities

func (s ProviderProxy) GetCapabilities(ctx context.Context) (_ Capabilities, ferr fail.Error)

func (ProviderProxy) GetConfigurationOptions

func (s ProviderProxy) GetConfigurationOptions(ctx context.Context) (_ Config, ferr fail.Error)

func (ProviderProxy) GetDefaultNetwork

func (s ProviderProxy) GetDefaultNetwork(ctx context.Context) (_ *abstract.Network, ferr fail.Error)

func (ProviderProxy) GetDefaultSecurityGroupName

func (s ProviderProxy) GetDefaultSecurityGroupName(ctx context.Context) (_ string, ferr fail.Error)

func (ProviderProxy) GetHostState

func (s ProviderProxy) GetHostState(ctx context.Context, parameter stacks.HostParameter) (_ hoststate.Enum, ferr fail.Error)

func (ProviderProxy) GetName

func (s ProviderProxy) GetName() (_ string, ferr fail.Error)

func (ProviderProxy) GetRawAuthenticationOptions

func (s ProviderProxy) GetRawAuthenticationOptions(ctx context.Context) (_ stacks.AuthenticationOptions, ferr fail.Error)

func (ProviderProxy) GetRawConfigurationOptions

func (s ProviderProxy) GetRawConfigurationOptions(ctx context.Context) (_ stacks.ConfigurationOptions, ferr fail.Error)

func (ProviderProxy) GetRegexpsOfTemplatesWithGPU

func (s ProviderProxy) GetRegexpsOfTemplatesWithGPU() (_ []*regexp.Regexp, ferr fail.Error)

func (ProviderProxy) GetStack

func (s ProviderProxy) GetStack() (_ api.Stack, ferr fail.Error)

func (ProviderProxy) GetStackName

func (s ProviderProxy) GetStackName() (_ string, ferr fail.Error)

func (ProviderProxy) GetTenantParameters

func (s ProviderProxy) GetTenantParameters() (_ map[string]interface{}, ferr fail.Error)

func (ProviderProxy) GetTerraformState added in v22.11.9

func (s ProviderProxy) GetTerraformState(ctx context.Context) (_ *tfjson.State, ferr fail.Error)

func (ProviderProxy) GetType added in v22.11.8

func (s ProviderProxy) GetType() (_ string, ferr fail.Error)

func (ProviderProxy) HasDefaultNetwork

func (s ProviderProxy) HasDefaultNetwork(ctx context.Context) (_ bool, ferr fail.Error)

func (ProviderProxy) InspectHost

func (s ProviderProxy) InspectHost(ctx context.Context, parameter stacks.HostParameter) (_ *abstract.HostFull, ferr fail.Error)

func (ProviderProxy) InspectImage

func (s ProviderProxy) InspectImage(ctx context.Context, id string) (_ *abstract.Image, ferr fail.Error)

func (ProviderProxy) InspectKeyPair

func (s ProviderProxy) InspectKeyPair(ctx context.Context, id string) (_ *abstract.KeyPair, ferr fail.Error)

func (ProviderProxy) InspectNetwork

func (s ProviderProxy) InspectNetwork(ctx context.Context, id string) (_ *abstract.Network, ferr fail.Error)

func (ProviderProxy) InspectNetworkByName

func (s ProviderProxy) InspectNetworkByName(ctx context.Context, name string) (_ *abstract.Network, ferr fail.Error)

func (ProviderProxy) InspectSecurityGroup

func (s ProviderProxy) InspectSecurityGroup(ctx context.Context, sgParam stacks.SecurityGroupParameter) (_ *abstract.SecurityGroup, ferr fail.Error)

func (ProviderProxy) InspectSubnet

func (s ProviderProxy) InspectSubnet(ctx context.Context, id string) (_ *abstract.Subnet, ferr fail.Error)

func (ProviderProxy) InspectSubnetByName

func (s ProviderProxy) InspectSubnetByName(ctx context.Context, networkID, name string) (_ *abstract.Subnet, ferr fail.Error)

func (ProviderProxy) InspectTemplate

func (s ProviderProxy) InspectTemplate(ctx context.Context, id string) (_ *abstract.HostTemplate, ferr fail.Error)

func (ProviderProxy) InspectVolume

func (s ProviderProxy) InspectVolume(ctx context.Context, id string) (_ *abstract.Volume, ferr fail.Error)

func (ProviderProxy) InspectVolumeAttachment

func (s ProviderProxy) InspectVolumeAttachment(ctx context.Context, serverID, id string) (_ *abstract.VolumeAttachment, ferr fail.Error)

func (ProviderProxy) ListAvailabilityZones

func (s ProviderProxy) ListAvailabilityZones(ctx context.Context) (_ map[string]bool, ferr fail.Error)

func (ProviderProxy) ListHosts

func (s ProviderProxy) ListHosts(ctx context.Context, b bool) (_ abstract.HostList, ferr fail.Error)

func (ProviderProxy) ListImages

func (s ProviderProxy) ListImages(ctx context.Context, all bool) (_ []*abstract.Image, ferr fail.Error)

func (ProviderProxy) ListKeyPairs

func (s ProviderProxy) ListKeyPairs(ctx context.Context) (_ []*abstract.KeyPair, ferr fail.Error)

func (ProviderProxy) ListNetworks

func (s ProviderProxy) ListNetworks(ctx context.Context) (_ []*abstract.Network, ferr fail.Error)

func (ProviderProxy) ListRegions

func (s ProviderProxy) ListRegions(ctx context.Context) (_ []string, ferr fail.Error)

func (ProviderProxy) ListSecurityGroups

func (s ProviderProxy) ListSecurityGroups(ctx context.Context, networkRef string) (_ []*abstract.SecurityGroup, ferr fail.Error)

func (ProviderProxy) ListSubnets

func (s ProviderProxy) ListSubnets(ctx context.Context, networkID string) (_ []*abstract.Subnet, ferr fail.Error)

func (ProviderProxy) ListTemplates

func (s ProviderProxy) ListTemplates(ctx context.Context, all bool) (_ []*abstract.HostTemplate, ferr fail.Error)

func (ProviderProxy) ListVolumeAttachments

func (s ProviderProxy) ListVolumeAttachments(ctx context.Context, serverID string) (_ []*abstract.VolumeAttachment, ferr fail.Error)

func (ProviderProxy) ListVolumes

func (s ProviderProxy) ListVolumes(ctx context.Context) (_ []*abstract.Volume, ferr fail.Error)

func (ProviderProxy) RebootHost

func (s ProviderProxy) RebootHost(ctx context.Context, parameter stacks.HostParameter) (ferr fail.Error)

func (ProviderProxy) Render added in v22.11.9

func (s ProviderProxy) Render(ctx context.Context, kind abstract.Enum, workDir string, options map[string]any) (_ []abstract.RenderedContent, ferr fail.Error)

func (ProviderProxy) StartHost

func (s ProviderProxy) StartHost(ctx context.Context, parameter stacks.HostParameter) (ferr fail.Error)

func (ProviderProxy) StopHost

func (s ProviderProxy) StopHost(ctx context.Context, host stacks.HostParameter, gracefully bool) (ferr fail.Error)

func (ProviderProxy) UnbindHostFromVIP

func (s ProviderProxy) UnbindHostFromVIP(ctx context.Context, ip *abstract.VirtualIP, s2 string) (ferr fail.Error)

func (ProviderProxy) UnbindSecurityGroupFromHost

func (s ProviderProxy) UnbindSecurityGroupFromHost(ctx context.Context, sgParam stacks.SecurityGroupParameter, hostParam stacks.HostParameter) (ferr fail.Error)

func (ProviderProxy) WaitHostReady

func (s ProviderProxy) WaitHostReady(ctx context.Context, hostParam stacks.HostParameter, timeout time.Duration) (_ *abstract.HostCore, ferr fail.Error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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