SAP HANA Metering API

Operations for accessing consumption metering data used for billing and capacity planning for SAP HANA Cloud instances.

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-database-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-service-instance-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-service-instance-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-instance-parameters-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-last-operation-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-create-service-instance-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-update-service-instance-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-inventory-instance-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-inventory-instance-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-alert-event-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-alert-event-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-alert-rule-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-alert-rule-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-update-alert-rules-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-metric-value-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-metric-series-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-metric-data-point-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-metering-value-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-metering-value-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-instance-mapping-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-instance-mapping-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-create-instance-mapping-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-schema/sap-hana-cloud-rest-error-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-service-instance-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-service-instance-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-instance-parameters-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-last-operation-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-create-service-instance-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-update-service-instance-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-inventory-instance-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-inventory-instance-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-alert-event-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-alert-event-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-alert-rule-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-alert-rule-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-update-alert-rules-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-metric-value-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-metric-series-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-metric-data-point-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-metering-value-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-metering-value-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-instance-mapping-list-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-instance-mapping-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-create-instance-mapping-request-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-structure/sap-hana-cloud-rest-error-structure.json

Other Resources

🔗
Tutorials
https://developers.sap.com/tutorials/hana-cloud-automation-rest..html
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-service-instance-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-service-instance-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-instance-parameters-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-last-operation-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-create-service-instance-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-update-service-instance-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-inventory-instance-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-inventory-instance-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-alert-event-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-alert-event-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-alert-rule-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-alert-rule-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-update-alert-rules-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-metric-value-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-metric-series-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-metric-data-point-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-metering-value-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-metering-value-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-instance-mapping-list-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-instance-mapping-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-create-instance-mapping-request-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/examples/sap-hana-cloud-rest-error-example.json
🔗
JSONLD
https://raw.githubusercontent.com/api-evangelist/sap-hana/refs/heads/main/json-ld/sap-hana-cloud-rest-context.jsonld

OpenAPI Specification

sap-hana-metering-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: SAP HANA Cloud REST Alerts Metering API
  description: REST API for managing SAP HANA Cloud instances, monitoring alerts, accessing metrics, and retrieving metering data. The API uses the SAP Service Manager framework to provision, configure, start, stop, and delete SAP HANA Cloud database instances within SAP Business Technology Platform subaccounts. Additionally, the alerts and metrics endpoints provide access to triggered alerts, database performance metrics, and consumption metering data for SAP HANA Cloud, SAP HANA database and SAP HANA Cloud, data lake instances.
  version: 1.0.0
  contact:
    name: SAP SE
    url: https://www.sap.com
    email: help@sap.com
  license:
    name: SAP Developer License
    url: https://www.sap.com/about/trust-center/agreements.html
  termsOfService: https://www.sap.com/about/trust-center/agreements.html
  x-logo:
    url: https://www.sap.com/content/dam/application/shared/logos/sap-logo-svg.svg
servers:
- url: https://api.cf.{region}.hana.ondemand.com
  description: SAP HANA Cloud API (Cloud Foundry environment)
  variables:
    region:
      default: eu10
      description: SAP BTP region identifier. Common values include eu10 (Europe - Frankfurt), us10 (US East - VA), ap10 (Australia - Sydney), jp10 (Japan - Tokyo), and others based on your SAP BTP subaccount provisioning.
      enum:
      - eu10
      - eu11
      - eu20
      - eu30
      - us10
      - us20
      - us21
      - us30
      - ap10
      - ap11
      - ap12
      - ap20
      - ap21
      - jp10
      - jp20
      - br10
      - ca10
      - in30
security:
- oauth2: []
tags:
- name: Metering
  description: Operations for accessing consumption metering data used for billing and capacity planning for SAP HANA Cloud instances.
paths:
  /metering/v1/serviceInstances/{serviceInstanceId}/values:
    get:
      operationId: getMeteringValues
      summary: Retrieve Metering Data for a Service Instance
      description: Retrieves consumption metering data for a specific SAP HANA Cloud service instance. Metering data includes compute unit hours, storage consumption, data lake capacity utilization, and other billable metrics used for cost tracking and capacity planning.
      tags:
      - Metering
      parameters:
      - $ref: '#/components/parameters/ServiceInstanceId'
      - name: fromTimestamp
        in: query
        description: Start timestamp for the metering data query window in ISO 8601 format.
        schema:
          type: string
          format: date-time
        example: '2026-01-15T10:30:00Z'
      - name: toTimestamp
        in: query
        description: End timestamp for the metering data query window in ISO 8601 format.
        schema:
          type: string
          format: date-time
        example: '2026-01-15T10:30:00Z'
      responses:
        '200':
          description: Successfully retrieved metering data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeteringValueList'
              examples:
                Getmeteringvalues200Example:
                  summary: Default getMeteringValues 200 response
                  x-microcks-default: true
                  value:
                    values:
                    - timestamp: '2026-01-15T10:30:00Z'
                      computeUnitHours: 42.5
                      storageGB: 42.5
                      dataLakeCapacityGB: 42.5
                      backupStorageGB: 42.5
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    MeteringValueList:
      type: object
      description: A collection of metering data points for billing and capacity tracking.
      properties:
        values:
          type: array
          description: The list of metering records.
          items:
            $ref: '#/components/schemas/MeteringValue'
          example: []
    Error:
      type: object
      description: Standard error response returned by the SAP HANA Cloud REST API when a request fails.
      properties:
        error:
          type: string
          description: The error code identifying the type of error.
          example: example_value
        description:
          type: string
          description: A human-readable description of the error.
          example: A sample description.
        statusCode:
          type: integer
          description: The HTTP status code associated with the error.
          example: 10
    MeteringValue:
      type: object
      description: A metering data record representing resource consumption for billing purposes.
      properties:
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp for the metering period.
          example: '2026-01-15T10:30:00Z'
        computeUnitHours:
          type: number
          format: double
          description: The number of compute unit hours consumed during the metering period. Compute units are based on memory and vCPU allocation.
          example: 42.5
        storageGB:
          type: number
          format: double
          description: The storage consumption in gigabytes during the metering period.
          example: 42.5
        dataLakeCapacityGB:
          type: number
          format: double
          description: The data lake storage consumption in gigabytes during the metering period, if a data lake instance is attached.
          example: 42.5
        backupStorageGB:
          type: number
          format: double
          description: The backup storage consumption in gigabytes during the metering period.
          example: 42.5
  responses:
    Forbidden:
      description: The authenticated user does not have sufficient permissions to perform this operation on the requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found. Verify the instance identifier and ensure it exists in the current subaccount.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication failed. The OAuth 2.0 access token is missing, expired, or invalid. Obtain a new token using the client credentials flow.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: The API rate limit has been exceeded. Retry the request after the duration indicated in the Retry-After response header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: An unexpected error occurred on the server. If the issue persists, contact SAP support with the request correlation ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    ServiceInstanceId:
      name: serviceInstanceId
      in: path
      required: true
      description: The unique identifier of the SAP HANA Cloud service instance for which to retrieve alerts, metrics, or metering data.
      schema:
        type: string
        format: uuid
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 authentication using SAP Business Technology Platform credentials. Obtain an access token using client credentials flow with the UAA service URL, client ID, and client secret from your SAP HANA Cloud service key. Access tokens expire after approximately 1799 seconds (30 minutes) and must be refreshed.
      flows:
        clientCredentials:
          tokenUrl: https://{subdomain}.authentication.{region}.hana.ondemand.com/oauth/token
          scopes: {}