---
title: "Get Ecs Cluster Aggregated Detailed Costs"
method: POST
path: "/ocean/aws/ecs/cluster/{oceanClusterId}/aggregatedCosts"
tags: ["Ocean ECS"]
---

# Get Ecs Cluster Aggregated Detailed Costs

`POST /ocean/aws/ecs/cluster/{oceanClusterId}/aggregatedCosts`

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.

## Parameters

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

## Request body

- object
  - `startTime` string, required — Beginning date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
  - `endTime` string, required — End date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
  - `groupBy` string — The parameter we want to group the costs by, default is grouping by ECS group types. Only a tag key can be passed in.
  - `filter` object — Describe how to filter the costs. Optional field. Can only be used if grouping by tags.
    - `conditions` object, required
      - `anyMatch` object[], required — Array of conditions set that OR operator is applied between them.
        - `allMatch` object[], required — Array of conditions that AND operator is applied between them.\ For example, (label env equals prod) AND (label app exists)
          - `key` string, required — May be any string, but shouldn't be empty.
          - `operator` 'equals' | 'notEquals' | 'exists' | 'notExists', required
          - `value` string — Required whenever the operator is "equals" or "notEquals".

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
