Get Top Usages

Get Top Usages

The API allows you to get the top N usage metrics with commitments in the last M days starting from their latest update times, sorted in descending order by the usage/commitment ratio. This allows you to quickly identify the usage metrics that are exceeding their commitments the most.

Request
URI
GET
https://console.cloud.vmware.com/commerce/cost-and-usage/api/{org_id}/usage/top-items
COPY
Path Parameters
string
org_id
Required

Unique identifier (GUID) of the organization

Query Parameters
string
locale
Optional

Locale with language preference (e.g. en_US)

integer
date_range
Optional

Requested number of days to specify the time range for usages. Default = 30

integer
count
Optional

Requested number of usage metrics. Default = 5


Responses
200

OK

Returns Array of MetricUsage of type(s) application/json
[
    {
        "metadata": {
            "metric_id": "<metric ID for vRNI vCPUs Public Cloud>",
            "service_definition_id": "<service definition ID for VMC-AWS>",
            "display_name": "i3en US West 2",
            "unit_of_measure_display_name": "Hosts",
            "charge_attributes": {
                "category": "HOST_USAGE"
            }
        },
        "usage": {
            "commitment": 3,
            "usage": 3,
            "overage": 0,
            "status": "AT_COMMITMENT",
            "seller": "VMWARE",
            "last_updated": "2021-06-20T01:02:03.000Z",
            "resources": [
                {
                    "resource_id": "res1",
                    "usage_quantity": 10
                }
            ]
        }
    }
]

400

Bad Request

Returns ApiError of type(s) application/json
{
    "error_code": "string",
    "error_message": "string",
    "error_details": [
        {
            "error_code": "string",
            "error_message": "string"
        }
    ]
}
string
error_code
Required

The code associated with the error

string
error_message
Required

A description of the error that occurred

error_details
Optional

Additional error details for ValidationException errors


401

Unauthorized

Operation doesn't return any data structure

403

Forbidden

Operation doesn't return any data structure