Documentation
¶
Index ¶
- Constants
- func DefaultICMPRules() []abstract.SecurityGroupRule
- func DefaultTCPRules(sshPort int32) []abstract.SecurityGroupRule
- func DefaultUDPRules() []abstract.SecurityGroupRule
- func ProvideCredentialsIfNeeded(request *abstract.HostRequest) (ferr fail.Error)
- func RetryableRemoteCall(inctx context.Context, callback func() error, ...) fail.Error
- func ValidateHostParameter(ctx context.Context, hostParam HostParameter) (ahf *abstract.HostFull, hostLabel string, ferr fail.Error)
- func ValidatePublicIParameter(pipParam PublicIPParameter) (apip *abstract.PublicIP, pipLabel string, _ fail.Error)
- func ValidateSecurityGroupParameter(sgParam SecurityGroupParameter) (asg *abstract.SecurityGroup, sgLabel string, _ fail.Error)
- type AWSConfiguration
- type AuthenticationOptions
- type AzureConfiguration
- type ConfigurationOptions
- type GCPConfiguration
- type HostParameter
- type PublicIPParameter
- type SecurityGroupParameter
- type TerraformOptions
Constants ¶
const ( DefaultNetworkCIDR = "192.168.0.0/16" // Contains the CIDR to use when none is provided AlphanumericWithDashesAndUnderscores string = "^[-a-zA-Z0-9-_]+$" )
AlphanumericWithDashesAndUnderscores is the regexp pattern to identify bucket names
Variables ¶
This section is empty.
Functions ¶
func DefaultICMPRules ¶
func DefaultICMPRules() []abstract.SecurityGroupRule
DefaultICMPRules creates ICMP rules inside the default security group egress: allow all, ingress: allow all
func DefaultTCPRules ¶
func DefaultTCPRules(sshPort int32) []abstract.SecurityGroupRule
DefaultTCPRules creates TCP rules to configure the default security group for public hosts egress: allow all, ingress: allow ssh only
func DefaultUDPRules ¶
func DefaultUDPRules() []abstract.SecurityGroupRule
DefaultUDPRules creates UDP rules to configure the default security group egress: allow all, ingress: deny all
func ProvideCredentialsIfNeeded ¶
func ProvideCredentialsIfNeeded(request *abstract.HostRequest) (ferr fail.Error)
ProvideCredentialsIfNeeded ...
func RetryableRemoteCall ¶
func RetryableRemoteCall(inctx context.Context, callback func() error, convertError func(error) fail.Error, options ...retry.Option) fail.Error
RetryableRemoteCall calls a remote API with tolerance to communication failures Remote API is done inside 'callback' parameter and returns remote error if necessary that 'convertError' function convert to SafeScale error
func ValidateHostParameter ¶
func ValidateHostParameter(ctx context.Context, hostParam HostParameter) (ahf *abstract.HostFull, hostLabel string, ferr fail.Error)
ValidateHostParameter validates host parameter that can be a string as ID or an *abstract.HostCore
func ValidatePublicIParameter ¶ added in v22.11.3
func ValidatePublicIParameter(pipParam PublicIPParameter) (apip *abstract.PublicIP, pipLabel string, _ fail.Error)
ValidatePublicIParameter validates 'pipParam' parameter, that can be a string as ID or an *abstract.PublicIP
func ValidateSecurityGroupParameter ¶
func ValidateSecurityGroupParameter(sgParam SecurityGroupParameter) (asg *abstract.SecurityGroup, sgLabel string, _ fail.Error)
ValidateSecurityGroupParameter validates securitygroup parameter that can be a string as ID or an *abstract.SecurityGroup
Types ¶
type AWSConfiguration ¶
type AWSConfiguration struct {
S3Endpoint string `json:"-"`
Ec2Endpoint string `json:"-"`
SsmEndpoint string `json:"-"`
Region string `json:"-"`
Zone string `json:"-"`
NetworkName string `json:"-"`
Owners []string `json:"-"`
}
AWSConfiguration AWS cloud platform configuration
type AuthenticationOptions ¶
type AuthenticationOptions struct {
// IdentityEndpoint specifies the HTTP endpoint that is required to work with
// the Identity API of the appropriate version. While it's ultimately needed by
// all the identity services, it will often be populated by a provider-level
// function.
IdentityEndpoint string
// Username is required if using Identity V2 API. Consult with your provider's
// control panel to discover your account's username. In Identity V3, either
// UserID or a combination of Username and DomainID or DomainName are needed.
Username, UserID, AccessKeyID string
// Exactly one of Password or APIKey is required for the Identity V2 and V3
// APIs. Consult with your provider's control panel to discover your account's
// preferred method of authentication.
Password, APIKey, SecretAccessKey string
// At most one of DomainID and DomainName must be provided if using Username
// with Identity V3. Otherwise, either are optional.
DomainID, DomainName string
// The TenantID and TenantName fields are optional for the Identity V2 API.
// Some providers allow you to specify a TenantName instead of the TenantId.
// Some require both. Your provider's authentication policies will determine
// how these fields influence authentication.
TenantID, TenantName string
// ProjectName ...
ProjectName, ProjectID string
// Azure mappings (+ TenantID)
ClientID, ClientSecret, SubscriptionID string
// AllowReauth should be set to true if you grant permission for Gophercloud to
// cache your credentials in memory, and to allow Gophercloud to attempt to
// re-authenticate automatically if/when your token expires. If you set it to
// false, it will not cache these settings, but re-authentication will not be
// possible. This setting defaults to false.
//
// NOTE: The reauth function will try to re-authenticate endlessly if left unchecked.
// The way to limit the number of attempts is to provide a custom HTTP client to the provider client
// and provide a transport that implements the RoundTripper interface and stores the number of failed retries.
// For an example of this, see here: https://github.com/gophercloud/rack/blob/1.0.0/auth/clients.go#L311
AllowReauth bool
// TokenID allows users to authenticate (possibly as another user) with an
// authentication token ID.
TokenID string
// Openstack region (data center) where the infrastructure will be created
Region string `valid:"alphanumwithdashesandunderscores,required"`
AvailabilityZone string `valid:"alphanumwithdashesandunderscores,required"`
// FloatingIPPool name of the floating IP pool
// Necessary only if UseFloatingIP is true
FloatingIPPool string
AK string
AS string
CK string
}
AuthenticationOptions fields are the union of those recognized by each identity implementation and provider to be able to carry different but necessary information to stack implementations
type AzureConfiguration ¶ added in v22.11.9
type AzureConfiguration struct {
Type string `json:"type" validate:"required"`
ClientID string `json:"client_id"`
Region string `json:"-"`
Zone string `json:"-"`
NetworkName string `json:"-"`
TFVersion string `json:"tf_version"`
ConsulURL string `json:"consul_url"`
WithConsul bool `json:"with_consul"`
ClientSecret string `json:"client_secret"`
TenantID string `json:"tenant_id"`
SubscriptionID string `json:"subscription_id"`
}
AzureConfiguration stores Google cloud platform configuration
type ConfigurationOptions ¶
type ConfigurationOptions struct {
// Name of the provider (external) network
ProviderNetwork string
// DNSList list of DNS
DNSList []string
// UseFloatingIP indicates if floating IP are used (optional)
UseFloatingIP bool
// UseLayer3Networking indicates if layer 3 networking features (router) can be used
// if UseFloatingIP is true UseLayer3Networking must be true
UseLayer3Networking bool
UseNATService bool
ProviderName string
BuildSubnets bool
// AutoHostNetworkInterfaces indicates if network interfaces are configured automatically by the provider or needs a post configuration
AutoHostNetworkInterfaces bool
// VolumeSpeeds map volume types with volume speeds
VolumeSpeeds map[string]volumespeed.Enum
// DefaultImage names the image to use when not specified by the user
DefaultImage string
// MetadataBucket contains the name of the Object Storage bucket that will store metadata
MetadataBucket string
// OperatorUsername contain the name of the safescale created user
OperatorUsername string
// DefaultSecurityGroupName contains the name of the default security group
DefaultSecurityGroupName string
DefaultNetworkName string // contains the name of the Networking/VPC that is used by default (corresponds to keywords 'DefaultNetworkName' or 'NetworkName' in tenant section 'compute')
DefaultNetworkCIDR string // contains the CIDR of the default Networking/VPC
MaxLifeTime int64
Safe bool
ConcurrentMachineCreationLimit int
Timings *temporal.MutableTimings
TerraformCfg TerraformOptions
}
ConfigurationOptions are the stack configuration options
type GCPConfiguration ¶
type GCPConfiguration struct {
Type string `json:"type" validate:"required"`
ProjectID string `json:"project_id"`
PrivateKeyID string `json:"private_key_id"`
PrivateKey string `json:"private_key"`
ClientEmail string `json:"client_email"`
ClientID string `json:"client_id"`
AuthURI string `json:"auth_uri"`
TokenURI string `json:"token_uri"`
AuthProvider string `json:"auth_provider_x509_cert_url"`
ClientCert string `json:"client_x509_cert_url"`
Region string `json:"-"`
Zone string `json:"-"`
NetworkName string `json:"-"`
}
GCPConfiguration stores Google cloud platform configuration
type HostParameter ¶
type HostParameter interface{}
HostParameter can represent a host by a string (containing name or id), an *abstract.HostCore or an *abstract.HostFull
type PublicIPParameter ¶ added in v22.11.3
type PublicIPParameter interface{}
PublicIPParameter can represent a PublicIP by a string as ID or an *abstract.PublicIP
type SecurityGroupParameter ¶
type SecurityGroupParameter interface{}
SecurityGroupParameter can represent a Security Group by a string as ID or an *abstract.SecurityGroup