costanalysis

package
v0.0.0-...-18e03d2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PricePerHourPriceTermCode = "6YS6EN2CT7"
	UpfrontFeePriceTermCode   = "2TG2D8R56U"
)
View Source
const (
	OnDemandOfferTermCode = "JRTCKXETXF"
)

For each SKU, following six

Variables

This section is empty.

Functions

func GeneratePricesCSV

func GeneratePricesCSV(o *OfferCurrentVersionIndexFile, outputFilename string) error

func GenerateProductCSV

func GenerateProductCSV(o *OfferCurrentVersionIndexFile, outputFilename string) error

Types

type Attributes

type Attributes struct {
	ServiceCode       string `json:"servicecode"`
	Location          string `json:"location"`
	LocationType      string `json:"locationType"`
	InstanceType      string `json:"instanceType"`
	CurrentGeneration string `json:"currentGeneration"`
	InstanceFamily    string `json:"instanceFamily"`
	VCPU              string `json:"vcpu"`
	PhysicalProcessor string `json:"physicalProcessor"`
	ClockSpeed        string `json:"clockSpeed"`
	Memory            string `json:"memory"`

	Storage               string `json:"storage"`
	NetworkPerformance    string `json:"networkPerformance"`
	ProcessorArchitecture string `json:"processorArchitecture"`
	// "Shared", "Host" or "Dedicated"
	Tenancy string `json:"tenancy"`

	OperatingSystem string `json:"operatingSystem"`

	LicenseModel   string `json:"licenseModel"`
	CapacityStatus string `json:"capacitystatus"`

	PreInstalledSw string `json:"preInstalledSw"`
}

type Offer

type Offer struct {
	OfferCode             string `json:"offerCode"`
	VersionIndexURL       string `json:"versionIndexUrl"`
	CurrentVersionURL     string `json:"currentVersionUrl"`
	CurrentRegionIndexURL string `json:"currentRegionIndexUrl"`
}

type OfferCurrentVersionIndexFile

type OfferCurrentVersionIndexFile struct {
	FormatVersion   string             `json:"formatVersion"`
	Disclaimer      string             `json:"disclaimer"`
	OfferCode       string             `json:"offerCode"`
	Version         string             `json:"version"`
	PublicationDate string             `json:"publicationDate"`
	Products        map[string]Product `json:"products"`
	// The specific type of term that a term definition describes.
	// The valid term types are reserved and onDemand.
	Terms map[string]map[string]map[string]Term `json:"terms"`
}

func ProcessOfferFile

func ProcessOfferFile(filename string) (*OfferCurrentVersionIndexFile, error)

type OfferIndexFile

type OfferIndexFile struct {
	FormatVersion   string           `json:"formatVersion"`
	Disclaimer      string           `json:"disclaimer"`
	PublicationDate string           `json:"publicationDate"`
	Offers          map[string]Offer `json:"offers"`
}

type PricePerUnit

type PricePerUnit struct {
	RateCode     string            `json:"rateCode"`
	BeginRange   string            `json:"beginRange"`
	EndRange     string            `json:"endRange"`
	Unit         string            `json:"unit"`
	PricePerUnit map[string]string `json:"pricePerUnit"`
}

type Product

type Product struct {
	SKU        string     `json:"sku"`
	Attributes Attributes `json:"attributes"`
}

type Term

type Term struct {
	// SKU is a unique code for a product.
	SKU string `json:"sku"`

	// OfferTermCode is a unique code for a specific type of term.
	// For example, KCAKZHGHG. Product and price combinations are referenced
	// by the SKU code followed by the term code, separated by a period.
	// For example, U7ADXS4BEK5XXHRU.KCAKZHGHG.
	OfferTermCode string `json:"offerTermCode"`

	// EffectiveDate is the date that an offer file goes into effect.
	// For example, if a term has an EffectiveDate of November 1, 2017,
	// the price is not valid before November 1, 2017.
	EffectiveDate string `json:"effectiveDate"`

	// PriceDimensions is the pricing details for the offer file,
	// such as how usage is measured, the currency that you can use to pay with,
	// and the pricing tier limitations.
	PriceDimensions map[string]PricePerUnit `json:"priceDimensions"`

	TermAttributes TermAttributes `json:"termAttributes"`
}

type TermAttributes

type TermAttributes struct {
	// "1yr", "1 yr", "3yr", or "3 yr"
	LeaseContractLength string `json:"LeaseContractLength"`

	// "standard" or "convertible".
	OfferingClass string `json:"OfferingClass"`

	// "No Upfront", "Partial Upfront", "All Upfront",
	// "NoUpfront", "PartialUpfront", or "AllUpfront"
	PurchaseOption string `json:"PurchaseOption"`
}

Jump to

Keyboard shortcuts

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