Skip to content

HPE GreenLake Consumption Analytics API (1.0.0)

API reference documentation for the HPE GreenLake Consumption Analytics API.

Overview
Languages
Servers
US West

https://us-west.api.greenlake.hpe.com/

Mock server

https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/consumption-analytics/public/openapi/consumption-analytics-latest/v2/public-reports-v2/

Reports

Reference documentation for reporting operations.

Operations

List report definitions

Request

List the report definitions that are available.

Security
glcUserBearerAuth
Query
limitinteger(int64)[ 0 .. 100 ]

The maximum number of items to return.

Default 10
offsetinteger(int64)

The number of items to skip before starting to collect the result set.

Default "0"
curl -i -X GET \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Success

Bodyapplication/json
countinteger(int32)
itemsArray of objects(ReportIdentifierV2)
offsetinteger(int32)
totalinteger(int32)
Response
application/json

success

{ "count": 2, "total": 2, "offset": 0, "items": [ {}, {} ] }

Generate report from definition

Request

Generates the report based on report definition provided in the request body.

Security
glcUserBearerAuth
Bodyapplication/jsonrequired

The request body containing the details for executing the report.

columnsArray of objects(PublicReportColumn)required

The list of columns to include in the report. Each column specifies a field and optional aggregation function.

columns[].​fieldNamestringrequired

The reference name of the field to include in the report column. Example system fields: 'sys_Provider_s', 'sys_Cost_f'. Example tag and custom fields: 'ext_f8693b3b4c321cc6c7b711be5733f288_s', 'ext_b8697b3b4c391cc6c7b711be5733f333_f'.

columns[].​aggFunctionstring

The aggregation function to apply to the field. Required for metric fields when data needs to be summarized. Examples include SUM, AVG, COUNT, and so on.

Enum"NONE""SUM""COUNT"
filterobject(PublicReportFilter)required
filter.​dateFilterobject(PublicReportDateFilter)required
filter.​dateFilter.​typestringrequired

Defines whether the filter uses a relative date range or an absolute date range.

Enum"ABSOLUTE""RELATIVE"
filter.​dateFilter.​endDatestring(date)

The end date of the filter range. Used when the type is ABSOLUTE.

filter.​dateFilter.​relativeRangestring

A predefined time period relative to the current date. Used when the type is set to RELATIVE.

Enum"YESTERDAY""LAST_7_DAYS""LAST_14_DAYS"
filter.​dateFilter.​startDatestring(date)

The start date of the filter range. Used when the type is ABSOLUTE.

filter.​fieldFiltersArray of objects(PublicReportFieldCriteria)

An optional list of field-level filter conditions that apply to the report. Each condition specifies a field, comparison operator, and one or more values.

curl -i -X POST \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports/execute \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "filter": {
      "dateFilter": {
        "type": "RELATIVE",
        "relativeRange": "LAST_7_DAYS"
      },
      "fieldFilters": [
        {
          "name": "sys_Provider_s",
          "operator": "STARTS_WITH",
          "values": [
            "H"
          ]
        }
      ]
    },
    "columns": [
      {
        "fieldName": "sys_Provider_s"
      },
      {
        "fieldName": "sys_MeterName_s"
      },
      {
        "fieldName": "sys_Cost_f",
        "aggFunction": "SUM"
      }
    ]
  }'

Responses

Report generated successfully

Bodyapplication/json
itemsArray of objects
totalCountinteger(int32)
Response
application/json

success

{ "totalCount": 2, "items": [ {}, {} ] }

Generate report from definition as CSV

Request

Generates a report based on the report definition provided in the request body and returns the result as a downloadable CSV file.

Security
glcUserBearerAuth
Bodyapplication/jsonrequired

The request body containing the details for executing the report.

columnsArray of objects(PublicReportColumn)required

The list of columns to include in the report. Each column specifies a field and optional aggregation function.

columns[].​fieldNamestringrequired

