Documentation
¶
Index ¶
- Constants
- func AllocateIdleByDefault(p Provider) bool
- func ClusterName(p Provider) string
- func ConfigWatcherFor(p Provider) *watcher.ConfigMapWatcher
- func CreateClusterMeta(cluster_id, cluster_name string) error
- func CustomPricesEnabled(p Provider) bool
- func GetClusterMeta(cluster_id string) (string, string, error)
- func GetCsv(location string) (io.Reader, error)
- func GetOrCreateClusterMeta(cluster_id, cluster_name string) (string, string, error)
- func NewClientCredentialsConfig(clientID string, clientSecret string, tenantID string, env azure.Environment) auth.ClientCredentialsConfig
- func NodeValueFromMapField(m string, n *v1.Node, useRegion bool) string
- func PVValueFromMapField(m string, n *v1.PersistentVolume) string
- func ParseID(id string) string
- func ParseLBID(id string) string
- func ParsePVID(id string) string
- func SetCustomPricingField(obj *CustomPricing, name string, value string) error
- func ShareTenancyCosts(p Provider) bool
- func SharedLabels(p Provider) ([]string, []string)
- func SharedNamespaces(p Provider) []string
- func UpdateClusterMeta(cluster_id, cluster_name string) error
- type AWS
- func (aws *AWS) AllNodePricing() (interface{}, error)
- func (aws *AWS) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (awsProvider *AWS) ClusterInfo() (map[string]string, error)
- func (aws *AWS) ClusterManagementPricing() (string, float64, error)
- func (aws *AWS) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (aws *AWS) ConfigureAuth() error
- func (aws *AWS) ConfigureAuthWith(config *CustomPricing) error
- func (aws *AWS) DownloadPricingData() error
- func (aws *AWS) GetAWSAccessKey() (*AWSAccessKey, error)
- func (aws *AWS) GetAWSAthenaInfo() (*AwsAthenaInfo, error)
- func (aws *AWS) GetAddresses() ([]byte, error)
- func (aws *AWS) GetConfig() (*CustomPricing, error)
- func (aws *AWS) GetDisks() ([]byte, error)
- func (aws *AWS) GetKey(labels map[string]string, n *v1.Node) Key
- func (aws *AWS) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (aws *AWS) GetManagementPlatform() (string, error)
- func (aws *AWS) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (aws *AWS) GetReservationDataFromAthena() error
- func (aws *AWS) GetSavingsPlanDataFromAthena() error
- func (aws *AWS) KubeAttrConversion(location, instanceType, operatingSystem string) string
- func (aws *AWS) LoadBalancerPricing() (*LoadBalancer, error)
- func (aws *AWS) NetworkPricing() (*Network, error)
- func (aws *AWS) NodePricing(k Key) (*Node, error)
- func (aws *AWS) PVPricing(pvk PVKey) (*PV, error)
- func (aws *AWS) PricingSourceStatus() map[string]*PricingSource
- func (aws *AWS) QueryAthenaPaginated(ctx context.Context, query string, fn func(*athena.GetQueryResultsOutput) bool) error
- func (aws *AWS) Regions() []string
- func (aws *AWS) ServiceAccountStatus() *ServiceAccountStatus
- func (aws *AWS) SpotRefreshEnabled() bool
- func (aws *AWS) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (aws *AWS) UpdateConfigFromConfigMap(cm map[string]string) (*CustomPricing, error)
- type AWSAccessKey
- type AWSCurrencyCode
- type AWSOfferTerm
- type AWSPricing
- type AWSPricingTerms
- type AWSProduct
- type AWSProductAttributes
- type AWSProductTerms
- type AWSRateCode
- type AwsAthenaInfo
- type AwsSpotFeedInfo
- type Azure
- func (az *Azure) AllNodePricing() (interface{}, error)
- func (az *Azure) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (az *Azure) ClusterInfo() (map[string]string, error)
- func (*Azure) ClusterManagementPricing() (string, float64, error)
- func (az *Azure) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (az *Azure) DownloadPricingData() error
- func (*Azure) GetAddresses() ([]byte, error)
- func (az *Azure) GetAzureStorageConfig(forceReload bool, cp *CustomPricing) (*AzureStorageConfig, error)
- func (az *Azure) GetConfig() (*CustomPricing, error)
- func (*Azure) GetDisks() ([]byte, error)
- func (az *Azure) GetKey(labels map[string]string, n *v1.Node) Key
- func (az *Azure) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (az *Azure) GetManagementPlatform() (string, error)
- func (az *Azure) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (azr *Azure) LoadBalancerPricing() (*LoadBalancer, error)
- func (az *Azure) NetworkPricing() (*Network, error)
- func (az *Azure) NodePricing(key Key) (*Node, error)
- func (az *Azure) PVPricing(pvk PVKey) (*PV, error)
- func (az *Azure) PricingSourceStatus() map[string]*PricingSource
- func (az *Azure) Regions() []string
- func (az *Azure) ServiceAccountStatus() *ServiceAccountStatus
- func (az *Azure) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (az *Azure) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type AzureAppKey
- type AzurePricing
- type AzureRetailPricing
- type AzureRetailPricingAttributes
- type AzureServiceKey
- type AzureStorageConfig
- type BigQueryConfig
- type CSVProvider
- func (*CSVProvider) ClusterManagementPricing() (string, float64, error)
- func (c *CSVProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (c *CSVProvider) DownloadPricingData() error
- func (c *CSVProvider) GetKey(l map[string]string, n *v1.Node) Key
- func (c *CSVProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (c *CSVProvider) NodePricing(key Key) (*Node, error)
- func (c *CSVProvider) PVPricing(pvk PVKey) (*PV, error)
- func (c *CSVProvider) Regions() []string
- func (c *CSVProvider) ServiceAccountStatus() *ServiceAccountStatus
- type CustomPricing
- type CustomProvider
- func (cp *CustomProvider) AllNodePricing() (interface{}, error)
- func (*CustomProvider) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (cp *CustomProvider) ClusterInfo() (map[string]string, error)
- func (*CustomProvider) ClusterManagementPricing() (string, float64, error)
- func (cp *CustomProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (cp *CustomProvider) DownloadPricingData() error
- func (*CustomProvider) ExternalAllocations(start string, end string, aggregator []string, filterType string, ...) ([]*OutOfClusterAllocation, error)
- func (*CustomProvider) GetAddresses() ([]byte, error)
- func (cp *CustomProvider) GetConfig() (*CustomPricing, error)
- func (*CustomProvider) GetDisks() ([]byte, error)
- func (cp *CustomProvider) GetKey(labels map[string]string, n *v1.Node) Key
- func (*CustomProvider) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (*CustomProvider) GetManagementPlatform() (string, error)
- func (*CustomProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (cp *CustomProvider) LoadBalancerPricing() (*LoadBalancer, error)
- func (cp *CustomProvider) NetworkPricing() (*Network, error)
- func (cp *CustomProvider) NodePricing(key Key) (*Node, error)
- func (cp *CustomProvider) PVPricing(pvk PVKey) (*PV, error)
- func (cp *CustomProvider) PricingSourceStatus() map[string]*PricingSource
- func (*CustomProvider) QuerySQL(query string) ([]byte, error)
- func (cp *CustomProvider) Regions() []string
- func (cp *CustomProvider) ServiceAccountStatus() *ServiceAccountStatus
- func (cp *CustomProvider) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (cp *CustomProvider) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type GCP
- func (gcp *GCP) AllNodePricing() (interface{}, error)
- func (gcp *GCP) ApplyReservedInstancePricing(nodes map[string]*Node)
- func (gcp *GCP) ClusterInfo() (map[string]string, error)
- func (gcp *GCP) ClusterManagementPricing() (string, float64, error)
- func (gcp *GCP) CombinedDiscountForNode(instanceType string, isPreemptible bool, ...) float64
- func (gcp *GCP) DownloadPricingData() error
- func (*GCP) GetAddresses() ([]byte, error)
- func (gcp *GCP) GetConfig() (*CustomPricing, error)
- func (*GCP) GetDisks() ([]byte, error)
- func (gcp *GCP) GetKey(labels map[string]string, n *v1.Node) Key
- func (gcp *GCP) GetLocalStorageQuery(window, offset time.Duration, rate bool, used bool) string
- func (gcp *GCP) GetManagementPlatform() (string, error)
- func (gcp *GCP) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
- func (gcp *GCP) LoadBalancerPricing() (*LoadBalancer, error)
- func (gcp *GCP) NetworkPricing() (*Network, error)
- func (gcp *GCP) NodePricing(key Key) (*Node, error)
- func (gcp *GCP) PVPricing(pvk PVKey) (*PV, error)
- func (gcp *GCP) PricingSourceStatus() map[string]*PricingSource
- func (gcp *GCP) Regions() []string
- func (gcp *GCP) ServiceAccountStatus() *ServiceAccountStatus
- func (gcp *GCP) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
- func (gcp *GCP) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
- type GCPPricing
- type GCPReservedCounter
- type GCPReservedInstance
- type GCPReservedInstancePlan
- type GCPResourceInfo
- type Key
- type LoadBalancer
- type Network
- type Node
- type NodePrice
- type OutOfClusterAllocation
- type PV
- type PVKey
- type PricingExpression
- type PricingInfo
- type PricingMatchMetadata
- type PricingSource
- type PricingSources
- type PricingType
- type Provider
- type ProviderConfig
- func (pc *ProviderConfig) ConfigFileManager() *config.ConfigFileManager
- func (pc *ProviderConfig) GetCustomPricingData() (*CustomPricing, error)
- func (pc *ProviderConfig) Update(updateFunc func(*CustomPricing) error) (*CustomPricing, error)
- func (pc *ProviderConfig) UpdateFromMap(a map[string]string) (*CustomPricing, error)
- type RIData
- type ReservedInstanceData
- type SavingsPlanData
- type ServiceAccountCheck
- type ServiceAccountChecks
- type ServiceAccountStatus
- type TieredRates
- type UnitPriceInfo
Constants ¶
const ( SpotInfoUpdateType = "spotinfo" AthenaInfoUpdateType = "athenainfo" PreemptibleType = "preemptible" APIPricingSource = "Public API" SpotPricingSource = "Spot Data Feed" ReservedInstancePricingSource = "Savings Plan, Reserved Instance, and Out-Of-Cluster" )
const ( AzureFilePremiumStorageClass = "premium_smb" AzureFileStandardStorageClass = "standard_smb" AzureDiskPremiumSSDStorageClass = "premium_ssd" AzureDiskStandardSSDStorageClass = "standard_ssd" AzureDiskStandardStorageClass = "standard_hdd" AzureStorageUpdateType = "AzureStorage" )
const ( GCPReservedInstanceResourceTypeRAM string = "MEMORY" GCPReservedInstanceResourceTypeCPU string = "VCPU" GCPReservedInstanceStatusActive string = "ACTIVE" GCPReservedInstancePlanOneYear string = "TWELVE_MONTH" GCPReservedInstancePlanThreeYear string = "THIRTY_SIX_MONTH" )
const BigqueryUpdateType = "bigqueryupdate"
const ClusterIdEnvVar = "AWS_CLUSTER_ID"
ClusterIdEnvVar is the environment variable in which one can manually set the ClusterId
const GKE_GPU_TAG = "cloud.google.com/gke-accelerator"
const HourlyRateCode = ".6YS6EN2CT7"
HourlyRateCode is appended to a node sku
const HourlyRateCodeCn = ".Q7UJUT2CE6"
const OnDemandRateCode = ".JRTCKXETXF"
OnDemandRateCode is appended to an node sku
const OnDemandRateCodeCn = ".99YE2YK9UR"
const ReservedRateCode = ".38NPMPTW36"
ReservedRateCode is appended to a node sku
const SpotRefreshDuration = 15 * time.Minute
How often spot data is refreshed
Variables ¶
This section is empty.
Functions ¶
func AllocateIdleByDefault ¶
AllocateIdleByDefault returns true if the application settings specify to allocate idle by default
func ClusterName ¶
ClusterName returns the name defined in cluster info, defaulting to the CLUSTER_ID environment variable
func ConfigWatcherFor ¶
func ConfigWatcherFor(p Provider) *watcher.ConfigMapWatcher
ConfigWatcherFor returns a new ConfigWatcher instance which watches changes to the "pricing-configs" configmap
func CreateClusterMeta ¶
func CustomPricesEnabled ¶
CustomPricesEnabled returns the boolean equivalent of the cloup provider's custom prices flag, indicating whether or not the cluster is using custom pricing.
func GetOrCreateClusterMeta ¶
func NewClientCredentialsConfig ¶
func NewClientCredentialsConfig(clientID string, clientSecret string, tenantID string, env azure.Environment) auth.ClientCredentialsConfig
NewClientCredentialsConfig creates an AuthorizerConfig object configured to obtain an Authorizer through Client Credentials.
func NodeValueFromMapField ¶
func PVValueFromMapField ¶
func PVValueFromMapField(m string, n *v1.PersistentVolume) string
func ParseID ¶
ParseID attempts to parse a ProviderId from a string based on formats from the various providers and returns the string as is if it cannot find a match
func ParseLBID ¶
ParseLBID attempts to parse a LB ProviderId from a string based on formats from the various providers and returns the string as is if it cannot find a match
func ParsePVID ¶
ParsePVID attempts to parse a PV ProviderId from a string based on formats from the various providers and returns the string as is if it cannot find a match
func SetCustomPricingField ¶
func SetCustomPricingField(obj *CustomPricing, name string, value string) error
func ShareTenancyCosts ¶
ShareTenancyCosts returns true if the application settings specify to share tenancy costs by default.
func SharedLabels ¶
SharedLabel returns the configured set of shared labels as a parallel tuple of keys to values; e.g. for app:kubecost,type:staging this returns (["app", "type"], ["kubecost", "staging"]) in order to match the signature of the NewSharedResourceInfo
func SharedNamespaces ¶
SharedNamespace returns a list of names of shared namespaces, as defined in the application settings
func UpdateClusterMeta ¶
Types ¶
type AWS ¶
type AWS struct { Pricing map[string]*AWSProductTerms SpotPricingByInstanceID map[string]*spotInfo SpotPricingUpdatedAt *time.Time SpotRefreshRunning bool SpotPricingLock sync.RWMutex SpotPricingError error RIPricingByInstanceID map[string]*RIData RIPricingError error RIDataRunning bool RIDataLock sync.RWMutex SavingsPlanDataByInstanceID map[string]*SavingsPlanData SavingsPlanDataRunning bool SavingsPlanDataLock sync.RWMutex ValidPricingKeys map[string]bool Clientset clustercache.ClusterCache BaseCPUPrice string BaseRAMPrice string BaseGPUPrice string BaseSpotCPUPrice string BaseSpotRAMPrice string BaseSpotGPUPrice string SpotLabelName string SpotLabelValue string SpotDataRegion string SpotDataBucket string SpotDataPrefix string ProjectID string DownloadPricingDataLock sync.RWMutex Config *ProviderConfig *CustomProvider // contains filtered or unexported fields }
AWS represents an Amazon Provider
func (*AWS) AllNodePricing ¶
AllNodePricing returns all the billing data fetched.
func (*AWS) ApplyReservedInstancePricing ¶
ApplyReservedInstancePricing TODO
func (*AWS) ClusterInfo ¶
ClusterInfo returns an object that represents the cluster. TODO: actually return the name of the cluster. Blocked on cluster federation.
func (*AWS) ClusterManagementPricing ¶
func (*AWS) CombinedDiscountForNode ¶
func (*AWS) ConfigureAuth ¶
updates the authentication to the latest values (via config or secret)
func (*AWS) ConfigureAuthWith ¶
func (aws *AWS) ConfigureAuthWith(config *CustomPricing) error
updates the authentication to the latest values (via config or secret)
func (*AWS) DownloadPricingData ¶
DownloadPricingData fetches data from the AWS Pricing API
func (*AWS) GetAWSAccessKey ¶
func (aws *AWS) GetAWSAccessKey() (*AWSAccessKey, error)
GetAWSAccessKey generate an AWSAccessKey object from the config
func (*AWS) GetAWSAthenaInfo ¶
func (aws *AWS) GetAWSAthenaInfo() (*AwsAthenaInfo, error)
GetAWSAthenaInfo generate an AWSAthenaInfo object from the config
func (*AWS) GetAddresses ¶
GetAddresses retrieves EC2 addresses
func (*AWS) GetConfig ¶
func (aws *AWS) GetConfig() (*CustomPricing, error)
func (*AWS) GetDisks ¶
GetDisks returns the AWS disks backing PVs. Useful because sometimes k8s will not clean up PVs correctly. Requires a json config in /var/configs with key region.
func (*AWS) GetLocalStorageQuery ¶
func (*AWS) GetManagementPlatform ¶
func (*AWS) GetReservationDataFromAthena ¶
func (*AWS) GetSavingsPlanDataFromAthena ¶
func (*AWS) KubeAttrConversion ¶
KubeAttrConversion maps the k8s labels for region to an aws region
func (*AWS) LoadBalancerPricing ¶
func (aws *AWS) LoadBalancerPricing() (*LoadBalancer, error)
func (*AWS) NetworkPricing ¶
Stubbed NetworkPricing for AWS. Pull directly from aws.json for now
func (*AWS) NodePricing ¶
NodePricing takes in a key from GetKey and returns a Node object for use in building the cost model.
func (*AWS) PricingSourceStatus ¶
func (aws *AWS) PricingSourceStatus() map[string]*PricingSource
func (*AWS) QueryAthenaPaginated ¶
func (aws *AWS) QueryAthenaPaginated(ctx context.Context, query string, fn func(*athena.GetQueryResultsOutput) bool) error
QueryAthenaPaginated executes athena query and processes results.
func (*AWS) ServiceAccountStatus ¶
func (aws *AWS) ServiceAccountStatus() *ServiceAccountStatus
func (*AWS) SpotRefreshEnabled ¶
SpotRefreshEnabled determines whether the required configs to run the spot feed query have been set up
func (*AWS) UpdateConfig ¶
func (*AWS) UpdateConfigFromConfigMap ¶
func (aws *AWS) UpdateConfigFromConfigMap(cm map[string]string) (*CustomPricing, error)
type AWSAccessKey ¶
type AWSAccessKey struct { AccessKeyID string `json:"aws_access_key_id"` SecretAccessKey string `json:"aws_secret_access_key"` }
AWSAccessKey holds AWS credentials and fulfils the awsV2.CredentialsProvider interface
func (AWSAccessKey) CreateConfig ¶
func (accessKey AWSAccessKey) CreateConfig(region string) (awsSDK.Config, error)
CreateConfig creates an AWS SDK V2 Config for the credentials that it contains for the provided region
func (AWSAccessKey) Retrieve ¶
func (accessKey AWSAccessKey) Retrieve(ctx context.Context) (awsSDK.Credentials, error)
Retrieve returns a set of awsV2 credentials using the AWSAccessKey's key and secret. This fulfils the awsV2.CredentialsProvider interface contract.
type AWSCurrencyCode ¶
AWSCurrencyCode is the localized currency. (TODO: support non-USD)
type AWSOfferTerm ¶
type AWSOfferTerm struct { Sku string `json:"sku"` PriceDimensions map[string]*AWSRateCode `json:"priceDimensions"` }
AWSOfferTerm is a sku extension used to pay for the node.
func (*AWSOfferTerm) String ¶
func (ot *AWSOfferTerm) String() string
type AWSPricing ¶
type AWSPricing struct { Products map[string]*AWSProduct `json:"products"` Terms AWSPricingTerms `json:"terms"` }
AWSPricing maps a k8s node to an AWS Pricing "product"
type AWSPricingTerms ¶
type AWSPricingTerms struct { OnDemand map[string]map[string]*AWSOfferTerm `json:"OnDemand"` Reserved map[string]map[string]*AWSOfferTerm `json:"Reserved"` }
AWSPricingTerms are how you pay for the node: OnDemand, Reserved, or (TODO) Spot
type AWSProduct ¶
type AWSProduct struct { Sku string `json:"sku"` Attributes AWSProductAttributes `json:"attributes"` }
AWSProduct represents a purchased SKU
type AWSProductAttributes ¶
type AWSProductAttributes struct { Location string `json:"location"` InstanceType string `json:"instanceType"` Memory string `json:"memory"` Storage string `json:"storage"` VCpu string `json:"vcpu"` UsageType string `json:"usagetype"` OperatingSystem string `json:"operatingSystem"` PreInstalledSw string `json:"preInstalledSw"` InstanceFamily string `json:"instanceFamily"` CapacityStatus string `json:"capacitystatus"` GPU string `json:"gpu"` // GPU represents the number of GPU on the instance }
AWSProductAttributes represents metadata about the product used to map to a node.
type AWSProductTerms ¶
type AWSProductTerms struct { Sku string `json:"sku"` OnDemand *AWSOfferTerm `json:"OnDemand"` Reserved *AWSOfferTerm `json:"Reserved"` Memory string `json:"memory"` Storage string `json:"storage"` VCpu string `json:"vcpu"` GPU string `json:"gpu"` // GPU represents the number of GPU on the instance PV *PV `json:"pv"` }
AWSProductTerms represents the full terms of the product
type AWSRateCode ¶
type AWSRateCode struct { Unit string `json:"unit"` PricePerUnit AWSCurrencyCode `json:"pricePerUnit"` }
AWSRateCode encodes data about the price of a product
func (*AWSRateCode) String ¶
func (rc *AWSRateCode) String() string
type AwsAthenaInfo ¶
type AwsAthenaInfo struct { AthenaBucketName string `json:"athenaBucketName"` AthenaRegion string `json:"athenaRegion"` AthenaDatabase string `json:"athenaDatabase"` AthenaTable string `json:"athenaTable"` AthenaWorkgroup string `json:"athenaWorkgroup"` ServiceKeyName string `json:"serviceKeyName"` ServiceKeySecret string `json:"serviceKeySecret"` AccountID string `json:"projectID"` MasterPayerARN string `json:"masterPayerARN"` }
AwsAthenaInfo contains configuration for CUR integration
func (*AwsAthenaInfo) CreateConfig ¶
func (aai *AwsAthenaInfo) CreateConfig() (awsSDK.Config, error)
CreateConfig creates an AWS SDK V2 Config for the credentials that it contains
func (*AwsAthenaInfo) IsEmpty ¶
func (aai *AwsAthenaInfo) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type AwsSpotFeedInfo ¶
type AwsSpotFeedInfo struct { BucketName string `json:"bucketName"` Prefix string `json:"prefix"` Region string `json:"region"` AccountID string `json:"projectID"` ServiceKeyName string `json:"serviceKeyName"` ServiceKeySecret string `json:"serviceKeySecret"` SpotLabel string `json:"spotLabel"` SpotLabelValue string `json:"spotLabelValue"` }
AwsSpotFeedInfo contains configuration for spot feed integration
type Azure ¶
type Azure struct { Pricing map[string]*AzurePricing DownloadPricingDataLock sync.RWMutex Clientset clustercache.ClusterCache Config *ProviderConfig RateCardPricingError error // contains filtered or unexported fields }
func (*Azure) AllNodePricing ¶
AllNodePricing returns the Azure pricing objects stored
func (*Azure) ApplyReservedInstancePricing ¶
func (*Azure) ClusterManagementPricing ¶
func (*Azure) CombinedDiscountForNode ¶
func (*Azure) DownloadPricingData ¶
DownloadPricingData uses provided azure "best guesses" for pricing
func (*Azure) GetAddresses ¶
func (*Azure) GetAzureStorageConfig ¶
func (az *Azure) GetAzureStorageConfig(forceReload bool, cp *CustomPricing) (*AzureStorageConfig, error)
GetAzureStorageConfig retrieves storage config from secret and sets default values
func (*Azure) GetConfig ¶
func (az *Azure) GetConfig() (*CustomPricing, error)
func (*Azure) GetLocalStorageQuery ¶
func (*Azure) GetManagementPlatform ¶
func (*Azure) LoadBalancerPricing ¶
func (azr *Azure) LoadBalancerPricing() (*LoadBalancer, error)
LoadBalancerPricing on Azure, LoadBalancer services correspond to public IPs. For now the pricing of LoadBalancer services will be that of a standard static public IP https://azure.microsoft.com/en-us/pricing/details/ip-addresses/. Azure still has load balancers which follow the standard pricing scheme based on rules https://azure.microsoft.com/en-us/pricing/details/load-balancer/, they are created on a per-cluster basis.
func (*Azure) NetworkPricing ¶
Stubbed NetworkPricing for Azure. Pull directly from azure.json for now
func (*Azure) NodePricing ¶
NodePricing returns Azure pricing data for a single node
func (*Azure) PricingSourceStatus ¶
func (az *Azure) PricingSourceStatus() map[string]*PricingSource
PricingSourceStatus returns the status of the rate card api
func (*Azure) ServiceAccountStatus ¶
func (az *Azure) ServiceAccountStatus() *ServiceAccountStatus
func (*Azure) UpdateConfig ¶
func (*Azure) UpdateConfigFromConfigMap ¶
func (az *Azure) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type AzureAppKey ¶
type AzureAppKey struct { AppID string `json:"appId"` DisplayName string `json:"displayName"` Name string `json:"name"` Password string `json:"password"` Tenant string `json:"tenant"` }
Represents an azure app key
type AzurePricing ¶
AzurePricing either contains a Node or PV
type AzureRetailPricing ¶
type AzureRetailPricing struct { BillingCurrency string `json:"BillingCurrency"` CustomerEntityId string `json:"CustomerEntityId"` CustomerEntityType string `json:"CustomerEntityType"` Items []AzureRetailPricingAttributes `json:"Items"` NextPageLink string `json:"NextPageLink"` Count int `json:"Count"` }
AzureRetailPricing struct for unmarshalling Azure Retail pricing api JSON response
type AzureRetailPricingAttributes ¶
type AzureRetailPricingAttributes struct { CurrencyCode string `json:"currencyCode"` TierMinimumUnits float32 `json:"tierMinimumUnits"` RetailPrice float32 `json:"retailPrice"` UnitPrice float32 `json:"unitPrice"` ArmRegionName string `json:"armRegionName"` Location string `json:"location"` EffectiveStartDate *time.Time `json:"effectiveStartDate"` EffectiveEndDate *time.Time `json:"effectiveEndDate"` MeterId string `json:"meterId"` MeterName string `json:"meterName"` ProductId string `json:"productId"` 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"` }
AzureRetailPricingAttributes struct for unmarshalling Azure Retail pricing api JSON response
type AzureServiceKey ¶
type AzureServiceKey struct { SubscriptionID string `json:"subscriptionId"` ServiceKey *AzureAppKey `json:"serviceKey"` }
Azure service key for a specific subscription
func (*AzureServiceKey) IsValid ¶
func (ask *AzureServiceKey) IsValid() bool
Validity check on service key
type AzureStorageConfig ¶
type AzureStorageConfig struct { SubscriptionId string `json:"azureSubscriptionID"` AccountName string `json:"azureStorageAccount"` AccessKey string `json:"azureStorageAccessKey"` ContainerName string `json:"azureStorageContainer"` ContainerPath string `json:"azureContainerPath"` AzureCloud string `json:"azureCloud"` }
AzureStorageConfig Represents an azure storage config
func (*AzureStorageConfig) IsEmpty ¶
func (asc *AzureStorageConfig) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type BigQueryConfig ¶
type BigQueryConfig struct { ProjectID string `json:"projectID"` BillingDataDataset string `json:"billingDataDataset"` Key map[string]string `json:"key"` }
BigQueryConfig contain the required config and credentials to access OOC resources for GCP
func (*BigQueryConfig) IsEmpty ¶
func (bqc *BigQueryConfig) IsEmpty() bool
IsEmpty returns true if all fields in config are empty, false if not.
type CSVProvider ¶
type CSVProvider struct { *CustomProvider CSVLocation string Pricing map[string]*price NodeClassPricing map[string]float64 NodeClassCount map[string]float64 NodeMapField string PricingPV map[string]*price PVMapField string UsesRegion bool DownloadPricingDataLock sync.RWMutex }
func (*CSVProvider) ClusterManagementPricing ¶
func (*CSVProvider) ClusterManagementPricing() (string, float64, error)
func (*CSVProvider) CombinedDiscountForNode ¶
func (c *CSVProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64
func (*CSVProvider) DownloadPricingData ¶
func (c *CSVProvider) DownloadPricingData() error
func (*CSVProvider) GetPVKey ¶
func (c *CSVProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
func (*CSVProvider) NodePricing ¶
func (c *CSVProvider) NodePricing(key Key) (*Node, error)
func (*CSVProvider) Regions ¶
func (c *CSVProvider) Regions() []string
func (*CSVProvider) ServiceAccountStatus ¶
func (c *CSVProvider) ServiceAccountStatus() *ServiceAccountStatus
type CustomPricing ¶
type CustomPricing struct { Provider string `json:"provider"` Description string `json:"description"` CPU string `json:"CPU"` SpotCPU string `json:"spotCPU"` RAM string `json:"RAM"` SpotRAM string `json:"spotRAM"` GPU string `json:"GPU"` SpotGPU string `json:"spotGPU"` Storage string `json:"storage"` ZoneNetworkEgress string `json:"zoneNetworkEgress"` RegionNetworkEgress string `json:"regionNetworkEgress"` InternetNetworkEgress string `json:"internetNetworkEgress"` FirstFiveForwardingRulesCost string `json:"firstFiveForwardingRulesCost"` AdditionalForwardingRuleCost string `json:"additionalForwardingRuleCost"` LBIngressDataCost string `json:"LBIngressDataCost"` SpotLabel string `json:"spotLabel,omitempty"` SpotLabelValue string `json:"spotLabelValue,omitempty"` GpuLabel string `json:"gpuLabel,omitempty"` GpuLabelValue string `json:"gpuLabelValue,omitempty"` ServiceKeyName string `json:"awsServiceKeyName,omitempty"` ServiceKeySecret string `json:"awsServiceKeySecret,omitempty"` SpotDataRegion string `json:"awsSpotDataRegion,omitempty"` SpotDataBucket string `json:"awsSpotDataBucket,omitempty"` SpotDataPrefix string `json:"awsSpotDataPrefix,omitempty"` ProjectID string `json:"projectID,omitempty"` AthenaProjectID string `json:"athenaProjectID,omitempty"` AthenaBucketName string `json:"athenaBucketName"` AthenaRegion string `json:"athenaRegion"` AthenaDatabase string `json:"athenaDatabase"` AthenaTable string `json:"athenaTable"` AthenaWorkgroup string `json:"athenaWorkgroup"` MasterPayerARN string `json:"masterPayerARN"` BillingDataDataset string `json:"billingDataDataset,omitempty"` CustomPricesEnabled string `json:"customPricesEnabled"` DefaultIdle string `json:"defaultIdle"` AzureSubscriptionID string `json:"azureSubscriptionID"` AzureClientID string `json:"azureClientID"` AzureClientSecret string `json:"azureClientSecret"` AzureTenantID string `json:"azureTenantID"` AzureBillingRegion string `json:"azureBillingRegion"` AzureOfferDurableID string `json:"azureOfferDurableID"` AzureStorageSubscriptionID string `json:"azureStorageSubscriptionID"` AzureStorageAccount string `json:"azureStorageAccount"` AzureStorageAccessKey string `json:"azureStorageAccessKey"` AzureStorageContainer string `json:"azureStorageContainer"` AzureContainerPath string `json:"azureContainerPath"` AzureCloud string `json:"azureCloud"` CurrencyCode string `json:"currencyCode"` Discount string `json:"discount"` NegotiatedDiscount string `json:"negotiatedDiscount"` ClusterName string `json:"clusterName"` ReadOnly string `json:"readOnly"` EditorAccess string `json:"editorAccess"` KubecostToken string `json:"kubecostToken"` GoogleAnalyticsTag string `json:"googleAnalyticsTag"` ExcludeProviderID string `json:"excludeProviderID"` }
func DefaultPricing ¶
func DefaultPricing() *CustomPricing
DefaultPricing should be returned so we can do computation even if no file is supplied.
func (*CustomPricing) GetSharedOverheadCostPerMonth ¶
func (cp *CustomPricing) GetSharedOverheadCostPerMonth() float64
GetSharedOverheadCostPerMonth parses and returns a float64 representation of the configured monthly shared overhead cost. If the string version cannot be parsed into a float, an error is logged and 0.0 is returned.
type CustomProvider ¶
type CustomProvider struct { Clientset clustercache.ClusterCache Pricing map[string]*NodePrice SpotLabel string SpotLabelValue string GPULabel string GPULabelValue string DownloadPricingDataLock sync.RWMutex Config *ProviderConfig }
func (*CustomProvider) AllNodePricing ¶
func (cp *CustomProvider) AllNodePricing() (interface{}, error)
func (*CustomProvider) ApplyReservedInstancePricing ¶
func (*CustomProvider) ApplyReservedInstancePricing(nodes map[string]*Node)
func (*CustomProvider) ClusterInfo ¶
func (cp *CustomProvider) ClusterInfo() (map[string]string, error)
func (*CustomProvider) ClusterManagementPricing ¶
func (*CustomProvider) ClusterManagementPricing() (string, float64, error)
func (*CustomProvider) CombinedDiscountForNode ¶
func (cp *CustomProvider) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64
func (*CustomProvider) DownloadPricingData ¶
func (cp *CustomProvider) DownloadPricingData() error
func (*CustomProvider) ExternalAllocations ¶
func (*CustomProvider) ExternalAllocations(start string, end string, aggregator []string, filterType string, filterValue string, crossCluster bool) ([]*OutOfClusterAllocation, error)
ExternalAllocations represents tagged assets outside the scope of kubernetes. "start" and "end" are dates of the format YYYY-MM-DD "aggregator" is the tag used to determine how to allocate those assets, ie namespace, pod, etc.
func (*CustomProvider) GetAddresses ¶
func (*CustomProvider) GetAddresses() ([]byte, error)
func (*CustomProvider) GetConfig ¶
func (cp *CustomProvider) GetConfig() (*CustomPricing, error)
func (*CustomProvider) GetDisks ¶
func (*CustomProvider) GetDisks() ([]byte, error)
func (*CustomProvider) GetLocalStorageQuery ¶
func (*CustomProvider) GetManagementPlatform ¶
func (*CustomProvider) GetManagementPlatform() (string, error)
func (*CustomProvider) GetPVKey ¶
func (*CustomProvider) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, defaultRegion string) PVKey
func (*CustomProvider) LoadBalancerPricing ¶
func (cp *CustomProvider) LoadBalancerPricing() (*LoadBalancer, error)
func (*CustomProvider) NetworkPricing ¶
func (cp *CustomProvider) NetworkPricing() (*Network, error)
func (*CustomProvider) NodePricing ¶
func (cp *CustomProvider) NodePricing(key Key) (*Node, error)
func (*CustomProvider) PricingSourceStatus ¶
func (cp *CustomProvider) PricingSourceStatus() map[string]*PricingSource
func (*CustomProvider) Regions ¶
func (cp *CustomProvider) Regions() []string
func (*CustomProvider) ServiceAccountStatus ¶
func (cp *CustomProvider) ServiceAccountStatus() *ServiceAccountStatus
func (*CustomProvider) UpdateConfig ¶
func (cp *CustomProvider) UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error)
func (*CustomProvider) UpdateConfigFromConfigMap ¶
func (cp *CustomProvider) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type GCP ¶
type GCP struct { Pricing map[string]*GCPPricing Clientset clustercache.ClusterCache APIKey string BaseCPUPrice string ProjectID string BillingDataDataset string DownloadPricingDataLock sync.RWMutex ReservedInstances []*GCPReservedInstance Config *ProviderConfig ServiceKeyProvided bool ValidPricingKeys map[string]bool *CustomProvider // contains filtered or unexported fields }
GCP implements a provider interface for GCP
func (*GCP) AllNodePricing ¶
AllNodePricing returns the GCP pricing objects stored
func (*GCP) ApplyReservedInstancePricing ¶
func (*GCP) ClusterInfo ¶
ClusterInfo returns information on the GKE cluster, as provided by metadata.
func (*GCP) ClusterManagementPricing ¶
func (*GCP) CombinedDiscountForNode ¶
func (*GCP) DownloadPricingData ¶
DownloadPricingData fetches data from the GCP Pricing API. Requires a key-- a kubecost key is provided for quickstart, but should be replaced by a users.
func (*GCP) GetAddresses ¶
func (*GCP) GetConfig ¶
func (gcp *GCP) GetConfig() (*CustomPricing, error)
func (*GCP) GetDisks ¶
GetDisks returns the GCP disks backing PVs. Useful because sometimes k8s will not clean up PVs correctly. Requires a json config in /var/configs with key region.
func (*GCP) GetLocalStorageQuery ¶
GetLocalStorageQuery returns the cost of local storage for the given window. Setting rate=true returns hourly spend. Setting used=true only tracks used storage, not total.
func (*GCP) GetManagementPlatform ¶
func (*GCP) LoadBalancerPricing ¶
func (gcp *GCP) LoadBalancerPricing() (*LoadBalancer, error)
func (*GCP) NetworkPricing ¶
Stubbed NetworkPricing for GCP. Pull directly from gcp.json for now
func (*GCP) NodePricing ¶
NodePricing returns GCP pricing data for a single node
func (*GCP) PricingSourceStatus ¶
func (gcp *GCP) PricingSourceStatus() map[string]*PricingSource
func (*GCP) ServiceAccountStatus ¶
func (gcp *GCP) ServiceAccountStatus() *ServiceAccountStatus
func (*GCP) UpdateConfig ¶
func (*GCP) UpdateConfigFromConfigMap ¶
func (gcp *GCP) UpdateConfigFromConfigMap(a map[string]string) (*CustomPricing, error)
type GCPPricing ¶
type GCPPricing struct { Name string `json:"name"` SKUID string `json:"skuId"` Description string `json:"description"` Category *GCPResourceInfo `json:"category"` ServiceRegions []string `json:"serviceRegions"` PricingInfo []*PricingInfo `json:"pricingInfo"` ServiceProviderName string `json:"serviceProviderName"` Node *Node `json:"node"` PV *PV `json:"pv"` }
GCPPricing represents GCP pricing data for a SKU
type GCPReservedCounter ¶
type GCPReservedCounter struct { RemainingCPU int64 RemainingRAM int64 Instance *GCPReservedInstance }
type GCPReservedInstance ¶
type GCPReservedInstance struct { ReservedRAM int64 ReservedCPU int64 Plan *GCPReservedInstancePlan StartDate time.Time EndDate time.Time Region string }
func (*GCPReservedInstance) String ¶
func (r *GCPReservedInstance) String() string
type GCPReservedInstancePlan ¶
type GCPResourceInfo ¶
type GCPResourceInfo struct { ServiceDisplayName string `json:"serviceDisplayName"` ResourceFamily string `json:"resourceFamily"` ResourceGroup string `json:"resourceGroup"` UsageType string `json:"usageType"` }
GCPResourceInfo contains metadata about the node.
type Key ¶
type Key interface { ID() string // ID represents an exact match Features() string // Features are a comma separated string of node metadata that could match pricing GPUType() string // GPUType returns "" if no GPU exists, but the name of the GPU otherwise }
Key represents a way for nodes to match between the k8s API and a pricing API
type LoadBalancer ¶
type LoadBalancer struct { IngressIPAddresses []string `json:"IngressIPAddresses"` Cost float64 `json:"hourlyCost"` }
LoadBalancer is the interface by which the provider and cost model communicate LoadBalancer prices. The provider will best-effort try to fill out this struct.
type Network ¶
type Network struct { ZoneNetworkEgressCost float64 RegionNetworkEgressCost float64 InternetNetworkEgressCost float64 }
Network is the interface by which the provider and cost model communicate network egress prices. The provider will best-effort try to fill out this struct.
type Node ¶
type Node struct { Cost string `json:"hourlyCost"` VCPU string `json:"CPU"` VCPUCost string `json:"CPUHourlyCost"` RAM string `json:"RAM"` RAMBytes string `json:"RAMBytes"` RAMCost string `json:"RAMGBHourlyCost"` Storage string `json:"storage"` StorageCost string `json:"storageHourlyCost"` UsesBaseCPUPrice bool `json:"usesDefaultPrice"` BaseCPUPrice string `json:"baseCPUPrice"` // Used to compute an implicit RAM GB/Hr price when RAM pricing is not provided. BaseRAMPrice string `json:"baseRAMPrice"` // Used to compute an implicit RAM GB/Hr price when RAM pricing is not provided. BaseGPUPrice string `json:"baseGPUPrice"` UsageType string `json:"usageType"` GPU string `json:"gpu"` // GPU represents the number of GPU on the instance GPUName string `json:"gpuName"` GPUCost string `json:"gpuCost"` InstanceType string `json:"instanceType,omitempty"` Region string `json:"region,omitempty"` Reserved *ReservedInstanceData `json:"reserved,omitempty"` ProviderID string `json:"providerID,omitempty"` PricingType PricingType `json:"pricingType,omitempty"` }
Node is the interface by which the provider and cost model communicate Node prices. The provider will best-effort try to fill out this struct.
type OutOfClusterAllocation ¶
type OutOfClusterAllocation struct { Aggregator string `json:"aggregator"` Environment string `json:"environment"` Service string `json:"service"` Cost float64 `json:"cost"` Cluster string `json:"cluster"` }
OutOfClusterAllocation represents a cloud provider cost not associated with kubernetes
type PV ¶
type PV struct { Cost string `json:"hourlyCost"` CostPerIO string `json:"costPerIOOperation"` Class string `json:"storageClass"` Size string `json:"size"` Region string `json:"region"` ProviderID string `json:"providerID,omitempty"` Parameters map[string]string `json:"parameters"` }
PV is the interface by which the provider and cost model communicate PV prices. The provider will best-effort try to fill out this struct.
type PricingExpression ¶
type PricingExpression struct { UsageUnit string `json:"usageUnit"` UsageUnitDescription string `json:"usageUnitDescription"` BaseUnit string `json:"baseUnit"` BaseUnitConversionFactor int64 `json:"-"` DisplayQuantity int `json:"displayQuantity"` TieredRates []*TieredRates `json:"tieredRates"` }
PricingExpression contains metadata about a cost.
type PricingInfo ¶
type PricingInfo struct { Summary string `json:"summary"` PricingExpression *PricingExpression `json:"pricingExpression"` CurrencyConversionRate float64 `json:"currencyConversionRate"` EffectiveTime string `json:""` }
PricingInfo contains metadata about a cost.
type PricingMatchMetadata ¶
type PricingMatchMetadata struct { TotalNodes int `json:"TotalNodes"` PricingTypeCounts map[PricingType]int `json:"PricingType"` }
type PricingSource ¶
type PricingSources ¶
type PricingSources struct {
PricingSources map[string]*PricingSource
}
type PricingType ¶
type PricingType string
const ( Api PricingType = "api" Spot PricingType = "spot" Reserved PricingType = "reserved" SavingsPlan PricingType = "savingsPlan" CsvExact PricingType = "csvExact" CsvClass PricingType = "csvClass" DefaultPrices PricingType = "defaultPrices" )
type Provider ¶
type Provider interface { ClusterInfo() (map[string]string, error) GetAddresses() ([]byte, error) GetDisks() ([]byte, error) NodePricing(Key) (*Node, error) PVPricing(PVKey) (*PV, error) NetworkPricing() (*Network, error) // TODO: add key interface arg for dynamic price fetching LoadBalancerPricing() (*LoadBalancer, error) // TODO: add key interface arg for dynamic price fetching AllNodePricing() (interface{}, error) DownloadPricingData() error GetKey(map[string]string, *v1.Node) Key GetPVKey(*v1.PersistentVolume, map[string]string, string) PVKey UpdateConfig(r io.Reader, updateType string) (*CustomPricing, error) UpdateConfigFromConfigMap(map[string]string) (*CustomPricing, error) GetConfig() (*CustomPricing, error) GetManagementPlatform() (string, error) GetLocalStorageQuery(time.Duration, time.Duration, bool, bool) string ApplyReservedInstancePricing(map[string]*Node) ServiceAccountStatus() *ServiceAccountStatus PricingSourceStatus() map[string]*PricingSource ClusterManagementPricing() (string, float64, error) CombinedDiscountForNode(string, bool, float64, float64) float64 Regions() []string }
Provider represents a k8s provider.
func NewProvider ¶
func NewProvider(cache clustercache.ClusterCache, apiKey string, config *config.ConfigFileManager) (Provider, error)
NewProvider looks at the nodespec or provider metadata server to decide which provider to instantiate.
type ProviderConfig ¶
type ProviderConfig struct {
// contains filtered or unexported fields
}
ProviderConfig is a utility class that provides a thread-safe configuration storage/cache for all Provider implementations
func NewProviderConfig ¶
func NewProviderConfig(configManager *config.ConfigFileManager, fileName string) *ProviderConfig
NewProviderConfig creates a new ConfigFile and returns the ProviderConfig
func (*ProviderConfig) ConfigFileManager ¶
func (pc *ProviderConfig) ConfigFileManager() *config.ConfigFileManager
ConfigFileManager returns the ConfigFileManager instance used to manage the CustomPricing configuration. In the event of a multi-provider setup, this instance should be used to configure any other configuration providers.
func (*ProviderConfig) GetCustomPricingData ¶
func (pc *ProviderConfig) GetCustomPricingData() (*CustomPricing, error)
ThreadSafe method for retrieving the custom pricing config.
func (*ProviderConfig) Update ¶
func (pc *ProviderConfig) Update(updateFunc func(*CustomPricing) error) (*CustomPricing, error)
Allows a call to manually update the configuration while maintaining proper thread-safety for read/write methods.
func (*ProviderConfig) UpdateFromMap ¶
func (pc *ProviderConfig) UpdateFromMap(a map[string]string) (*CustomPricing, error)
ThreadSafe update of the config using a string map
type ReservedInstanceData ¶
type ReservedInstanceData struct { ReservedCPU int64 `json:"reservedCPU"` ReservedRAM int64 `json:"reservedRAM"` CPUCost float64 `json:"CPUHourlyCost"` RAMCost float64 `json:"RAMHourlyCost"` }
ReservedInstanceData keeps record of resources on a node should be priced at reserved rates
type SavingsPlanData ¶
type ServiceAccountCheck ¶
type ServiceAccountChecks ¶
ServiceAccountChecks is a thread safe map for holding ServiceAccountCheck objects
func NewServiceAccountChecks ¶
func NewServiceAccountChecks() *ServiceAccountChecks
NewServiceAccountChecks initialize ServiceAccountChecks
type ServiceAccountStatus ¶
type ServiceAccountStatus struct {
Checks []*ServiceAccountCheck `json:"checks"`
}
type TieredRates ¶
type TieredRates struct { StartUsageAmount int `json:"startUsageAmount"` UnitPrice *UnitPriceInfo `json:"unitPrice"` }
TieredRates contain data about variable pricing.
type UnitPriceInfo ¶
type UnitPriceInfo struct { CurrencyCode string `json:"currencyCode"` Units string `json:"units"` Nanos float64 `json:"nanos"` }
UnitPriceInfo contains data about the actual price being charged.