types

package
v0.0.0-...-c411064 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YEAR_HOURS  = 8760
	MONTH_HOURS = 730
)
View Source
const (
	API_URL = "https://prices.azure.com/api/retail/prices?$filter="
)

Variables

This section is empty.

Functions

func GetArnForAzureApiItem

func GetArnForAzureApiItem(priceItem *AzurePricingApiItem) string

Types

type ApiResp

type ApiResp struct {
	//Future Work
	//PriceItems []ApiRespPriceItem `json:"price_items"`
	UnsupportedResources    []string      `json:"unsupported_resources,omitempty",yaml:"unsupported_resources,omitempty"`
	UnestimateableResources []string      `json:"unestimateable_resources,omitempty",yaml:"unestimateable_resources,omitempty"`
	TotalEstimate           EstimateTotal `json:"estimate_summary",yaml:"estimate_summary"`
}

type ApiRespPriceItem

type ApiRespPriceItem struct {
	ResourceType string  `json:"resource_type",yaml:"resource_type"`
	Price        float64 `json:"price",yaml:"price"`
}

type AzurePriceableAsset

type AzurePriceableAsset interface {
	GenerateQuery(ctx context.Context) string
}

This interface has a function that returns a query that can be run against the Azure pricing API

type AzurePricingApiItem

type AzurePricingApiItem struct {
	CurrencyCode         string    `json:"currencyCode"`
	TierMinimumUnits     float64   `json:"tierMinimumUnits"`
	RetailPrice          float64   `json:"retailPrice"`
	UnitPrice            float64   `json:"unitPrice"`
	ArmRegionName        string    `json:"armRegionName"`
	Location             string    `json:"location"`
	EffectiveStartDate   time.Time `json:"effectiveStartDate"`
	MeterID              string    `json:"meterId"`
	MeterName            string    `json:"meterName"`
	ProductID            string    `json:"productId"`
	ReservationTerm      string    `json:"reservationTerm"`
	SkuID                string    `json:"skuId"`
	ProductName          string    `json:"productName"`
	SkuName              string    `json:"skuName"`
	ServiceName          string    `json:"serviceName"`
	ServiceID            string    `json:"serviceId"`
	ServiceFamily        string    `json:"serviceFamily"`
	UnitOfMeasure        string    `json:"unitOfMeasure"`
	Type                 string    `json:"type"`
	IsPrimaryMeterRegion bool      `json:"isPrimaryMeterRegion"`
	ArmSkuName           string    `json:"armSkuName"`
}

type AzurePricingApiResp

type AzurePricingApiResp struct {
	BillingCurrency    string                `json:"BillingCurrency"`
	CustomerEntityID   string                `json:"CustomerEntityId"`
	CustomerEntityType string                `json:"CustomerEntityType"`
	Items              []AzurePricingApiItem `json:"Items"`
	NextPageLink       *string               `json:"NextPageLink"`
	Count              int                   `json:"Count"`
}

type Change

type Change struct {
	After interface{} `json:"after"`
}

type EstimateTotal

type EstimateTotal struct {
	HourlyCost  float64 `json:"hourly_cost_usd",yaml:"hourly_cost_usd"`
	MonthlyCost float64 `json:"monthly_cost_usd",yaml:"monthly_cost_usd"`
	YearlyCost  float64 `json:"yearly_cost_usd",yaml:"yearly_cost_usd"`
}

type PlanFile

type PlanFile struct {
	ResourceChanges []ResourceChange `json:"resource_changes"`
}

type Priceable

type Priceable interface {
	GetHourlyPrice(ctx context.Context) float64
}

An interface that allows for different ways of fetching a price as long as it represents an estimated hourly cost for this resource.

type ResourceChange

type ResourceChange struct {
	Type     string `json:"type"`
	Provider string `json:"provider_name"`
	Change   Change `json:"change"`
	Address  string `json:"address"`
}

Jump to

Keyboard shortcuts

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