openapi: 3.1.0
info:
  description: >-
    API reference documentation for the HPE GreenLake Consumption Analytics
    FOCUS Exports v1beta1 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 FOCUS Exports v1beta1 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 FOCUS export configuration operations.
    name: FOCUS Exports
paths:
  /consumption-analytics/v1beta1/focus-exports:
    get:
      description: List the FOCUS export configurations that are available to the caller.
      operationId: public-focus-exports-list
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  description: success
                  value:
                    offset: 0
                    count: 2
                    total: 2
                    items:
                      - id: 0050d76f-1c6e-4c26-80f5-35120c886a12
                        name: Export all AWS Data
                        filter:
                          - name: sys_Provider_s
                            operator: IN
                            values:
                              - Amazon
                        created:
                          id: 01972d202d3d9e74ba89cec4a36b7dfe
                          name: Test User
                          time: '2025-09-11T17:59:16.945'
                        lastUpdated:
                          id: 01972d202d3d9e74ba89cec4a36b7dfe
                          name: Test User
                          time: '2025-09-11T17:59:16.945'
                        lastRun:
                          id: e1b1a9bc60ca05dd6f0918397c50858b
                          name: Test User
                          time: '2026-04-21T21:49:56.974618'
                      - id: 02b98f0e-2af7-42b6-8ea0-1ad9f8321311
                        name: Export All Data
                        filter: []
                        created:
                          id: 01972d202d3d9e74ba89cec4a36b7dfe
                          name: Test User
                          time: '2025-09-11T18:10:39.861'
                        lastUpdated:
                          id: 01972d202d3d9e74ba89cec4a36b7dfe
                          name: Test User
                          time: '2025-09-11T18:10:40.083'
                        lastRun: {}
              schema:
                $ref: '#/components/schemas/FocusExportListResponse'
          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 available FOCUS export configurations
      tags:
        - FOCUS Exports
  /consumption-analytics/v1beta1/focus-exports/{id}:
    get:
      description: >-
        Fetches the details of a specific FOCUS export configuration by its ID.
        Use the `id` returned by **List available FOCUS export configurations**
        as the path parameter.
      operationId: public-focus-exports-get
      parameters:
        - description: The ID of the FOCUS export configuration.
          example: 7021d69d-de13-44bd-97e1-dbb05eef0759
          in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  description: success
                  summary: Sample FOCUS export configuration
                  value:
                    id: 83bcaf12-de13-44bd-97e1-dbb05eef0759
                    name: Export all AWS Data
                    filter:
                      - name: sys_Provider_s
                        operator: IN
                        values:
                          - Amazon
                    created:
                      id: 01972d202d3d9e74ba89cec4a36b7dfe
                      name: Test User
                      time: '2025-09-11T17:59:16.945'
                    lastUpdated:
                      id: 01972d202d3d9e74ba89cec4a36b7dfe
                      name: Test User
                      time: '2025-09-11T17:59:16.945'
                    lastRun:
                      id: e1b1a9bc60ca05dd6f0918397c50858b
                      name: Test User
                      time: '2026-04-21T21:49:56.974618'
              schema:
                $ref: '#/components/schemas/ExportConfig'
          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: FOCUS export configuration 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: Retrieve a FOCUS export configuration
      tags:
        - FOCUS Exports
  /consumption-analytics/v1beta1/focus-exports/{id}/contents:
    get:
      description: >-
        Executes the given FOCUS export configuration and retrieves it as a CSV
        file. Use the `id` returned by **List available FOCUS export
        configurations** as the path parameter.
      operationId: public-focus-exports-download-get
      parameters:
        - description: The ID of the FOCUS export configuration to execute.
          example: 7021d69d-de13-44bd-97e1-dbb05eef0759
          in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
        - description: >-
            Relative date range for the export. If specified, this parameter
            takes precedence over startDate and endDate. Dates are mandatory:
            you must provide either relativeDate or the startDate/endDate pair.
          in: query
          name: relativeDate
          schema:
            type: string
            default: ''
        - description: >-
            Start date for an absolute export range (YYYY-MM-DD). Must be used
            together with endDate; otherwise a 400 Bad Request is returned.
          in: query
          name: startDate
          schema:
            type: string
            format: date
            default: ''
        - description: >-
            End date for an absolute export range (YYYY-MM-DD). Must be used
            together with startDate; otherwise a 400 Bad Request is returned.
          in: query
          name: endDate
          schema:
            type: string
            format: date
            default: ''
      responses:
        '200':
          content:
            text/csv:
              examples:
                success:
                  description: success
                  value: >-
                    BillingAccountId,BillingAccountName,BillingCurrency,BilledCost,BillingPeriodStart,BillingPeriodEnd,ChargeCategory,ChargeClass,ChargeDescription,ChargePeriodStart,ChargePeriodEnd,ContractedCost,ContractedUnitPrice,EffectiveCost,InvoiceIssuerName,ProviderName,PublisherName,PricingQuantity,PricingUnit,ListCost,ListUnitPrice,ResourceId,ResourceName,ResourceType,ServiceCategory,ServiceName,SkuId,ConsumedQuantity,ConsumedUnit,AvailabilityZone,CommitmentDiscountType,ChargeFrequency,CommitmentDiscountCategory,CommitmentDiscountId,CommitmentDiscountName,CommitmentDiscountStatus,PricingCategory,RegionId,RegionName,SkuPriceId,SubAccountId,SubAccountName,Tags

                    HP-AMS-999-USA-99999,Test
                    Company,USD,0.35312696,2026-04-01T00:00:00Z,2026-05-01T00:00:00Z,Usage,,0.9
                    CUs Synergy 480 Gen10 #1 (ESXI
                    Hosts),2026-04-15T00:00:00Z,2026-04-16T00:00:00Z,0.35312696,,0.35312696,HPE
                    GreenLake,HPE GreenLake,HPE
                    GreenLake,0.39236328125,CUs,0.35312696,0.9,foo.org-vm-00001,foo.org-vm-00001,VM,Compute,VM,VM20_000000-0000-0000-0000-000000000012,11.7708984375,CUs,,,Estimated,,,,,,AMS,AMS,,,,{}

                    HP-AMS-999-USA-99999,Test
                    Company,USD,5.93066666,2026-04-01T00:00:00Z,2026-05-01T00:00:00Z,Usage,,1.39
                    CUs SQL special
                    configuration,2026-04-17T00:00:00Z,2026-04-18T00:00:00Z,5.93066666,,5.93066666,HPE
                    GreenLake,HPE GreenLake,HPE
                    GreenLake,4.266666666666670,CUs,5.93066666,1.39,foo.org-vm-00002,foo.org-vm-00002,VM,Compute,VM,VM20_000000-0000-0000-0000-000000000012,128.0,CUs,,,Estimated,,,,,,AMS,AMS,,,,{}

                    HP-AMS-999-USA-99999,Test
                    Company,USD,0.82489054,2026-04-01T00:00:00Z,2026-05-01T00:00:00Z,Usage,,0.9
                    CUs Synergy 480 Gen10 #1 (ESXI
                    Hosts),2026-04-18T00:00:00Z,2026-04-19T00:00:00Z,0.82489054,,0.82489054,HPE
                    GreenLake,HPE GreenLake,HPE
                    GreenLake,0.9165450434966670,CUs,0.82489054,0.9,foo.org-vm-00003,foo.org-vm-00003,VM,Compute,VM,VM20_000000-0000-0000-0000-000000000012,27.4963513049,CUs,,,Usage,,,,,,AMS,AMS,,,,{}
              schema:
                type: string
                format: binary
                description: The FOCUS-compliant CSV file content
          description: The exported FOCUS data as a CSV file
          headers:
            Content-Disposition:
              description: Indicates that the response is a downloadable file
              schema:
                example: attachment; filename="Export_2025-01-31T16:16:20.031975.csv"
              style: simple
        '400':
          content:
            application/json:
              examples:
                invalidOrImpossibleDate:
                  description: invalidOrImpossibleDate
                  summary: Date in wrong format or is impossible (e.g., 2025-02-30)
                  value:
                    status: 400
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-60305
                    message: >-
                      Invalid date value provided. Please use a valid date in
                      YYYY-MM-DD format.
                    debugId: 00000000-0000-4000-8000-000000000006
                    flowContextId: 00000000-0000-4000-8000-000000000007
                    httpStatusCode: 400
                    validationErrors:
                      - propertyName: endDate
                        propertyValue: '2025-02-30'
                        message: >-
                          Date is either not in YYYY-MM-DD format or is an
                          impossible date (e.g., Feb 30).
                invalidRange:
                  description: invalidRange
                  summary: startDate is after endDate
                  value:
                    status: 400
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-60304
                    message: startDate must be on or before endDate.
                    debugId: 00000000-0000-4000-8000-000000000004
                    flowContextId: 00000000-0000-4000-8000-000000000005
                    httpStatusCode: 400
                    validationErrors:
                      - propertyName: startDate,endDate
                        propertyValue: 2025-02-01,2025-01-31
                        message: The start date cannot be after the end date.
                invalidRelativeDate:
                  description: invalidRelativeDate
                  summary: Invalid value for relativeDate parameter
                  value:
                    status: 400
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-60303
                    message: >-
                      Invalid relativeDate value 'LAST_WEEKEND'. Valid options
                      are: 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
                    debugId: 00000000-0000-4000-8000-000000000008
                    flowContextId: 00000000-0000-4000-8000-000000000009
                    httpStatusCode: 400
                    validationErrors:
                      - propertyName: relativeDate
                        propertyValue: LAST_WEEKEND
                        message: Invalid enum value provided.
                missingAllDates:
                  description: missingAllDates
                  summary: No date parameters provided
                  value:
                    status: 400
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-60302
                    message: >-
                      A date range must be specified using either the
                      'relativeDate' parameter or both 'startDate' and 'endDate'
                      parameters.
                    debugId: 00000000-0000-4000-8000-000000000000
                    flowContextId: 00000000-0000-4000-8000-000000000001
                    httpStatusCode: 400
                    validationErrors:
                      - propertyName: relativeDate,startDate,endDate
                        propertyValue: null
                        message: >-
                          At least one date parameter (relativeDate or a
                          startDate/endDate pair) is required.
                missingPair:
                  description: missingPair
                  summary: Provided only startDate or only endDate
                  value:
                    status: 400
                    errorCode: HPE-GL-CONSUMPTION_ANALYTICS-60302
                    message: >-
                      A date range must be specified using either the
                      'relativeDate' parameter or both 'startDate' and 'endDate'
                      parameters.
                    debugId: 00000000-0000-4000-8000-000000000002
                    flowContextId: 00000000-0000-4000-8000-000000000003
                    httpStatusCode: 400
                    validationErrors:
                      - propertyName: endDate
                        propertyValue: null
                        message: This field is required when 'startDate' is provided.
              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: >-
                      FOCUS export configuration not found:
                      11111111-1111-4111-8111-111111111111
                    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: Download FOCUS export data
      tags:
        - FOCUS Exports
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
    ExportConfig:
      type: object
      properties:
        created:
          $ref: '#/components/schemas/UserEvent'
        filter:
          type: array
          items:
            $ref: '#/components/schemas/ReportFieldCriteria'
        id:
          type: string
        lastRun:
          $ref: '#/components/schemas/UserEvent'
        lastUpdated:
          $ref: '#/components/schemas/UserEvent'
        name:
          type: string
    FocusExportListResponse:
      type: object
      properties:
        count:
          type: integer
          format: int32
          description: Number of items returned
        items:
          type: array
          description: List of FOCUS export configurations
          items:
            $ref: '#/components/schemas/ExportConfig'
        offset:
          type: integer
          format: int32
          description: Offset of the first item returned
        total:
          type: integer
          format: int32
          description: Total number of items available
    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
    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
