Usage Count By Cloud Type V1
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
}'
Query Parameters
Request Body required
List of account IDs
Limit no of records per request
timeRange object
Model for TimeRangeConfig
value object
Model for RelativeTimeDuration
Possible values: [minute
, hour
, day
, week
, month
, year
, epoch
, login
, INVALID
, minute, hour, day, week, month, year, epoch, login
]
Time unit
Number of time units
Possible values: [BACKWARD
]
Cloud type values
CSV file header
Page token for pagination
Offset
- 200
- 400
- 403
- 500
Table query paginated Api response.
Schema
List of header comments
List of headers
List of rows
{
"headerComments": [
"string"
],
"headers": [
"string"
],
"rows": [
[
"string"
]
]
}
Schema
- Array [
- ]
total number of rows for the query
token to be used for next page call
items object[]
List of items. Each item contains cloud account name and the workload count of resource type
account object
resourceTypeCount object
stats object
Statistics to be shown. This contains the total workload per resource type
stats object
{
"totalRows": 0,
"nextPageToken": "string",
"items": [
{
"total": 0,
"account": {
"name": "string",
"id": "string"
},
"resourceTypeCount": {}
}
],
"stats": {
"stats": {}
}
}
invalid_parameter_value
Schema
timestamp
Http status
Error message
Error message
Request path
{
"timestamp": "string",
"status": 0,
"error": "string",
"message": "string",
"path": "string"
}
Schema
- Array [
- ]
total number of rows for the query
token to be used for next page call
items object[]
List of items. Each item contains cloud account name and the workload count of resource type
account object
resourceTypeCount object
stats object
Statistics to be shown. This contains the total workload per resource type
stats object
timestamp
Http status
Error message
Error message
Request path
{}
Forbidden
Schema
timestamp
Http status
Error message
Error message
Request path
{
"timestamp": "string",
"status": 0,
"error": "string",
"message": "string",
"path": "string"
}
Schema
- Array [
- ]
total number of rows for the query
token to be used for next page call
items object[]
List of items. Each item contains cloud account name and the workload count of resource type
account object
resourceTypeCount object
stats object
Statistics to be shown. This contains the total workload per resource type
stats object
timestamp
Http status
Error message
Error message
Request path
{}
internal_error
Schema
timestamp
Http status
Error message
Error message
Request path
{
"timestamp": "string",
"status": 0,
"error": "string",
"message": "string",
"path": "string"
}
Schema
- Array [
- ]
total number of rows for the query
token to be used for next page call
items object[]
List of items. Each item contains cloud account name and the workload count of resource type
account object
resourceTypeCount object
stats object
Statistics to be shown. This contains the total workload per resource type
stats object
timestamp
Http status
Error message
Error message
Request path
{}