Documentation ¶
Overview ¶
Package abstract defines structures that will contain abstracted information of resources
Index ¶
- Constants
- func IsProvisioningError(err error) bool
- func ResourceDuplicateError(resource, name string) fail.Error
- func ResourceForbiddenError(resource, name string) fail.Error
- func ResourceInvalidRequestError(resource, reason string) fail.Error
- func ResourceNotAvailableError(resource, name string) fail.Error
- func ResourceNotFoundError(resource, name string) fail.Error
- func ResourceTimeoutError(resource, name string, dur time.Duration) fail.Error
- type ClusterIdentity
- func (instance ClusterIdentity) Clone() (data.Clonable, error)
- func (instance *ClusterIdentity) Deserialize(buf []byte) (ferr fail.Error)
- func (instance ClusterIdentity) GetID() (string, error)
- func (instance ClusterIdentity) GetName() string
- func (instance *ClusterIdentity) IsNull() bool
- func (instance ClusterIdentity) OK() bool
- func (instance *ClusterIdentity) Replace(p data.Clonable) (data.Clonable, error)
- func (instance *ClusterIdentity) Serialize() ([]byte, fail.Error)
- type ClusterRequest
- type Config
- type ConfigMap
- func (c ConfigMap) Config(name string) (interface{}, bool)
- func (c ConfigMap) Get(name string) (interface{}, bool)
- func (c ConfigMap) GetInteger(name string) int
- func (c ConfigMap) GetMapOfStrings(name string) map[string]string
- func (c ConfigMap) GetSliceOfStrings(name string) []string
- func (c ConfigMap) GetString(name string) string
- func (c ConfigMap) Set(name string, value interface{})
- type Enum
- type HostCore
- func (hc HostCore) Clone() (data.Clonable, error)
- func (hc *HostCore) Deserialize(buf []byte) (ferr fail.Error)
- func (hc *HostCore) GetID() (string, error)
- func (hc *HostCore) GetName() string
- func (hc *HostCore) IsConsistent() bool
- func (hc *HostCore) IsNull() bool
- func (hc *HostCore) OK() bool
- func (hc *HostCore) Replace(p data.Clonable) (data.Clonable, error)
- func (hc *HostCore) Serialize() ([]byte, fail.Error)
- func (hc *HostCore) SetID(id string) *HostCore
- func (hc *HostCore) SetName(name string) *HostCore
- type HostDescription
- type HostEffectiveSizing
- type HostFull
- type HostList
- type HostNetworking
- type HostRequest
- type HostSizingRequirements
- type HostTemplate
- type Image
- type KeyPair
- type Label
- func (t Label) Clone() (data.Clonable, error)
- func (t *Label) Deserialize(buf []byte) (ferr fail.Error)
- func (t *Label) GetID() (string, error)
- func (t *Label) GetName() string
- func (t *Label) IsNull() bool
- func (t *Label) IsTag() bool
- func (t Label) OK() bool
- func (t *Label) Replace(p data.Clonable) (data.Clonable, error)
- func (t *Label) Serialize() ([]byte, fail.Error)
- func (t *Label) Valid() bool
- type Network
- func (n Network) Clone() (data.Clonable, error)
- func (n *Network) Deserialize(buf []byte) (ferr fail.Error)
- func (n *Network) GetID() (string, error)
- func (n *Network) GetName() string
- func (n *Network) IsNull() bool
- func (n *Network) OK() bool
- func (n *Network) Replace(p data.Clonable) (data.Clonable, error)
- func (n *Network) Serialize() ([]byte, fail.Error)
- type NetworkRequest
- type ObjectStorageBucket
- func (instance ObjectStorageBucket) Clone() (data.Clonable, error)
- func (instance *ObjectStorageBucket) Deserialize(buf []byte) (ferr fail.Error)
- func (instance ObjectStorageBucket) GetID() (string, error)
- func (instance ObjectStorageBucket) GetName() string
- func (instance ObjectStorageBucket) IsConsistent() bool
- func (instance *ObjectStorageBucket) IsNull() bool
- func (instance ObjectStorageBucket) OK() bool
- func (instance *ObjectStorageBucket) Replace(p data.Clonable) (data.Clonable, error)
- func (instance *ObjectStorageBucket) Serialize() ([]byte, fail.Error)
- type ObjectStorageItem
- type ObjectStorageItemMetadata
- type PublicIP
- func (pip PublicIP) Clone() (data.Clonable, error)
- func (pip *PublicIP) Deserialize(buf []byte) (ferr fail.Error)
- func (pip *PublicIP) GetID() string
- func (pip *PublicIP) GetName() string
- func (pip *PublicIP) IsNull() bool
- func (pip *PublicIP) OK() bool
- func (pip *PublicIP) Replace(p data.Clonable) (data.Clonable, error)
- func (pip *PublicIP) Serialize() ([]byte, fail.Error)
- type PublicIPRequest
- type RenderedContent
- type SecurityGroup
- func (instance SecurityGroup) Clone() (data.Clonable, error)
- func (instance *SecurityGroup) Deserialize(buf []byte) (ferr fail.Error)
- func (instance *SecurityGroup) GetID() (string, error)
- func (instance *SecurityGroup) GetName() string
- func (instance *SecurityGroup) GetNetworkID() string
- func (instance SecurityGroup) IsComplete() bool
- func (instance SecurityGroup) IsConsistent() bool
- func (instance *SecurityGroup) IsNull() bool
- func (instance *SecurityGroup) RemoveRuleByIndex(index int) fail.Error
- func (instance *SecurityGroup) Replace(p data.Clonable) (data.Clonable, error)
- func (instance *SecurityGroup) Serialize() ([]byte, fail.Error)
- func (instance *SecurityGroup) SetID(id string) *SecurityGroup
- func (instance *SecurityGroup) SetName(name string) *SecurityGroup
- func (instance *SecurityGroup) SetNetworkID(networkID string) *SecurityGroup
- type SecurityGroupRule
- func (instance *SecurityGroupRule) Clone() (data.Clonable, error)
- func (instance *SecurityGroupRule) EqualTo(in *SecurityGroupRule) bool
- func (instance *SecurityGroupRule) EquivalentTo(in *SecurityGroupRule) bool
- func (instance *SecurityGroupRule) IsNull() bool
- func (instance *SecurityGroupRule) Replace(p data.Clonable) (data.Clonable, error)
- func (instance *SecurityGroupRule) SourcesConcernGroups() (bool, fail.Error)
- func (instance *SecurityGroupRule) TargetsConcernGroups() (bool, fail.Error)
- func (instance *SecurityGroupRule) Validate() fail.Error
- type SecurityGroupRules
- type Serializable
- type StoredCPUInfo
- type SubNetwork
- type Subnet
- func (s Subnet) Clone() (data.Clonable, error)
- func (s *Subnet) Deserialize(buf []byte) (ferr fail.Error)
- func (s *Subnet) GetCIDR() string
- func (s *Subnet) GetID() (string, error)
- func (s *Subnet) GetName() string
- func (s *Subnet) IsNull() bool
- func (s *Subnet) OK() bool
- func (s *Subnet) Replace(p data.Clonable) (data.Clonable, error)
- func (s *Subnet) Serialize() ([]byte, fail.Error)
- type SubnetRequest
- type VirtualIP
- type Volume
- func (v Volume) Clone() (data.Clonable, error)
- func (v *Volume) Deserialize(buf []byte) (ferr fail.Error)
- func (v *Volume) GetID() (string, error)
- func (v *Volume) GetName() string
- func (v *Volume) IsNull() bool
- func (v *Volume) OK() bool
- func (v *Volume) Replace(p data.Clonable) (data.Clonable, error)
- func (v *Volume) Serialize() ([]byte, fail.Error)
- type VolumeAttachment
- type VolumeAttachmentRequest
- type VolumeRequest
Constants ¶
const ( // DefaultUser Default Host user DefaultUser = "safescale" // DefaultVolumeMountPoint Default mount point for volumes DefaultVolumeMountPoint = "/data/" // DefaultBucketMountPoint Default mount point for containers DefaultBucketMountPoint = "/buckets/" DefaultShareExportedPath = "/shared/data" DefaultShareMountPath = "/shared" )
Default values
const (
SingleHostNetworkCIDR = "10.42.0.0/16"
)
Variables ¶
This section is empty.
Functions ¶
func IsProvisioningError ¶
IsProvisioningError detects provisioning errors
func ResourceDuplicateError ¶
ResourceDuplicateError creates a ResourceAlreadyExists error
func ResourceForbiddenError ¶
ResourceForbiddenError creates a ErrResourceForbidden error
func ResourceInvalidRequestError ¶
ResourceInvalidRequestError creates a ErrResourceInvalidRequest error
func ResourceNotAvailableError ¶
ResourceNotAvailableError creates a ResourceNotAvailable error
func ResourceNotFoundError ¶
ResourceNotFoundError creates a ErrNotFound error
Types ¶
type ClusterIdentity ¶
type ClusterIdentity struct { Name string `json:"name"` // Name is the name of the cluster Flavor clusterflavor.Enum `json:"flavor"` // Flavor tells what kind of cluster it is Complexity clustercomplexity.Enum `json:"complexity"` // Complexity is the mode of cluster Keypair *KeyPair `json:"keypair"` // Keypair contains the key-pair used inside the Cluster AdminPassword string `json:"admin_password"` // contains the password of the cladm account Tags map[string]string `json:"tags,omitempty"` ID string `json:"ID"` }
ClusterIdentity contains the bare minimum information about a cluster
func (ClusterIdentity) Clone ¶
func (instance ClusterIdentity) Clone() (data.Clonable, error)
Clone makes a copy of the instance satisfies interface data.Clonable
func (*ClusterIdentity) Deserialize ¶
func (instance *ClusterIdentity) Deserialize(buf []byte) (ferr fail.Error)
Deserialize reads json code and reinstantiates a ClusterIdentity
func (ClusterIdentity) GetID ¶
func (instance ClusterIdentity) GetID() (string, error)
GetID returns the ID of the cluster Satisfies interface data.Identifiable
func (ClusterIdentity) GetName ¶
func (instance ClusterIdentity) GetName() string
GetName returns the name of the cluster Satisfies interface data.Identifiable
type ClusterRequest ¶
type ClusterRequest struct { Name string // contains the name of the cluster wanted CIDR string // defines the network to create Domain string // ... Complexity clustercomplexity.Enum // is the implementation wanted, can be Small, Normal or Large Flavor clusterflavor.Enum // tells what kind of cluster to create NetworkID string // is the ID of the network to use; may be empty and in this case a new Network will be created Tenant string // contains the name of the tenant KeepOnFailure bool // tells if resources have to be kept in case of failure (for further analysis) GatewaysDef HostSizingRequirements // sizing of gateways MastersDef HostSizingRequirements // sizing of Masters NodesDef HostSizingRequirements // sizing of nodes InitialNodeCount uint // contains the initial count of nodes to create (cannot be less than flavor requirement) InitialMasterCount uint OS string // contains the name of the linux distribution wanted DisabledDefaultFeatures map[string]struct{} // contains the list of features that should be installed by default, but we don't want actually Force bool // set to True in order to ignore sizing recommendations FeatureParameters []string // contains parameter values of automatically installed Features DefaultSshPort uint // default ssh port for gateways // nolint Enabled []string // enabled features OperatorUsername string // username of the operator }
ClusterRequest defines what kind of Cluster is wanted
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 ¶
Config gets a string configuration value and a bool indicating whether the value was present or not.
func (ConfigMap) GetInteger ¶
GetInteger returns an integer corresponding to the key, 0 if it doesn't exist
func (ConfigMap) GetMapOfStrings ¶
GetMapOfStrings returns a string map of strings corresponding to the key, empty map if it doesn't exist
func (ConfigMap) GetSliceOfStrings ¶
GetSliceOfStrings returns a string slice corresponding to the key, empty string slice if it doesn't exist
type Enum ¶
type Enum int
Enum ...
const ( UnknownResource Enum = iota ClusterResource HostResource LabelResource NetworkResource ObjectStorageBucketResource SecurityGroupResource SubnetResource VolumeResource FeatureResource VariableResource InitScript ProviderResource FirewallResource CustomResource GwInitScript OutputResource FirewallRuleResource VolumeAttachmentResource NicResource )
type HostCore ¶
type HostCore struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` PrivateKey string `json:"private_key,omitempty"` SSHPort uint32 `json:"ssh_port,omitempty"` Password string `json:"password,omitempty"` LastState hoststate.Enum `json:"last_state"` // Do not enable "omitempty", if state is "stopped", int value is 0, recognize as "not set" value during Serialize ProvisioningState hoststate.Enum `json:"provisioning_state"` // Do not enable "omitempty", if state is "stopped", int value is 0, recognize as "not set" value during Serialize Tags map[string]string `json:"tags,omitempty"` }
HostCore contains the core information about a host This information should not change over time, but IT ACTUALLY happens
func (*HostCore) Deserialize ¶
Deserialize reads json code and instantiates an Host
func (*HostCore) GetName ¶
GetName returns the name of the host Satisfies interface data.Identifiable
func (*HostCore) IsConsistent ¶
IsConsistent tells if host struct is consistent
type HostDescription ¶
type HostDescription struct { Created time.Time `json:"created,omitempty"` // tells when the host has been created Creator string `json:"creator,omitempty"` // contains information (forged) about the creator of a host Updated time.Time `json:"modified,omitempty"` // tells the last time the host has been modified Purpose string `json:"purpose,omitempty"` // contains a description of the use of a host Tenant string `json:"tenant"` // contains the tenant name used to create the host }
HostDescription contains description information for the host
type HostEffectiveSizing ¶
type HostEffectiveSizing struct { Cores int `json:"cores,omitempty"` RAMSize float32 `json:"ram_size,omitempty"` DiskSize int `json:"disk_size,omitempty"` GPUNumber int `json:"gpu_number,omitempty"` GPUType string `json:"gpu_type,omitempty"` CPUFreq float32 `json:"cpu_freq,omitempty"` ImageID string `json:"image_id,omitempty"` }
HostEffectiveSizing ...
func NewHostEffectiveSizing ¶
func NewHostEffectiveSizing() *HostEffectiveSizing
NewHostEffectiveSizing ...
func (*HostEffectiveSizing) IsNull ¶
func (hse *HostEffectiveSizing) IsNull() bool
type HostFull ¶
type HostFull struct { Core *HostCore Sizing *HostEffectiveSizing Networking *HostNetworking Description *HostDescription CurrentState hoststate.Enum `json:"current_state"` }
HostFull groups information about host coming from provider
func (*HostFull) GetName ¶
GetName returns the name of the host satisfies interface data.Identifiable
func (*HostFull) IsConsistent ¶
IsConsistent returns true if the struct is consistent
type HostNetworking ¶
type HostNetworking struct { IsGateway bool `json:"is_gateway,omitempty"` // Tells if host is a gateway of a network DefaultGatewayID string `json:"default_gateway_id,omitempty"` // DEPRECATED: contains the ID of the default gateway DefaultGatewayPrivateIP string `json:"default_gateway_private_ip,omitempty"` // DEPRECATED: contains the private IP of the default gateway DefaultSubnetID string `json:"default_network_id,omitempty"` // contains the ID of the default subnet SubnetsByID map[string]string `json:"networks_by_id,omitempty"` // contains the name of each subnet bound to the host (indexed by ID) SubnetsByName map[string]string `json:"networks_by_name,omitempty"` // contains the ID of each subnet bound to the host (indexed by name) PublicIPv4 string `json:"public_ip_v4,omitempty"` PublicIPv6 string `json:"public_ip_v6,omitempty"` IPv4Addresses map[string]string `json:"ipv4_addresses,omitempty"` // contains ipv4 (indexed by subnet ID) allocated to the host IPv6Addresses map[string]string `json:"ipv6_addresses,omitempty"` // contains ipv6 (indexed by subnet ID) allocated to the host }
HostNetworking contains subnets information related to Host
func NewHostNetworking ¶
func NewHostNetworking() *HostNetworking
NewHostNetworking creates a new instance of HostNetworking
type HostRequest ¶
type HostRequest struct { ResourceName string // ResourceName contains the name of the compute resource HostName string // HostName contains the hostname on the system (if empty, will use ResourceName) Subnets []*Subnet // lists the Subnets the host must be connected to SubnetNames []string // SubnetNames lists the names of the Subnets the host must be connected to DefaultRouteIP string // DefaultRouteIP is the IP used as default route TemplateID string // TemplateID is ID of the template used to size the host (see SelectTemplates) TemplateRef string // TemplateRef is the name or ID of the template used to size the host (see SelectTemplates) ImageID string // ImageID is the ID of the image that contains the server's OS and initial state. ImageRef string // ImageRef is the original reference of the image requested KeyPair *KeyPair // KeyPair is the (optional) specific KeyPair to use (if not provided, a new KeyPair will be generated) SSHPort uint32 // contains the port to use for SSH Password string // Password contains the password of OperatorUsername account, usable on host console only DiskSize int // DiskSize allows asking for a specific size for system disk (in GB) Single bool // Single tells if the Host is single PublicIP bool // PublicIP a flag telling if the host must have a public IP IsGateway bool // IsGateway tells if the host will act as a gateway KeepOnFailure bool // KeepOnFailure tells if resource must be kept on failure SecurityGroupIDs map[string]struct{} // List of Security Groups to attach to Host (using map as dict) }
HostRequest represents requirements to create host
type HostSizingRequirements ¶
type HostSizingRequirements struct { MinCores int MaxCores int MinRAMSize float32 MaxRAMSize float32 MinDiskSize int MaxDiskSize int MinGPU int MinCPUFreq float32 Image string Template string // if != "", describes the template to use and disables the use of other fields }
HostSizingRequirements represents host sizing requirements to fulfill
func (HostSizingRequirements) Equals ¶
func (hsr HostSizingRequirements) Equals(in HostSizingRequirements) bool
func (*HostSizingRequirements) LowerOrEqualThan ¶
func (hsr *HostSizingRequirements) LowerOrEqualThan(y *HostSizingRequirements) (bool, error)
LowerOrEqualThan compares host sizing requirements, returns true if hsr requirements are lower or equal than y
func (*HostSizingRequirements) LowerThan ¶
func (hsr *HostSizingRequirements) LowerThan(y *HostSizingRequirements) (bool, error)
LowerThan compares host sizing requirements, returns true if hsr requirements are lower than y
type HostTemplate ¶
type HostTemplate struct { Cores int `json:"cores,omitempty"` RAMSize float32 `json:"ram_size,omitempty"` DiskSize int `json:"disk_size,omitempty"` GPUNumber int `json:"gpu_number,omitempty"` GPUType string `json:"gpu_type,omitempty"` CPUFreq float32 `json:"cpu_freq,omitempty"` CPUPerf float32 `json:"cpu_perf,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` }
HostTemplate ...
type Image ¶
type Image struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Description string `json:"description,omitempty"` StorageType string `json:"storage_type,omitempty"` DiskSize int64 `json:"disk_size_Gb,omitempty"` Publisher string `json:"publisher,omitempty"` Offer string `json:"offer,omitempty"` Sku string `json:"sku,omitempty"` }
Image represents an OS image
type KeyPair ¶
type KeyPair struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` PrivateKey string `json:"private_key"` PublicKey string `json:"public_key"` }
KeyPair represents a SSH key pair
func NewKeyPair ¶
NewKeyPair creates a *resources.KeyPair
type Label ¶
type Label struct { ID string `json:"id"` Name string `json:"name"` HasDefault bool `json:"has_default"` // if false, this represents a Tag DefaultValue string `json:"default_value,omitempty"` }
func (*Label) Deserialize ¶
Deserialize reads json code and restores a Tag
type Network ¶
type Network struct { ID string `json:"id"` // ID for the network (from provider) Name string `json:"name"` // name of the network CIDR string `json:"mask"` // network in CIDR notation (if it has a meaning...) DNSServers []string `json:"dns_servers,omitempty"` // list of dns servers to be used inside the Network/VPC Imported bool `json:"imported,omitempty"` // tells if the Network has been imported (making it not deletable by SafeScale) Tags map[string]string `json:"tags,omitempty"` Domain string `json:"domain,omitempty"` // DEPRECATED: contains the domain used to define host FQDN GatewayID string `json:"gateway_id,omitempty"` // DEPRECATED: contains the id of the host acting as primary gateway for the network SecondaryGatewayID string `json:"secondary_gateway_id,omitempty"` // DEPRECATED: contains the id of the host acting as secondary gateway for the network VIP *VirtualIP `json:"vip,omitempty"` // DEPRECATED: contains the VIP of the network if created with HA IPVersion ipversion.Enum `json:"ip_version,omitempty"` // DEPRECATED: IPVersion is IPv4 or IPv6 (see IPVersion) Subnetworks []SubNetwork `json:"subnetworks,omitempty"` // DEPRECATED: deprecated }
Network represents a virtual network
func (*Network) Deserialize ¶
Deserialize reads json code and reinstantiates a Network
type NetworkRequest ¶
type NetworkRequest struct { Name string // contains name of Network/VPC CIDR string // contains the CIDR of the Network/VPC DNSServers []string // list of dns servers to be used inside the Network/VPC KeepOnFailure bool // KeepOnFailure tells if resources have to be kept in case of failure (default behavior is to delete them) }
NetworkRequest represents network requirements to create a network/VPC where CIDR contains a non-routable network like "192.0.2.0/24" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291.
type ObjectStorageBucket ¶
type ObjectStorageBucket struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Host string `json:"host,omitempty"` MountPoint string `json:"mountPoint,omitempty"` }
ObjectStorageBucket abstracts an Objet Storage container (also known as bucket in some implementations)
func NewObjectStorageBucket ¶
func NewObjectStorageBucket() *ObjectStorageBucket
NewObjectStorageBucket ...
func (ObjectStorageBucket) Clone ¶
func (instance ObjectStorageBucket) Clone() (data.Clonable, error)
Clone does a deep-copy of the Host
satisfies interface data.Clonable
func (*ObjectStorageBucket) Deserialize ¶
func (instance *ObjectStorageBucket) Deserialize(buf []byte) (ferr fail.Error)
Deserialize reads json code and instantiates an ObjectStorageItem
func (ObjectStorageBucket) GetID ¶
func (instance ObjectStorageBucket) GetID() (string, error)
GetID returns the ID of the host Satisfies interface data.Identifiable
func (ObjectStorageBucket) GetName ¶
func (instance ObjectStorageBucket) GetName() string
GetName name returns the name of the host Satisfies interface data.Identifiable
func (ObjectStorageBucket) IsConsistent ¶
func (instance ObjectStorageBucket) IsConsistent() bool
IsConsistent tells if host struct is consistent
func (*ObjectStorageBucket) IsNull ¶
func (instance *ObjectStorageBucket) IsNull() bool
type ObjectStorageItem ¶
type ObjectStorageItem struct { BucketName string ItemID string ItemName string Metadata ObjectStorageItemMetadata }
ObjectStorageItem is an abstracted representation of an object in object storage
func (ObjectStorageItem) GetID ¶
func (osi ObjectStorageItem) GetID() (string, error)
GetID returns the ID of the host Satisfies interface data.Identifiable
func (ObjectStorageItem) GetName ¶
func (osi ObjectStorageItem) GetName() string
GetName returns the name of the host Satisfies interface data.Identifiable
type ObjectStorageItemMetadata ¶
type ObjectStorageItemMetadata map[string]interface{}
ObjectStorageItemMetadata ...
func (ObjectStorageItemMetadata) Clone ¶
func (osim ObjectStorageItemMetadata) Clone() ObjectStorageItemMetadata
Clone creates a copy of ObjectMetadata
type PublicIP ¶ added in v22.11.3
type PublicIP struct { ID string `json:"id"` Name string `json:"name"` // == IP Kind ipversion.Enum `json:"kind,omitempty"` Description string `json:"description,omitempty"` MacAddress string `json:"mac_address;omitempty"` Tags map[string]string `json:"tags,omitempty"` }
PublicIP represents a public IP
func (*PublicIP) Deserialize ¶ added in v22.11.3
Deserialize reads json code and restores a Volume
func (*PublicIP) GetID ¶ added in v22.11.3
GetID returns the ID of the volume Satisfies interface data.Identifiable
func (*PublicIP) GetName ¶ added in v22.11.3
GetName returns the name of the volume Satisfies interface data.Identifiable
type PublicIPRequest ¶ added in v22.11.3
type PublicIPRequest struct { Name string `json:"name"` Kind ipversion.Enum `json:"kind,omitempty"` }
PublicIPRequest represents a PublicIP request
type RenderedContent ¶ added in v22.11.9
type SecurityGroup ¶
type SecurityGroup struct { ID string `json:"id"` // ID of the group Name string `json:"name"` // name of the group Network string `json:"network,omitempty"` // Contains the ID of the Network owning the Security Group Description string `json:"description,omitempty"` // description of the group Rules SecurityGroupRules `json:"rules"` // rules of the Security Group DefaultForSubnet string `json:"default_for_subnets"` // lists the ID of the subnet for which this SecurityGroup is considered as default (to be able to prevent removal of Subnet default Security Group until removal of the Subnet itself) DefaultForHost string `json:"default_for_hosts"` // lists the ID of the host for which this SecurityGroup is considered as default (to be able to prevent removal of default Security Group until removal of the Host itself) }
SecurityGroup represents a security group Note: by design, security group names must be unique tenant-wide
func (SecurityGroup) Clone ¶
func (instance SecurityGroup) Clone() (data.Clonable, error)
Clone does a deep-copy of the SecurityGroup satisfies interface data.Clonable
func (*SecurityGroup) Deserialize ¶
func (instance *SecurityGroup) Deserialize(buf []byte) (ferr fail.Error)
Deserialize reads json code and reinstantiates a SecurityGroup
func (*SecurityGroup) GetID ¶
func (instance *SecurityGroup) GetID() (string, error)
GetID returns the ID of the securitygroup Satisfies interface data.Identifiable
func (*SecurityGroup) GetName ¶
func (instance *SecurityGroup) GetName() string
GetName returns the name of the securitygroup Satisfies interface data.Identifiable
func (*SecurityGroup) GetNetworkID ¶
func (instance *SecurityGroup) GetNetworkID() string
GetNetworkID returns the networkId of the securitygroup
func (SecurityGroup) IsComplete ¶
func (instance SecurityGroup) IsComplete() bool
IsComplete tells if the content of the security group is complete
func (SecurityGroup) IsConsistent ¶
func (instance SecurityGroup) IsConsistent() bool
IsConsistent tells if the content of the security group is consistent
func (*SecurityGroup) IsNull ¶
func (instance *SecurityGroup) IsNull() bool
IsNull tells if the SecurityGroup is a null value
func (*SecurityGroup) RemoveRuleByIndex ¶
func (instance *SecurityGroup) RemoveRuleByIndex(index int) fail.Error
RemoveRuleByIndex removes a rule identified by its index and returns the corresponding SecurityGroupRules
func (*SecurityGroup) Serialize ¶
func (instance *SecurityGroup) Serialize() ([]byte, fail.Error)
Serialize serializes instance into bytes (output json code)
func (*SecurityGroup) SetID ¶
func (instance *SecurityGroup) SetID(id string) *SecurityGroup
SetID sets the value of field ID in sg
func (*SecurityGroup) SetName ¶
func (instance *SecurityGroup) SetName(name string) *SecurityGroup
SetName sets the value of field Name in sg
func (*SecurityGroup) SetNetworkID ¶
func (instance *SecurityGroup) SetNetworkID(networkID string) *SecurityGroup
SetNetworkID sets the value of field NetworkID in sg
type SecurityGroupRule ¶
type SecurityGroupRule struct { IDs []string `json:"ids"` // ids of the rule (an abstracted rule may be split to several provider rules) Description string `json:"description,omitempty"` // description of the rule EtherType ipversion.Enum `json:"ether_type,omitempty"` // IPv4 or IPv6 Direction securitygroupruledirection.Enum `json:"direction"` // ingress (input) or egress (output) Protocol string `json:"protocol,omitempty"` // concerned protocol PortFrom int32 `json:"port_from,omitempty"` // first port of the rule PortTo int32 `json:"port_to,omitempty"` // last port of the rule Sources []string `json:"sources"` // concerned sources (depending on Direction); can be array of IP ranges or array of Security Group IDs (no mix) Targets []string `json:"targets"` // concerned source or target (depending on Direction); can be array of IP ranges or array of Security Group IDs (no mix) Priority int `json:"priority"` // priority of the rule Name string `json:"name,omitempty"` // name of the rule Network string `json:"network,omitempty"` // network of the rule, needed for Azure }
SecurityGroupRule represents a rule of a SecurityGroup
func NewSecurityGroupRule ¶
func NewSecurityGroupRule() *SecurityGroupRule
NewSecurityGroupRule creates an abstract.SecurityGroupRule
func (*SecurityGroupRule) Clone ¶
func (instance *SecurityGroupRule) Clone() (data.Clonable, error)
Clone does a deep-copy of the SecurityGroup
satisfies interface data.Clonable
func (*SecurityGroupRule) EqualTo ¶
func (instance *SecurityGroupRule) EqualTo(in *SecurityGroupRule) bool
EqualTo is a strict equality tester between 2 rules
func (*SecurityGroupRule) EquivalentTo ¶
func (instance *SecurityGroupRule) EquivalentTo(in *SecurityGroupRule) bool
EquivalentTo compares 2 rules, except ID and Description, to tell if the target is comparable
func (*SecurityGroupRule) IsNull ¶
func (instance *SecurityGroupRule) IsNull() bool
IsNull tells if the Security Group Rule is a null value
func (*SecurityGroupRule) SourcesConcernGroups ¶
func (instance *SecurityGroupRule) SourcesConcernGroups() (bool, fail.Error)
SourcesConcernGroups figures out if rule contains Security Group IDs as sources By design, CIDR and SG ID cannot be mixed
func (*SecurityGroupRule) TargetsConcernGroups ¶
func (instance *SecurityGroupRule) TargetsConcernGroups() (bool, fail.Error)
TargetsConcernGroups figures out if rule contains Security Group IDs as targets By design, CIDR and SG ID cannot be mixed
func (*SecurityGroupRule) Validate ¶
func (instance *SecurityGroupRule) Validate() fail.Error
Validate returns an error if the content of the rule is incomplete
type SecurityGroupRules ¶
type SecurityGroupRules []*SecurityGroupRule
SecurityGroupRules ...
func (SecurityGroupRules) Clone ¶
func (sgrs SecurityGroupRules) Clone() (SecurityGroupRules, error)
Clone does a deep-copy of the SecurityGroupRules
func (SecurityGroupRules) IndexOfEquivalentRule ¶
func (sgrs SecurityGroupRules) IndexOfEquivalentRule(rule *SecurityGroupRule) (int, fail.Error)
IndexOfEquivalentRule returns the index of the rule equivalent to the one provided
func (SecurityGroupRules) IndexOfRuleByID ¶
func (sgrs SecurityGroupRules) IndexOfRuleByID(id string) (int, fail.Error)
IndexOfRuleByID returns the index of the rule containing the provider rule ID provided
type Serializable ¶ added in v22.11.4
type Serializable interface { Serialize() ([]byte, fail.Error) Deserialize(buf []byte) (ferr fail.Error) }
Serializable to transform structs from and to json
type StoredCPUInfo ¶
type StoredCPUInfo struct { ID string `bow:"key"` TenantName string `json:"tenant_name,omitempty"` TemplateID string `json:"template_id,omitempty"` TemplateName string `json:"template_name,omitempty"` ImageID string `json:"image_id,omitempty"` ImageName string `json:"image_name,omitempty"` LastUpdated string `json:"last_updated,omitempty"` NumberOfCPU int `json:"number_of_cpu,omitempty"` NumberOfCore int `json:"number_of_core,omitempty"` NumberOfSocket int `json:"number_of_socket,omitempty"` CPUFrequency float64 `json:"cpu_frequency_Ghz,omitempty"` CPUArch string `json:"cpu_arch,omitempty"` Hypervisor string `json:"hypervisor,omitempty"` CPUModel string `json:"cpu_model,omitempty"` RAMSize float64 `json:"ram_size_Gb,omitempty"` RAMFreq float64 `json:"ram_freq,omitempty"` GPU int `json:"gpu,omitempty"` GPUModel string `json:"gpu_model,omitempty"` DiskSize int64 `json:"disk_size_Gb,omitempty"` MainDiskType string `json:"main_disk_type"` MainDiskSpeed float64 `json:"main_disk_speed_MBps"` SampleNetSpeed float64 `json:"sample_net_speed_KBps"` EphDiskSize int64 `json:"eph_disk_size_Gb"` PricePerHour float64 `json:"price_in_dollars_hour"` }
StoredCPUInfo ...
type SubNetwork ¶
type SubNetwork struct { CIDR string `json:"subnetmask,omitempty"` // DEPRECATED: deprecated ID string `json:"subnetid,omitempty"` // DEPRECATED: deprecated }
SubNetwork is deprecated
type Subnet ¶
type Subnet struct { ID string `json:"id"` // ID of the subnet (from provider) Name string `json:"name"` // Name of the subnet Network string `json:"network"` // parent Network of the subnet CIDR string `json:"mask"` // ip network in CIDR notation Domain string `json:"domain,omitempty"` // contains the domain used to define host FQDN DNSServers []string `json:"dns_servers,omitempty"` // contains the DNSServers used on the subnet GatewayIDs []string `json:"gateway_id,omitempty"` // contains the id of the host(s) acting as gateway(s) for the subnet VIP *VirtualIP `json:"vip,omitempty"` // contains the VIP of the network if created with HA IPVersion ipversion.Enum `json:"ip_version,omitempty"` // IPVersion is IPv4 or IPv6 (see IPVersion) State subnetstate.Enum `json:"status,omitempty"` // indicates the current state of the Subnet GWSecurityGroupID string `json:"gw_security_group_id,omitempty"` // Contains the ID of the Security Group for external access of gateways in Subnet PublicIPSecurityGroupID string `json:"publicip_security_group_id,omitempty"` // contains the ID of the Security Group for hosts with public IP in Subnet InternalSecurityGroupID string `json:"internal_security_group_id,omitempty"` // contains the ID of the security group for internal access of hosts DefaultSSHPort uint32 `json:"default_ssh_port,omitempty"` // contains the port to use for SSH by default on gateways in the Subnet SingleHostCIDRIndex uint `json:"single_host_cidr_index,omitempty"` // if > 0, contains the index of the CIDR in the single Host Network Tags map[string]string `json:"tags,omitempty"` }
Subnet represents a subnet
func (*Subnet) Deserialize ¶
Deserialize reads json code and reinstantiates a Subnet
type SubnetRequest ¶
type SubnetRequest struct { NetworkID string // contains the ID of the parent Network Name string // contains the name of the subnet (must be unique in a network) IPVersion ipversion.Enum // must be IPv4 or IPv6 (see IPVersion) CIDR string // CIDR mask DNSServers []string // Contains the DNS servers to configure Domain string // contains the DNS suffix to use for this network HA bool // tells if 2 gateways and a VIP needs to be created; the VIP IP address will be used as gateway ImageRef string // contains the reference (ID or name) of the image requested for gateway(s) DefaultSSHPort uint32 // contains the port to use for SSH on all hosts of the subnet by default KeepOnFailure bool // tells if resources have to be kept in case of failure (default behavior is to delete them) ClusterID string GwSizing *HostSizingRequirements }
SubnetRequest represents requirements to create a subnet where Mask is defined in CIDR notation like "192.0.2.0/24" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291.
type VirtualIP ¶
type VirtualIP struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` SubnetID string `json:"subnet_id,omitempty"` PrivateIP string `json:"private_ip,omitempty"` PublicIP string `json:"public_ip,omitempty"` Hosts []*HostCore `json:"hosts,omitempty"` NetworkID string `json:"network_id,omitempty"` // DEPRECATED: deprecated, replaced by SubnetID }
VirtualIP is a structure containing information needed to manage VIP (virtual IP)
type Volume ¶
type Volume struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Size int `json:"size,omitempty"` Speed volumespeed.Enum `json:"speed"` State volumestate.Enum `json:"state"` Tags map[string]string `json:"tags,omitempty"` }
Volume represents a block volume
func (*Volume) Deserialize ¶
Deserialize reads json code and restores a Volume
func (*Volume) GetName ¶
GetName returns the name of the volume Satisfies interface data.Identifiable
type VolumeAttachment ¶
type VolumeAttachment struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` VolumeID string `json:"volume,omitempty"` ServerID string `json:"host,omitempty"` Device string `json:"device,omitempty"` MountPoint string `json:"mountpoint,omitempty"` Format string `json:"format,omitempty"` }
VolumeAttachment represents a volume attachment
func NewVolumeAttachment ¶
func NewVolumeAttachment() *VolumeAttachment
func (*VolumeAttachment) IsNull ¶
func (va *VolumeAttachment) IsNull() bool
type VolumeAttachmentRequest ¶
type VolumeAttachmentRequest struct { Name string `json:"name,omitempty"` VolumeID string `json:"volume_id,omitempty"` HostID string `json:"host_id,omitempty"` }
VolumeAttachmentRequest represents a volume attachment request
type VolumeRequest ¶
type VolumeRequest struct { Name string `json:"name,omitempty"` Size int `json:"size,omitempty"` Speed volumespeed.Enum `json:"speed"` }
VolumeRequest represents a volume request