The reference name of the field to include in the report column. Example system fields: 'sys_Provider_s', 'sys_Cost_f'. Example tag and custom fields: 'ext_f8693b3b4c321cc6c7b711be5733f288_s', 'ext_b8697b3b4c391cc6c7b711be5733f333_f'.

columns[].​aggFunctionstring

The aggregation function to apply to the field. Required for metric fields when data needs to be summarized. Examples include SUM, AVG, COUNT, and so on.

Enum"NONE""SUM""COUNT"
filterobject(PublicReportFilter)required
filter.​dateFilterobject(PublicReportDateFilter)required
filter.​dateFilter.​typestringrequired

Defines whether the filter uses a relative date range or an absolute date range.

Enum"ABSOLUTE""RELATIVE"
filter.​dateFilter.​endDatestring(date)

The end date of the filter range. Used when the type is ABSOLUTE.

filter.​dateFilter.​relativeRangestring

A predefined time period relative to the current date. Used when the type is set to RELATIVE.

Enum"YESTERDAY""LAST_7_DAYS""LAST_14_DAYS"
filter.​dateFilter.​startDatestring(date)

The start date of the filter range. Used when the type is ABSOLUTE.

filter.​fieldFiltersArray of objects(PublicReportFieldCriteria)

An optional list of field-level filter conditions that apply to the report. Each condition specifies a field, comparison operator, and one or more values.

curl -i -X POST \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports/execute/csv \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "filter": {
      "dateFilter": {
        "type": "RELATIVE",
        "relativeRange": "LAST_7_DAYS"
      },
      "fieldFilters": [
        {
          "name": "sys_Provider_s",
          "operator": "STARTS_WITH",
          "values": [
            "H"
          ]
        }
      ]
    },
    "columns": [
      {
        "fieldName": "sys_Provider_s"
      },
      {
        "fieldName": "sys_MeterName_s"
      },
      {
        "fieldName": "sys_Cost_f",
        "aggFunction": "SUM"
      }
    ]
  }'

Responses

The report as a CSV file

Headers
Content-Dispositionany

Indicates that the response is a downloadable file

Example: "attachment; filename=\"report_2025-01-31T16:16:20.031975.csv\""
Bodytext/csv
string(binary)

The CSV file content

Response
No content

List usage fields

Request

Returns the list of usage fields available for use as report columns, including their value types and valid aggregation functions.

Security
glcUserBearerAuth
curl -i -X GET \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports/usage-fields \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Success

Bodyapplication/jsonArray [
defaultFunctionstring

The default function for this field; it will be used if nothing is provided.

Enum"NONE""SUM""COUNT"
displayNamestring

The human-readable display name of the field.

Example: "Cost"
fieldNamestring

The internal reference name of the field, used when specifying report columns.

Example: "sys_Cost_f"
validFunctionsArray of strings

The list of aggregation functions that are valid for this field. Use these values when specifying the aggFunction on a report column.

Items Enum"NONE""SUM""COUNT"
valueTypestring

The value type of the field, which determines what kinds of data it stores and which aggregation functions are applicable.

Enum"STRING""INT""FLOAT"
]
Response
application/json
[ { "defaultFunction": "NONE", "displayName": "Cost", "fieldName": "sys_Cost_f", "validFunctions": [], "valueType": "STRING" } ]

Retrieve a report definition

Request

Fetches the details of a specific report definition by its ID. Use the id returned by List report definitions as the path parameter.

