openapi: 3.1.0
info:
  description: >-
    API reference documentation for the HPE GreenLake Consumption Analytics
    Reports v2 API
  license:
    name: HPE
    url: https://www.hpe.com/us/en/software/licensing.html
  termsOfService: https://www.hpe.com/us/en/about/legal/terms-of-use.html
  title: HPE GreenLake Consumption Analytics Reports v2 API
  version: 1.0.0
servers:
  - description: Production - US West
    url: https://us-west.api.greenlake.hpe.com
security:
  - glcUserBearerAuth: []
tags:
  - description: Reference documentation for reporting operations.
    name: Reports
paths:
  /consumption-analytics/v2/reports:
    get:
      description: List the report definitions that are available to the caller.
      operationId: public-reports-list-v2
      parameters:
        - description: The maximum number of items to return.
          in: query
          name: limit
          schema:
            type: integer
            format: int64
            default: 10
            maximum: 100
            minimum: 0
        - description: >-
            The number of items to skip before starting to collect the result
            set.
          in: query
          name: offset
          schema:
            type: integer
            format: int64
            default: 0
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  description: success
                  value:
                    count: 2
                    total: 2
                    offset: 0
                    items:
                      - id: 00000000-0000-0000-0000-000000000001
                        name: Cost (Previous 30 days)
                        shared: true
                        owner: false
                        createdAt: '2022-05-04T22:27:12.071872'
                        updatedAt: '2023-02-15T18:41:24.531274'
                        type: report-definition
                        generation: '1'
                      - id: 00000000-0000-0000-0000-000000000002
                        name: Cost by Service
                        description: breakdown cost by service and day
                        shared: true
                        owner: false
                        createdAt: '2026-02-23T20:10:07.810399'
                        updatedAt: '2026-02-23T20:10:07.810399'
                        type: report-definition
                        generation: '1'
              schema:
                $ref: '#/components/schemas/PublicDefinitionIdentifierV2'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Bad Request
        '401':
          content:
            application/json:
              examples:
                unauthorized:
                  description: unauthorized
                  value:
                    debugId: 00000000-0000-4000-8000-000000000020
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40100
                    httpStatusCode: 401
                    message: Unauthorized. Bearer token missing or invalid.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Unauthorized
        '403':
          content:
            application/json:
              examples:
                forbidden:
                  description: forbidden
                  value:
                    debugId: 00000000-0000-4000-8000-000000000021
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40300
                    httpStatusCode: 403
                    message: >-
                      Forbidden. You do not have the required permissions to
                      access this resource.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              examples:
                notFound:
                  description: notFound
                  value:
                    debugId: 00000000-0000-4000-8000-000000000022
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40401
                    httpStatusCode: 404
                    message: Not Found.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Not Found
        '500':
          content:
            application/json:
              examples:
                unexpectedError:
                  description: unexpectedError
                  value:
                    debugId: 00000000-0000-4000-8000-000000000023
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-50000
                    httpStatusCode: 500
                    message: An unexpected error occurred.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Unexpected Error
      summary: List report definitions
      tags:
        - Reports
  /consumption-analytics/v2/reports/execute:
    post:
      description: >-
        Generates the report based on report definition provided in the request
        body.
      operationId: public-reports-post-v2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteReportRequest'
        description: The request body containing the details for executing the report.
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  description: success
                  value:
                    totalCount: 2
                    items:
                      - sys_Provider_s: HPE
                        sys_Cost_f: 1232.45
                      - sys_Provider_s: AWS
                        sys_Cost_f: 1232.45
              schema:
                $ref: '#/components/schemas/PublicReportV2ExecuteResponse'
          description: Report generated successfully
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Bad Request
        '401':
          content:
            application/json:
              examples:
                unauthorized:
                  description: unauthorized
                  value:
                    debugId: 00000000-0000-4000-8000-000000000020
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40100
                    httpStatusCode: 401
                    message: Unauthorized. Bearer token missing or invalid.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Unauthorized
        '403':
          content:
            application/json:
              examples:
                forbidden:
                  description: forbidden
                  value:
                    debugId: 00000000-0000-4000-8000-000000000021
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40300
                    httpStatusCode: 403
                    message: >-
                      Forbidden. You do not have the required permissions to
                      access this resource.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              examples:
                notFound:
                  description: notFound
                  value:
                    debugId: 00000000-0000-4000-8000-000000000022
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40401
                    httpStatusCode: 404
                    message: Not Found.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Not Found
        '500':
          content:
            application/json:
              examples:
                unexpectedError:
                  description: unexpectedError
                  value:
                    debugId: 00000000-0000-4000-8000-000000000023
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-50000
                    httpStatusCode: 500
                    message: An unexpected error occurred.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Unexpected Error
      summary: Generate Report
      tags:
        - Reports
  /consumption-analytics/v2/reports/{id}/execute:
    post:
      description: >-
        Executes a report for a saved definition; specify the date range in the
        request body.
      operationId: public-reports-execute-v2
      parameters:
        - description: The ID of the report to export.
          example: 7021d69d-de13-44bd-97e1-dbb05eef0759
          in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
            maxLength: 36
            minLength: 32
            pattern: >-
              ^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicReportRequestV2'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  description: success
                  value:
                    totalCount: 2
                    items:
                      - sys_Provider_s: HPE
                        sys_Cost_f: 1232.45
                      - sys_Provider_s: AWS
                        sys_Cost_f: 1232.45
              schema:
                $ref: '#/components/schemas/PublicReportV2ExecuteResponse'
          description: The exported report as a JSON file
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Bad Request
        '401':
          content:
            application/json:
              examples:
                unauthorized:
                  description: unauthorized
                  value:
                    debugId: 00000000-0000-4000-8000-000000000020
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40100
                    httpStatusCode: 401
                    message: Unauthorized. Bearer token missing or invalid.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Unauthorized
        '403':
          content:
            application/json:
              examples:
                forbidden:
                  description: forbidden
                  value:
                    debugId: 00000000-0000-4000-8000-000000000021
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40300
                    httpStatusCode: 403
                    message: >-
                      Forbidden. You do not have the required permissions to
                      access this resource.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              examples:
                notFound:
                  description: notFound
                  value:
                    debugId: 00000000-0000-4000-8000-000000000022
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-40401
                    httpStatusCode: 404
                    message: Not Found.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Not Found
        '500':
          content:
            application/json:
              examples:
                unexpectedError:
                  description: unexpectedError
                  value:
                    debugId: 00000000-0000-4000-8000-000000000023
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-50000
                    httpStatusCode: 500
                    message: An unexpected error occurred.
                    errorDetails: []
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Unexpected Error
      summary: Generate Report for saved definition
      tags:
        - Reports
