v1

latestOpenAPI 3.0.02026-08-0645003.8 MB
Insights Service

Get Costs Per Account

Retrieve costs up to one year back per specified account over a specified time period.

get/gcp/gce/costs

Query parameters

accountIdstring

The Spot account ID for which the cost information should be returned.

fromDatestring
  • The start date of the requested time period.
  • Date values following either a date format (YYYY-MM-DDTHH:mm:ss.SSSZ) or Unix milliseconds timestamp (1668078050004).
  • <a style=color:red>The value cannot be earlier than 1 year back.</a>
toDatestring
  • The end date of the requested time period.
  • Date values following either a date format (YYYY-MM-DDTHH:mm:ss.SSSZ) or Unix milliseconds timestamp (1668078050004).
  • <a style=color:red>The maximum of time period length is 90 days.</a>

Response

Costs Per Account Response

Example response

{
  "request": {
    "id": "67582d0c-108b-4ef7-9fdc-d39678a30844",
    "url": "/gcp/gce/costs",
    "method": "GET",
    "timestamp": "2016-01-10T01:00:00.000Z"
  },
  "response": {
    "kind": "spotinst:gcp:costs",
    "items": [
      {
        "preemptible": {
          "runningHours": 1470.8,
          "actualCosts": 107.3,
          "potentialCosts": 378.41,
          "savingsPercentage": 71.64
        }
      }
    ],
    "count": 1
  }
}