Costfluent Public API

Get Kubernetes efficiency

GET
https://api.costfluent.com
/v1/kubernetes/efficiency
Bearer (API token)

Returns the cost, idle cost and CPU and memory used and peak over requested of the workspace's Kubernetes clusters over a window, per cluster, namespace or workload, largest cost first. It reads the clusters' own rows, never the cloud connection's, and returns at most 500 rows.

Needs a token with viewCosts on the workspace.

Get Kubernetes efficiency › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
startDate
​string · date · required
endDate
​string · date · required
level
​string · required
filter
​string | null

Get Kubernetes efficiency › Responses

Success

level
​KubernetesEfficiencyLevel · required
​KubernetesEfficiencyRowResponse[] · required
truncated
​boolean · required
​CurrencyAmount[] · required
currency
​string | null · pattern: ^[A-Z]{3}$
historyFloor
​string | null · date

Report Kubernetes usage

POST
https://api.costfluent.com
/v1/kubernetes/reports
Bearer (API token)

Accepts one aggregated window from the Costfluent Kubernetes agent, as JSON, gzip-compressed with Content-Encoding: gzip, with the token of the cluster it reports for. A cluster is added in Costfluent before its first report, and its token reports for it alone: another cluster_id, or any token that is not a cluster token, is refused with 403. A schema_version this API does not read, newer than it knows or retired, is answered 422 rather than refused as invalid, so the agent keeps the report and retries it.

Needs an organization token with reportKubernetesUsage.

Report Kubernetes usage › Request Body

schema_version
​integer · int32
cluster_id
​string
agent_version
​string
agent_instance_id
​string
window_start
​string · date-time
window_end
​string · date-time
​object | null
​array | null

Report Kubernetes usage › Responses

Accepted

id
​K8sClusterPublicId · pattern: ^k8s_[A-Za-z0-9_-]{2… · required
cluster_id
​string · required
status
​K8sClusterStatus · required