Reports API Overview

Programmatically obtain cost, usage, and savings information for your cloud infrastructure with easy to use RESTful API.

CMP's Cloud Analytics Reports give you instant visibility into your Google Cloud or AWS costs without having to spend agonizing hours scanning through vendor's bills. With Cloud Analytics Reports, you can slice and dice your cloud spend and shine a light on cost & performance optimization opportunities for your organization.

The Reports API lets you programmatically obtain your Google Cloud and Amazon Web Services cost, usage, and savings information with a simple, yet powerful RESTful API.

πŸ‘

API Reference

The Invoices API reference is available at https://developer.doit-intl.com/reference/idofreports

πŸ“˜

Required Permissions

Cloud Analytics (part of Standard User built-in role)

The Reports API has the following methods:

reports.list

The reports.list method lists all reports accessible by your user account, according to the report's access control list (ACL) as described under the Share Cloud Analytics Reports section.

You can filter the list by using one or more of the following parameters.

Parameter

Description

minCreationTime

string
Min value for a report's creation time, in milliseconds since the POSIX epoch. If set, only reports created after or at this timestamp are returned."

maxCreationTime

string
Max value for a report's creation time, in milliseconds since the POSIX epoch. If set, only reports created before or at this timestamp are returned."

filter

string
An expression for filtering the results of the request. The syntax is key:[<value>]. For example, the type:custom will filter the list to the only custom reports.

Supported filter keys:

  • type (can be custom or preset)
  • owner (e.g. [email protected])
  • lastModified (in milliseconds since epoch)

Learn more about how to properly use filter *.list requests

Sample Request:

curl --location \
--request GET 'https://api.doit-intl.com/analytics/v1/reports?maxResults=10' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data-raw ''

πŸ‘

your-api-key

Always replace "your-api-key" with your actual API key as explained at Getting Started

Sample Response:

{
    "pageToken": "1",
    "reports": [
        {
            "id": "9DHZq53WOd1qFSDoFvx5",
            "reportName": "Compute Committed Use Coverage [N1]",
            "owner": "doit-intl.com",
            "type": "preset",
            "lastModified": 1599404375000,
            "urlUI": "https://app.doit-intl.com/customers/eefz2TQFjKhtz29mvzGp/analytics/reports/9DHZq53WOd1qFSDoFvx5"
        },
        {
            "id": "T36M3b1cuCtxhGW6FbfJ",
            "reportName": "Monthly Credits History 12mo",
            "owner": "doit-intl.com",
            "type": "preset",
            "lastModified": 1593378000000,
            "urlUI": "https://app.doit-intl.com/customers/eefz2TQFjKhtz29mvzGp/analytics/reports/T36M3b1cuCtxhGW6FbfJ"
        },
        {
            "id": "eHyeIVike2U8hMzlEeRd",
            "reportName": "Cloud SQL CUD Eligible Consumption",
            "owner": "doit-intl.com",
            "type": "preset",
            "lastModified": 1593378000000,
            "urlUI": "https://app.doit-intl.com/customers/eefz2TQFjKhtz29mvzGp/analytics/reports/eHyeIVike2U8hMzlEeRd"
        }
    ]
}

reports.get

The reports.get method provides access to the results of a Cloud Analytics Report.

Sample Request:

curl --location \
--request GET 'https://api.doit-intl.com/analytics/v1/reports/Am8kcTIToEvR12vy3l45' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-api-key' \
--data-raw ''

πŸ‘

your-api-key

Always replace "your-api-key" with your actual API key as explained at Getting Started

Sample Response:

{
    "id": "4JSdxFwYtTfSL8wZ23nU",
    "reportName": "Translate Costs",
    "owner": "[email protected]",
    "type": "custom",
    "lastModified": 1608138225000,
    "urlUI": "https://dev.hello.doit-intl.com/customers/ImoC9XkrutBysJvyqlBm/analytics/reports/4JSdxFwYtTfSL8wZ23nU",
    "result": {
        "schema": [
            {
                "name": "service_description",
                "type": "string"
            },
            {
                "name": "region",
                "type": "string"
            },
            {
                "name": "sku_description",
                "type": "string"
            },
            {
                "name": "year",
                "type": "string"
            },
            {
                "name": "month",
                "type": "string"
            },
            {
                "name": "cost",
                "type": "float"
            }
        ],
        "rows": [
            [
                "Amazon Elastic Compute Cloud",
                "us-east-1",
                "DataTransfer-Out-Bytes",
                "2020",
                "06",
                25
            ],
            [
                "Amazon Elastic Compute Cloud",
                "us-west-2",
                "USW2-BoxUsage:t2.micro",
                "2020",
                "07",
                6
            ]
        ]
    }
}

Response Body
If successful, the response body contains an instance of Report

{
    "id": String,
    "reportName": String,
    "owner": String,
    "type": Enum,
    "lastModified": String,
    "urlUI": String,
    "result": {
        "schema": Array,
        "rows": Array,
        "ml_features": Array
    }
}

Fields

Field

Description

id

string
The Id of the report

reportName

string
The name of the report

owner

String
The person who owns the report

lastModified

String
Last update date of the report (Epoc time)

result

Object

  • schema - JSON object represnting the Rows values
  • Rows - The report values
  • ml_features - The data related to ML features set on the report, for example: Trending Up

Did this page help you?