GEThttps://api.spotinst.io/mcs/ecs/cluster/{clusterIdentifier}/costs?fromDate={timeDate}&toDate={timeDate}®ion={region}&accountId={ACCOUNT_ID}

Describes ECS cluster costs in a time range based on resource allocation.

URL Parameters

Parameter Type Description
toDate * String

data values following either a date format (yyyy-mm-dd ; 2016-11-20) or Unix Timestamp (1494751821472)

fromDate * String

data values following either a date format (yyyy-mm-dd ; 2016-11-20) or Unix Timestamp (1494751821472)

aggregationPeriod String

Possible values: "daily", null. For daily value response contains aggregated data by day. If null - response returns sum of costs per period

region * String

Region of the ECS cluster

Example: us-east-1
ACCOUNT_ID * String

Your Spotinst accountId associated with your token

Example: act-123abc
Response - 200

Headers
Copied!
Downloaded!
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "027a9294-3fbc-43e4-93fb-6fd6f4d1ddc9",
    "url": "/mcs/ecs/cluster/clust1/costs?toDate=1570542688000&fromDate=1546354288000&region=us-east-1&accountId=act-123abc",
    "method": "GET",
    "timestamp": "2019-10-10T08:38:22.112Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:mcs:ecs:cluster:costs",
    "items": [
      {
        "totalCost": 381.4525000000035,
        "headroomCost": 15.30586670710722,
        "standAloneTasksCost": 1.6160270543387047,
        "ecsGroups": [
          {
            "name": "service:vpc-2",
            "type": "SERVICE | HEADROOM | STAND_ALONE | IDLE",
            "cost": 3.5921686343689183
          },
          {
            "name": "service:2018",
            "type": "SERVICE",
            "cost": 0.031939288313196895
          },
          {
            "name": "service:check-constraints",
            "type": "SERVICE",
            "cost": 0.9403028633242414
          },
          {
            "name": "service:Test",
            "type": "SERVICE",
            "cost": 0.24269930793699204
          }
        ]
      }
    ],
    "count": 1
  }
}