Documentation ¶
Index ¶
- func NewPricingSource(s *session.Session, cfg ...*aws.Config) *pricingDetails
- type AmazonNetworkMapper
- type Config
- type Credentials
- type Ec2Describer
- type Ec2Infoer
- func (e *Ec2Infoer) GetCurrentPrices(region string) (map[string]types.Price, error)
- func (e *Ec2Infoer) GetProducts(vms []types.VMInfo, service, regionId string) ([]types.VMInfo, error)
- func (e *Ec2Infoer) GetRegion(id string) *endpoints.Region
- func (e *Ec2Infoer) GetRegions(service string) (map[string]string, error)
- func (e *Ec2Infoer) GetServiceImages(service, region string) ([]types.Image, error)
- func (e *Ec2Infoer) GetServiceProducts(region, service string) ([]types.ProductDetails, error)
- func (e *Ec2Infoer) GetVersions(service, region string) ([]types.LocationVersion, error)
- func (e *Ec2Infoer) GetVirtualMachines(region string) ([]types.VMInfo, error)
- func (e *Ec2Infoer) GetZones(region string) ([]string, error)
- func (e *Ec2Infoer) HasImages() bool
- func (e *Ec2Infoer) HasShortLivedPriceInfo() bool
- func (e *Ec2Infoer) Initialize() (map[string]map[string]types.Price, error)
- type PricingConfig
- type PricingSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AmazonNetworkMapper ¶
type AmazonNetworkMapper struct { }
AmazonNetworkMapper module object for handling amazon specific VM to Networking capabilities mapping
func (*AmazonNetworkMapper) MapNetworkPerf ¶
func (nm *AmazonNetworkMapper) MapNetworkPerf(networkPerformance string) (string, error)
MapNetworkPerf maps the network performance of the ec2 to the category supported ny telescope
type Config ¶
type Config struct { Credentials `mapstructure:",squash"` Region string Pricing PricingConfig // Prometheus settings PrometheusAddress string PrometheusQuery string }
Config represents configuration for obtaining cloud information from Amazon.
func (Config) GetPricingCredentials ¶
func (c Config) GetPricingCredentials() Credentials
type Credentials ¶
type Credentials struct { // Static credentials AccessKey string SecretKey string SessionToken string // Shared credentials Profile string // IAM role ARN to assume AssumeRoleARN string }
Credentials used for creating an AWS Session.
type Ec2Describer ¶
type Ec2Describer interface { DescribeAvailabilityZones(input *ec2.DescribeAvailabilityZonesInput) (*ec2.DescribeAvailabilityZonesOutput, error) DescribeImages(*ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) DescribeSpotPriceHistoryPages(input *ec2.DescribeSpotPriceHistoryInput, fn func(*ec2.DescribeSpotPriceHistoryOutput, bool) bool) error }
Ec2Describer interface for operations describing EC2 artifacts. (a subset of the Ec2 cli operations used by this app)
type Ec2Infoer ¶
type Ec2Infoer struct {
// contains filtered or unexported fields
}
Ec2Infoer encapsulates the data and operations needed to access external resources
func NewAmazonInfoer ¶
NewAmazonInfoer builds an infoer instance based on the provided configuration
func (*Ec2Infoer) GetCurrentPrices ¶
GetCurrentPrices returns the current spot prices of every instance type in every availability zone in a given region
func (*Ec2Infoer) GetProducts ¶
func (e *Ec2Infoer) GetProducts(vms []types.VMInfo, service, regionId string) ([]types.VMInfo, error)
GetProducts retrieves the available virtual machines based on the arguments provided Delegates to the underlying PricingSource instance and performs transformations
func (*Ec2Infoer) GetRegion ¶
GetRegion gets the api specific region representation based on the provided id
func (*Ec2Infoer) GetRegions ¶
GetRegions returns a map with available regions transforms the api representation into a "plain" map
func (*Ec2Infoer) GetServiceImages ¶
GetServiceImages retrieves the images supported by the given service in the given region
func (*Ec2Infoer) GetServiceProducts ¶
func (e *Ec2Infoer) GetServiceProducts(region, service string) ([]types.ProductDetails, error)
GetServiceProducts retrieves the products supported by the given service in the given region
func (*Ec2Infoer) GetVersions ¶
func (e *Ec2Infoer) GetVersions(service, region string) ([]types.LocationVersion, error)
GetVersions retrieves the kubernetes versions supported by the given service in the given region
func (*Ec2Infoer) GetVirtualMachines ¶
func (*Ec2Infoer) HasShortLivedPriceInfo ¶
HasShortLivedPriceInfo - Spot Prices are changing continuously on EC2
type PricingConfig ¶
type PricingConfig struct { Region string Credentials `mapstructure:",squash"` }
PricingConfig represents configuration for obtaining pricing information from Amazon.
type PricingSource ¶
type PricingSource interface {
GetPriceList(input *pricing.GetProductsInput) ([]aws.JSONValue, error)
}
PricingSource list of operations for retrieving pricing information Decouples the pricing logic from the amazon api