components:
  schemas:
    ErrorDetail:
      type: object
      properties:
        issues:
          type: array
          description: Array of bad request issues.
          items:
            $ref: '#/components/schemas/ErrorIssue'
        type:
          type: string
          description: The part of the request with an issue.
          example: hpe.greenlake.bad_request
      required:
        - issues
        - type
    ErrorIssue:
      type: object
      properties:
        description:
          type: string
          description: >-
            An elaborate description of issue. This can be used by developers to
            understand how the failure can be addressed.
          example: Must be a numeric value which is 0 or greater.
        source:
          type: string
          description: 'The part of the request with an issue. '
          example: query.parameter
        subject:
          type: string
          description: The specific issue key.
          example: limit
      required:
        - source
        - subject
    ErrorMessage:
      type: object
      properties:
        debugId:
          type: string
          description: >-
            A unique identifier for the instance of this error. This can be used
            to help with troubleshooting.
          example: 860a9caa39ffa07effc84d6da9173236
        errorCode:
          type: string
          description: >-
            A unique machine-friendly, but human-readable identifier for the
            error
          example: HPE_GL_CA_NAME_TOO_LONG
        errorDetails:
          type: array
          description: Additional detailed information about the error
          items:
            $ref: '#/components/schemas/ErrorDetail'
        flowContextId:
          type: string
        httpStatusCode:
          type: integer
          format: int32
          description: The HTTP equivalent status code.
          example: 400
        message:
          type: string
          description: A user-friendly error message
          example: Invalid yearMonth format, should be yyyyMM.
        status:
          type: integer
          format: int32
      required:
        - debugId
        - errorCode
        - httpStatusCode
        - message
    ExecuteReportRequest:
      type: object
      properties:
        filter:
          $ref: '#/components/schemas/ReportFilter'
      required:
        - filter
    PublicDefinitionIdentifierV2:
      type: object
      properties:
        count:
          type: integer
          format: int32
        items:
          type: array
          items:
            $ref: '#/components/schemas/ReportIdentifierV2'
        offset:
          type: integer
          format: int32
        total:
          type: integer
          format: int32
    PublicReportRequestV2:
      type: object
      properties:
        endDate:
          type: string
        relativeDate:
          type: string
        startDate:
          type: string
    PublicReportV2ExecuteResponse:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
        totalCount:
          type: integer
          format: int32
    ReportDateFilter:
      type: object
      description: >-
        Specifies the date range used for filtering report data.     A report
        can use either a relative range (like "last 30 days") or an absolute
        range (between two calendar dates).
      properties:
        endDate:
          type: string
          format: date
          description: The end date of the filter range. Used when the type is `ABSOLUTE`.
        relativeRange:
          type: string
          description: >-
            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
            - LAST_30_DAYS
            - LAST_60_DAYS
            - LAST_90_DAYS
            - LAST_120_DAYS
            - LAST_QUARTER
            - LAST_YEAR
            - LAST_6_MONTHS
            - LAST_13_MONTHS
            - CURRENT_MONTH
            - PREVIOUS_MONTH
            - CURRENT_QUARTER
            - PREVIOUS_QUARTER
            - CURRENT_YEAR
            - PREVIOUS_YEAR
        startDate:
          type: string
          format: date
          description: >-
            The start date of the filter range. Used when the type is
            `ABSOLUTE`.
        type:
          type: string
          description: >-
            Defines whether the filter uses a relative date range or an absolute
            date range.
          enum:
            - ABSOLUTE
            - RELATIVE
      required:
        - type
    ReportFieldCriteria:
      type: object
      description: >-
        Defines a filter condition for a specific field within a report.    
        Each filter uses a comparison operator and one or more values to
        evaluate against a field.
      properties:
        name:
          type: string
          description: The name of the field to filter on.
        operator:
          type: string
          description: The comparison operator used to evaluate the field's value.
          enum:
            - EQ
            - NOT_EQ
            - IN
            - NOT_IN
            - TOP
            - BOTTOM
            - GT
            - GTE
            - LT
            - LTE
            - BETWEEN
            - NOT_BETWEEN
            - STARTS_WITH
            - CONTAINS
            - DOES_NOT_CONTAIN
            - EMPTY
            - IS_EMPTY
            - NOT_EMPTY
            - DOES_NOT_START_WITH
        values:
          type: array
          description: >-
            One or more values to be used for filtering.         Can be strings,
            numbers, or dates, depending on the field type and operator.
      required:
        - name
        - operator
        - values
    ReportFilter:
      type: object
      description: >-
        Defines the filters applied to a report. Combines a date filter and a
        list of field-level filter conditions.    Unlike `AnalyticsFilter`, this
        structure is flat and directly maps to the UI form elements.
      properties:
        dateFilter:
          $ref: '#/components/schemas/ReportDateFilter'
          description: The reporting date range, either relative or absolute.
        fieldFilters:
          type: array
          description: >-
            A list of field-level filter conditions that apply to the
            report.        Each condition specifies a field, comparison
            operator, and one or more values.
          items:
            $ref: '#/components/schemas/ReportFieldCriteria'
      required:
        - dateFilter
        - fieldFilters
    ReportIdentifierV2:
      type: object
      properties:
        createdAt:
          type: string
        description:
          type: string
        generation:
          type: string
        id:
          type: string
        name:
          type: string
        owner:
          type: boolean
        shared:
          type: boolean
        type:
          type: string
        updatedAt:
          type: string
    UserEvent:
      type: object
      description: >-
        Captures metadata about a user action, such as report creation or last
        update.    Used to display audit information including who made the
        change and when it occurred.
      properties:
        email:
          type: string
          description: The email address of the user who performed the action.
        id:
          type: string
          description: The unique identifier of the user who performed the action.
        name:
          type: string
          description: The display name of the user who performed the action.
        time:
          type: string
          format: date-time
          description: The date and time when the action occurred.
  securitySchemes:
    glcUserBearerAuth:
      bearerFormat: JWT
      description: JWT token used for authentication and authorization.
      scheme: bearer
      type: http