Security
glcUserBearerAuth
Path
idstring(uuid)[ 32 .. 36 ] characters^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{...required

The ID of the report definition.

Example: 7021d69d-de13-44bd-97e1-dbb05eef0759
curl -i -X GET \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports/7021d69d-de13-44bd-97e1-dbb05eef0759 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Success

Bodyapplication/json
chartsArray of objects(ReportChart)

A list of charts defined within the report, each describing a specific data visualization.

columnsArray of objects(ReportColumn)

The list of fields (columns) included in the report table.

Example: [{"aggFunction":"SUM","fieldName":"cost_f","formatting":{"placesAfterDecimal":2},"group":false,"sort":"DESC"}]
createdobject(UserEvent)
descriptionstring

A short summary of the report’s purpose or contents.

Example: "Tracks monthly consumption grouped by service and region."
filterobject(ReportFilter)
forecastCfgobject(ForecastConfig)
idstring

The unique identifier of the report.

Example: "7021d69d-de13-44bd-97e1-dbb05eef0759"
lastUpdatedobject(UserEvent)
namestring

The name of the report as shown in the UI.

Example: "Monthly Usage Breakdown"
ownerboolean

Indicates whether the currently authenticated user is the report’s owner.

pivotboolean

Indicates whether the report output is pivoted by a time-based dimension (for example, by month).

sharedboolean
sharingobject(ReportSharing)
Response
application/json
{ "charts": [ {} ], "columns": [ {} ], "created": { "email": "string", "id": "string", "name": "string", "time": "2019-08-24T14:15:22Z" }, "description": "Tracks monthly consumption grouped by service and region.", "filter": { "dateFilter": {}, "fieldFilters": [] }, "forecastCfg": { "enableForecast": true, "forecastPeriod": 0, "interval": "DAY" }, "id": "7021d69d-de13-44bd-97e1-dbb05eef0759", "lastUpdated": { "email": "string", "id": "string", "name": "string", "time": "2019-08-24T14:15:22Z" }, "name": "Monthly Usage Breakdown", "owner": true, "pivot": true, "shared": true, "sharing": { "type": "PUBLIC" } }

Generate report for saved definition

Request

Executes a report for a saved definition; specify the date range in the request body.

Security
glcUserBearerAuth
Path
idstring(uuid)[ 32 .. 36 ] characters^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{...required

The ID of the report to export.

Example: 7021d69d-de13-44bd-97e1-dbb05eef0759
Bodyapplication/jsonrequired
endDatestring(date)

The inclusive end date of the absolute date range (YYYY-MM-DD). Required when relativeDate is not provided.

Example: "2026-03-31"
relativeDatestring

A predefined time period relative to today. Takes precedence over startDate and endDate when both are provided.

Enum"YESTERDAY""LAST_7_DAYS""LAST_14_DAYS"
startDatestring(date)

The inclusive start date of the absolute date range (YYYY-MM-DD). Required when relativeDate is not provided.

Example: "2026-01-01"
curl -i -X POST \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports/7021d69d-de13-44bd-97e1-dbb05eef0759/execute \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "startDate": "2026-01-01",
    "endDate": "2026-03-31"
  }'

Responses

The exported report as a JSON file

Bodyapplication/json
itemsArray of objects
totalCountinteger(int32)
Response
application/json

success

{ "totalCount": 2, "items": [ {}, {} ] }

Generate saved report as CSV

Request

Executes a saved report definition and returns the result as a downloadable CSV file. Specify the date range in the request body.

Security
glcUserBearerAuth
Path
idstring(uuid)[ 32 .. 36 ] characters^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{...required

The ID of the saved report to export.

Example: 7021d69d-de13-44bd-97e1-dbb05eef0759
Bodyapplication/jsonrequired
endDatestring(date)

The inclusive end date of the absolute date range (YYYY-MM-DD). Required when relativeDate is not provided.

Example: "2026-03-31"
relativeDatestring

A predefined time period relative to today. Takes precedence over startDate and endDate when both are provided.

Enum"YESTERDAY""LAST_7_DAYS""LAST_14_DAYS"
startDatestring(date)

The inclusive start date of the absolute date range (YYYY-MM-DD). Required when relativeDate is not provided.

Example: "2026-01-01"
curl -i -X POST \
  https://us-west.api.greenlake.hpe.com/consumption-analytics/v2/reports/7021d69d-de13-44bd-97e1-dbb05eef0759/execute/csv \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "startDate": "2026-01-01",
    "endDate": "2026-03-31"
  }'

Responses

The report as a CSV file

Headers
Content-Dispositionany

Indicates that the response is a downloadable file

Example: "attachment; filename=\"report_2025-01-31T16:16:20.031975.csv\""
Bodytext/csv
string(binary)

The CSV file content

Response
No content