Ocean ECS

Get Ecs Cluster Aggregated Detailed Costs

Provides Ecs cluster resource usage and costs over a time interval which can be grouped and/or filtered by AWS tags,
for example - application name (webapp, backend), environment (production, staging), version etc.
The response will contain a breakdown of the cluster resource costs($) in terms of compute (CPU, memory), storage (block, file, rootVolume). The response will group the cluster usage costs based on the preselected default of Ecs Group Type which is composed of Service, Headroom, Custom Object, Idle and Standalone, or user selected AWS tags.
Within the default grouping, costs are broken down for the Service group, and for tag grouping the costs will be broken up by tag value.

Time Rounding Down: The CostAnalysis API applies rounding down to the hours provided during the call.
For example, the value 1707004799099 (In GMT) representing Saturday, February 3, 2024, 23:59:59.099 is rounded down to Saturday, February 3, 2024, 23:00:00.000, resulting in the omission of one hour of cost.

post/ocean/aws/ecs/cluster/{oceanClusterId}/aggregatedCosts

Parameters

#/paths/~1ocean~1aws~1k8s~1cluster~1%7BoceanClusterId%7D/get/parameters/1 — unresolved $ref
#/paths/~1azure~1costs/get/parameters/0 — unresolved $ref

Request body

startTimestring required

Beginning date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".

endTimestring required

End date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".

groupBystring

The parameter we want to group the costs by, default is grouping by ECS group types. Only a tag key can be passed in.

Example request

{
  "groupBy": "env",
  "filter": {
    "conditions": {
      "anyMatch": [
        {
          "allMatch": [
            {
              "key": "env",
              "operator": "equals",
              "value": "dev"
            },
            {
              "key": "app",
              "operator": "exists"
            }
          ]
        },
        {
          "allMatch": [
            {
              "key": "team",
              "operator": "exists"
            }
          ]
        }
      ]
    }
  }
}