For the complete documentation index, see llms.txt. This page is also available as Markdown.

Unit Metric

Unit Metric resource.

Get Unit Metric

get

Get a Unit Metric by identifier with records for the specified time range.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

metricIdentifierstringRequired

Unit Metric identifier

startTimestringRequired

Start time in ISO 8601 format (e.g., 2020-03-03T15:32:44Z or 2020-03-03T15:32:44%2B00:00)

endTimestringRequired

End time in ISO 8601 format (e.g., 2020-03-03T15:32:44Z or 2020-03-03T15:32:44%2B00:00)

timeTruncGroupBystring · enumOptional

Groups unit metric samples into calendar buckets (DAY, WEEK, or MONTH) before applying the metric's default aggregation in BigQuery.

Default: DAYPossible values:
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/unit-metric
GET /gateway/ccm/api/unit-metric?accountIdentifier=text&metricIdentifier=text&startTime=text&endTime=text HTTP/1.1
Host: nextgen-ce-d788d786-ssnpc
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Create Unit Metric

post

Create a Unit Metric.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

The request object for Unit Metric

metricIdentifierstringRequired

Unique metric identifier for the unit metric

metricNamestringRequired

Display name of the unit metric

descriptionstringOptional

Unit Metric Description

defaultAggregationstring · enumOptional

Aggregation applied to unit cost metric values per time bucket in BigQuery. Supported: AVG (default when omitted or null), MIN, MAX, SUM.

Possible values:
handleEmptyValuestring · enumOptional

Strategy for handling missing/empty data points in unit cost metrics. LEAVE_BLANK: leave missing points empty (default). PREVIOUS_VALUE: carry forward the last known value. ZERO: fill gaps with 0.

Possible values:
typestring · enumOptional

Discriminator for unit metric data source: manually uploaded time-series or derived dynamically from a BigQuery column.

Possible values:
dataSourcestring · enumOptional

Data source to query for COLUMN-type unit metrics. Each source declares its query backend (BigQuery or UDP), the physical table/entity to read, and the timestamp column used for time bucketing.

Possible values:
fieldIdstringOptional

BigQuery column name to aggregate for DERIVED metrics. Required when type=DERIVED.

columnAggregationstring · enumOptional

SQL aggregation function applied to the fieldId column.

Possible values:
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/unit-metric
POST /gateway/ccm/api/unit-metric?accountIdentifier=text HTTP/1.1
Host: nextgen-ce-d788d786-ssnpc
Content-Type: application/json
Accept: */*
Content-Length: 300

{
  "metricIdentifier": "text",
  "metricName": "text",
  "labels": {
    "manager": "kiran"
  },
  "description": "text",
  "defaultAggregation": "AVG",
  "handleEmptyValue": "PREVIOUS_VALUE",
  "unitMetricRecords": [
    {
      "value": 1,
      "usageTimeStamp": "text"
    }
  ],
  "type": "MANUAL",
  "dataSource": "BILLING",
  "fieldId": "text",
  "columnAggregation": "SUM"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update Unit Metric

put

Update an existing Unit Metric.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

The request object for Unit Metric

metricIdentifierstringRequired

Unique metric identifier for the unit metric

metricNamestringRequired

Display name of the unit metric

descriptionstringOptional

Unit Metric Description

defaultAggregationstring · enumOptional

Aggregation applied to unit cost metric values per time bucket in BigQuery. Supported: AVG (default when omitted or null), MIN, MAX, SUM.

Possible values:
handleEmptyValuestring · enumOptional

Strategy for handling missing/empty data points in unit cost metrics. LEAVE_BLANK: leave missing points empty (default). PREVIOUS_VALUE: carry forward the last known value. ZERO: fill gaps with 0.

Possible values:
typestring · enumOptional

Discriminator for unit metric data source: manually uploaded time-series or derived dynamically from a BigQuery column.

Possible values:
dataSourcestring · enumOptional

Data source to query for COLUMN-type unit metrics. Each source declares its query backend (BigQuery or UDP), the physical table/entity to read, and the timestamp column used for time bucketing.

Possible values:
fieldIdstringOptional

BigQuery column name to aggregate for DERIVED metrics. Required when type=DERIVED.

columnAggregationstring · enumOptional

SQL aggregation function applied to the fieldId column.

Possible values:
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/unit-metric
PUT /gateway/ccm/api/unit-metric?accountIdentifier=text HTTP/1.1
Host: nextgen-ce-d788d786-ssnpc
Content-Type: application/json
Accept: */*
Content-Length: 300

