Documentation
¶
Index ¶
- func QueryAggCostModel(p AggCostModelParameters) (map[string]Aggregation, error)
- func QueryAllocation(p AllocationParameters) ([]map[string]kubecost.Allocation, error)
- func QueryCurrencyCode(p CurrencyCodeParameters) (string, error)
- type AggCostModelParameters
- type Aggregation
- type AllocationParameters
- type CurrencyCodeParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryAggCostModel ¶
func QueryAggCostModel(p AggCostModelParameters) (map[string]Aggregation, error)
QueryAggCostModel queries /model/aggregatedCostModel by proxying a request to Kubecost through the Kubernetes API server if useProxy is true or, if it isn't, by temporarily port forwarding to a Kubecost pod.
func QueryAllocation ¶
func QueryAllocation(p AllocationParameters) ([]map[string]kubecost.Allocation, error)
QueryAllocation queries /model/allocation by proxying a request to Kubecost through the Kubernetes API server if useProxy is true or, if it isn't, by temporarily port forwarding to a Kubecost pod.
func QueryCurrencyCode ¶ added in v0.1.9
func QueryCurrencyCode(p CurrencyCodeParameters) (string, error)
Types ¶
type AggCostModelParameters ¶ added in v0.2.1
type Aggregation ¶
type Aggregation struct { Aggregator string `json:"aggregation"` Subfields []string `json:"subfields,omitempty"` Environment string `json:"environment"` Cluster string `json:"cluster,omitempty"` Properties *kubecost.Properties `json:"-"` CPUAllocationHourlyAverage float64 `json:"cpuAllocationAverage"` CPUAllocationVectors []*util.Vector `json:"-"` CPUAllocationTotal float64 `json:"-"` CPUCost float64 `json:"cpuCost"` CPUCostVector []*util.Vector `json:"cpuCostVector,omitempty"` CPUEfficiency float64 `json:"cpuEfficiency"` CPURequestedVectors []*util.Vector `json:"-"` CPUUsedVectors []*util.Vector `json:"-"` Efficiency float64 `json:"efficiency"` GPUAllocationHourlyAverage float64 `json:"gpuAllocationAverage"` GPUAllocationVectors []*util.Vector `json:"-"` GPUCost float64 `json:"gpuCost"` GPUCostVector []*util.Vector `json:"gpuCostVector,omitempty"` GPUAllocationTotal float64 `json:"-"` RAMAllocationHourlyAverage float64 `json:"ramAllocationAverage"` RAMAllocationVectors []*util.Vector `json:"-"` RAMAllocationTotal float64 `json:"-"` RAMCost float64 `json:"ramCost"` RAMCostVector []*util.Vector `json:"ramCostVector,omitempty"` RAMEfficiency float64 `json:"ramEfficiency"` RAMRequestedVectors []*util.Vector `json:"-"` RAMUsedVectors []*util.Vector `json:"-"` PVAllocationHourlyAverage float64 `json:"pvAllocationAverage"` PVAllocationVectors []*util.Vector `json:"-"` PVAllocationTotal float64 `json:"-"` PVCost float64 `json:"pvCost"` PVCostVector []*util.Vector `json:"pvCostVector,omitempty"` NetworkCost float64 `json:"networkCost"` NetworkCostVector []*util.Vector `json:"networkCostVector,omitempty"` TotalCost float64 `json:"totalCost"` TotalCostVector []*util.Vector `json:"totalCostVector,omitempty"` }
Hardcoded instead of imported because of dependency problems introduced when github.com/kubecost/cost-model/pkg/costmodel is imported. The breakage involves Azure's go-autorest, the azure-sdk-for-go, and k8s client-go. Basically, cost-model uses a very old version of client-go, etc. that causes a breakage.