Skip to main content

Usage Count By Cloud Type V1

POST 

/license/api/v1/usage

Returns a breakdown of resources used per account for a single cloud type.

You can request usage data in one of the following formats;

  • Receive paginated usage data in the response object
  • Download usage data in a CSV file

By default, you will receive your paginated usage data in the response object. You can control the number of items in the response object through the limit request body parameter. If data beyond what's in the response object is available, the response object attribute nextPageToken will provide a token you can set in the request parameter pageToken of your next request to get the next page of usage data.

To download the usage data in a CSV file, set the following:

  • Request header: Accept: application/octet-stream
  • Request body parameter: csvHeaderRequired = true.

The following example curl command requests usage data in a CSV file:

curl --location --request POST 'https://api.prismacloud.io/license/api/v1/usage' \
--header 'x-redlock-auth:<your JWT>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/octet-stream' \
--data-raw '{
"timeRange": {
"type": "relative",
"value": {
"amount": 1,
"unit": "month"
}
},
"accountIds": [
"123456789987",
"987654321123"
],
"cloudType": "AWS",
"csvHeaderRequired": true
}'

Request

Query Parameters

    cloud_type stringrequired

Body

required
    accountIds string[]required

    List of account IDs

    limit int32

    Limit no of records per request

    timeRange objectrequired

    Model for TimeRangeConfig

    type stringrequired

    Possible values: [relative]

    value object

    Model for RelativeTimeDuration

    unit string

    Possible values: [minute, hour, day, week, month, year, epoch, login, INVALID, minute, hour, day, week, month, year, epoch, login]

    Time unit

    amount int32

    Number of time units

    relativeTimeType string

    Possible values: [BACKWARD]

    cloudType string

    Cloud type values

    csvHeaderRequired boolean

    CSV file header

    pageToken string

    Page token for pagination

    offset int64

    Offset

Responses

Table query paginated Api response.

Schema
    headerComments string[]

    List of header comments

    headers string[]

    List of headers

    rows array[]

    List of rows

Loading...