{
  "metricIdentifier": "text",
  "metricName": "text",
  "labels": {
    "manager": "kiran"
  },
  "description": "text",
  "defaultAggregation": "AVG",
  "handleEmptyValue": "PREVIOUS_VALUE",
  "unitMetricRecords": [
    {
      "value": 1,
      "usageTimeStamp": "text"
    }
  ],
  "type": "MANUAL",
  "dataSource": "BILLING",
  "fieldId": "text",
  "columnAggregation": "SUM"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete Unit Metric records or the entire metric.

delete

Delete Unit Metric records within a specified time range, or pass deleteCompleteMetric=true to remove the metric definition along with all of its records (startTime/endTime are ignored in that case). A complete delete is rejected when the metric is still referenced by any Perspective.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

identifierstringRequired

Unit Metric identifier

startTimestringOptional

Start time in ISO 8601 format (e.g., 2020-03-03T15:32:44Z or 2020-03-03T15:32:44%2B00:00). Required when deleteCompleteMetric=false; ignored otherwise.

endTimestringOptional

End time in ISO 8601 format (e.g., 2020-03-03T15:32:44Z or 2020-03-03T15:32:44%2B00:00). Required when deleteCompleteMetric=false; ignored otherwise.

deleteCompleteMetricbooleanOptional

When true, deletes the entire Unit Metric (definition + all records) and ignores startTime/endTime. The deletion is rejected if the metric is referenced by any Perspective.

Default: false
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/unit-metric
DELETE /gateway/ccm/api/unit-metric?accountIdentifier=text&identifier=text HTTP/1.1
Host: nextgen-ce-d788d786-ssnpc
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get Column Metric for Perspective

post

Query a DERIVED-type unit metric with perspective filters applied, optionally with additional filters on top of the perspective's saved rules.

Path parameters
perspectiveIdstringRequired

Perspective ID whose filters will be applied

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

metricIdentifierstringRequired

DERIVED-type unit metric identifier

startTimestringRequired

Start time in ISO 8601 format (e.g., 2020-03-03T15:32:44Z)

endTimestringRequired

End time in ISO 8601 format (e.g., 2020-03-03T15:32:44Z)

timeTruncGroupBystring · enumOptional

Groups unit metric samples into calendar buckets (DAY, WEEK, or MONTH) before applying the metric's default aggregation in BigQuery.

Default: DAYPossible values:
overrideFilterbooleanOptional

When false (default), body filters are applied on top of the perspective's saved rules. When true, the perspective's saved rules are ignored and only the body filters are applied — used to preview an edited/removed filter set before saving.

Default: false
Bodyobject · QLCEViewFilterWrapper[]

Get Recommendations for a perspective

timeRangeTypeFilterstring · enumOptionalPossible values:
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/unit-metric/perspective/{perspectiveId}
POST /gateway/ccm/api/unit-metric/perspective/{perspectiveId}?accountIdentifier=text&metricIdentifier=text&startTime=text&endTime=text HTTP/1.1
Host: nextgen-ce-d788d786-ssnpc
Content-Type: application/json
Accept: */*
Content-Length: 553

[
  {
    "idFilter": {
      "field": {
        "fieldId": "text",
        "fieldName": "text",
        "identifier": "CLUSTER",
        "identifierName": "text"
      },
      "operator": "NOT_IN",
      "values": [
        "text"
      ]
    },
    "timeFilter": {
      "field": {
        "fieldId": "text",
        "fieldName": "text",
        "identifier": "CLUSTER",
        "identifierName": "text"
      },
      "operator": "AFTER",
      "value": 1
    },
    "timeRangeTypeFilter": "LAST_MONTH",
    "viewMetadataFilter": {
      "viewId": "text",
      "isPreview": true,
      "preview": true
    },
    "ruleFilter": {
      "conditions": [
        {
          "field": {
            "fieldId": "text",
            "fieldName": "text",
            "identifier": "CLUSTER",
            "identifierName": "text"
          },
          "operator": "NOT_IN",
          "values": [
            "text"
          ]
        }
      ]
    }
  }
]
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

List All Unit Metrics

get

Get all Unit Metrics for an account (metadata only, no records).

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

pageSizeinteger · int32 · max: 100Required

Number of unit metrics to be shown (max 100)

Default: 20
pageNointeger · int32Required

Number of records to be skipped

Default: 0
searchKeystringOptional

Search key to filter unit metrics by name (case-insensitive)

sortTypestring · enumOptional

Sort field for the list

Default: LAST_UPDATED_ATPossible values:
sortOrderstring · enumOptional

Sort order (ASCENDING or DESCENDING)

Possible values:
Responses
400

Bad Request

application/json

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/unit-metric/list
GET /gateway/ccm/api/unit-metric/list?accountIdentifier=text&pageSize=20&pageNo=0 HTTP/1.1
Host: nextgen-ce-d788d786-ssnpc
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Last updated

Was this helpful?