Documentation ¶
Index ¶
Constants ¶
const ( // Memory represents the memory attribute for the product info Memory = "memory" // Cpu represents the cpu attribute for the product info CPU = "cpu" )
const ( // NtwLow the low network performance category NtwLow = "low" // NtwMedium the medium network performance category NtwMedium = "medium" // NtwHight the high network performance category NtwHight = "high" // NtwExtra the highest network performance category NtwExtra = "extra" // Telescopes supports categories of virtual machines CategoryGeneral = "General purpose" CategoryCompute = "Compute optimized" CategoryMemory = "Memory optimized" CategoryGpu = "GPU instance" CategoryStorage = "Storage optimized" ContinentNorthAmerica = "North America" ContinentSouthAmerica = "South America" ContinentEurope = "Europe" ContinentAfrica = "Africa" ContinentAsia = "Asia" ContinentAustralia = "Australia" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudInfo ¶
type CloudInfo interface { // GetProviders returns the supported providers GetProviders() ([]Provider, error) // GetProvider retrieves information about the provider GetProvider(provider string) (Provider, error) // GetServices returns the supported services for a provider GetServices(provider string) ([]Service, error) // GetZones returns all the availability zones for a region GetZones(provider, service, region string) ([]string, error) // GetRegions returns all the regions for a cloud provider GetRegions(provider string, service string) (map[string]string, error) GetStatus(provider string) (string, error) GetProductDetails(provider, service, region string) ([]ProductDetails, error) GetServiceImages(provider, service, region string) ([]Image, error) GetVersions(provider, service, region string) ([]LocationVersion, error) GetContinentsData(provider, service string) (map[string][]Region, error) GetContinents() []string }
CloudInfo is the main entry point for retrieving vm type characteristics and pricing information on different cloud providers
type Image ¶
type Image struct { Name string `json:"name"` CreationDate time.Time `json:"creationDate,omitempty"` Version string `json:"version,omitempty"` GpuAvailable bool `json:"gpu,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
Image represents an image
type LocationVersion ¶
type LocationVersion struct { Location string `json:"location"` Versions []string `json:"versions"` Default string `json:"default"` }
LocationVersion struct for displaying version information per location
func NewLocationVersion ¶
func NewLocationVersion(location string, versions []string, def string) LocationVersion
NewLocationVersion creates a new location version struct
type NetworkPerfMapper ¶
type NetworkPerfMapper interface { // MapNetworkPerf gets the network performance category for the given MapNetworkPerf(ntwPerf string) (string, error) }
NetworkPerfMapper operations related to mapping between virtual machines to network performance categories
type Price ¶
type Price struct { OnDemandPrice float64 `json:"onDemandPrice"` SpotPrice SpotPriceInfo `json:"spotPrice"` }
Price describes the on demand price and spot prices per availability zones
type ProductDetailSource ¶
type ProductDetailSource interface { // GetProductDetails gathers the product details information known by telescope GetProductDetails(provider string, region string) ([]ProductDetails, error) }
ProductDetailSource product details related set of operations
type ProductDetails ¶
type ProductDetails struct { // Embedded struct! VMInfo // Burst this is derived for now Burst bool `json:"burst,omitempty"` }
ProductDetails extended view of the virtual machine details
func NewProductDetails ¶
func NewProductDetails(vm VMInfo) *ProductDetails
NewProductDetails creates a new ProductDetails struct and returns a pointer to it
type Provider ¶
Provider represents a cloud provider
func NewProvider ¶
NewProvider create new provider describer struct
func (Provider) ProviderName ¶
ProviderName returns the name of the provider
type ProviderDescriber ¶
type ProviderDescriber interface { // ProviderName returns the name of the provider ProviderName() string }
ProviderDescriber describes a provider
type Service ¶
Service represents a service supported by a given provider. it's intended to implement the ServiceDescriber interface
func (Service) ServiceName ¶
ServiceName returns the service name
type ServiceDescriber ¶
type ServiceDescriber interface { // ServiceName abstracts the name assembly for the service ServiceName() string }
ServiceDescriber represents a service; eg.: oke, eks Extend this interface with other operations if needed
type SpotPriceInfo ¶
SpotPriceInfo represents different prices per availability zones
type VMInfo ¶
type VMInfo struct { Category string `json:"category"` Type string `json:"type"` OnDemandPrice float64 `json:"onDemandPrice"` SpotPrice []ZonePrice `json:"spotPrice"` Cpus float64 `json:"cpusPerVm"` Mem float64 `json:"memPerVm"` Gpus float64 `json:"gpusPerVm"` NtwPerf string `json:"ntwPerf"` NtwPerfCat string `json:"ntwPerfCategory"` Zones []string `json:"zones"` Attributes map[string]string `json:"attributes"` // CurrentGen signals whether the instance type generation is the current one. Only applies for amazon CurrentGen bool `json:"currentGen"` }
VMInfo representation of a virtual machine
type Version ¶
type Version struct {
Version string `json:"versions"`
}
Version represents a version
func (Version) VersionName ¶
VersionName returns the name of the version
type ZonePrice ¶
ZonePrice struct for displaying price information per zone
func NewZonePrice ¶
NewZonePrice creates a new zone price struct and returns its pointer