Asset Diff API
Asset Diff API
GET
http://{kubecost-addresss}/model/assets/diff
The Asset Diff API provides a diff of two windows that returns all the added, removed, or cost changed assets from the later window (before parameter) to the earlier window (after parameter). This endpoint does a comparison of two asset sets in the given windows and accumulates the results.
Path Parameters
Name | Type | Description |
---|---|---|
before* | String | Duration in time of the past. Supports hours or days before the current time in the following format: |
after* | String | Duration in time closest to now. Supports hours or days before the current time in the following format: |
costChangeRatio | float64 | Changes the ratio of cost changes when displaying 'Changed' types. e.g. |
aggregate | String | Used to consolidate cost model data. Passing an empty value for this parameter, or not passing one at all, returns data by an individual asset. |
filterClusters | String | Comma-separated list of clusters to match; e.g. |
filterNodes | String | Comma-separated list of nodes to match; e.g. |
filterNamespaces | String | Comma-separated list of namespaces to match; e.g. |
filterLabels | String | Comma-separated list of annotations to match; e.g. |
filterServices | String | Comma-separated list of services to match; e.g. |
filterControllerKinds | String | Comma-separated list of controller kinds to match; e.g. |
filterControllers | String | Comma-separated list of controllers to match; e.g. |
filterPods | String | Comma-separated list of pods to match; e.g. |
filterAnnotations | String | Comma-separated list of annotations to match; e.g. |
filterContainers | String | Comma-separated list of containers to match; e.g. |
API Examples
Compare yesterday's assets to today's assets:
http://localhost:9090/model/assets/diff?before=yesterday&after=today
Compare assets from 5 days ago to assets from the last day:
http://localhost:9090/model/assets/diff?before=1d offset 5d&after=1d
Compare assets from last month to assets from this month:
http://localhost:9090/model/assets/diff?before=lastmonth&after=month
Compare assets on 07/01/2022 to assets on 07/06/2022:
http://localhost:9090/model/assets/diff?before=2022-07-01T00:00:00Z,2022-07-02T00:00:00Z&after=2022-07-06T00:00:00Z,2022-07-07T00:00:00Z
Compare yesterday's assets to today's assets, displaying all assets that have a total cost change of 10% or more:
http://localhost:9090/model/assets/diff?before=yesterday&after=today&costChangeRatio=0.1
Last updated