List Metrics
API Description
Use this API to get the list of all metrics under a tenant.
API URL
GET Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/metrics/list
For how to obtain anymetrics_host:anymetrics_port, see Calling APIs.
Request Parameters
| Parameter |
Type |
Required |
Description |
| tenant-id |
String |
Yes |
The tenant ID for the tenant that contains the metric query content. |
| auth-type |
String |
Yes |
Authentication method. Supported values: UID, TOKEN, ACCOUNT, APIKEY. |
| auth-value |
String |
Yes |
Authentication value that corresponds to auth-type. |
How to Obtain Common Parameters
To obtain tenant-id, select the metric application from the top navigation bar in Aloudata CAN, choose API Integration from the left navigation menu, and copy it from the API Integration page. Set auth-value based on the selected auth-type.

Request Parameters
| Parameter |
Type |
Required |
Description |
| keyword |
String |
No |
Search keyword. |
| metricCategoryId |
String |
No |
Metric category. If omitted, metrics under all categories are returned. To query uncategorized metrics, pass "-1". |
| statusFilters |
List |
No |
Metric statuses. If omitted, metrics in all statuses are returned. Enum values: UNPUBLISHED: unpublished; PUBLISHED: published; SAVED_NOT_PUBLISHED: saved but not published; OFFLINE: offline; PENDING_PUBLISH: publishing; PENDING_OFFLINE: taking offline; PENDING_DELETE: pending deletion. |
| pageNumber |
int |
No |
Current page. |
| pageSize |
int |
No |
Page size. |
Response Parameters
Response Parameter Description
| Parameter |
Type |
Required |
Maximum Length |
Description |
| code |
String |
Yes |
64 |
API response code. |
| message |
String |
Yes |
512 |
Message body. |
| traceId |
String |
Yes |
128 |
Trace ID. |
| data |
Array[Object] |
Yes |
|
Response result. For details, see "data Parameter Description". |
data Parameter Description
| Parameter |
Type |
Required |
Maximum Length |
Description |
|
| code |
String |
No |
|
Unique metric identifier generated by the system. |
|
| metricName |
String |
Yes |
128 |
Metric name. |
|
| version |
Int |
No |
|
Metric version number. |
|
| metricCode |
String |
Yes |
|
Manually specified metric code when metric-code capabilities are enabled on the platform. |
|
| metricDisplayName |
String |
Yes |
128 |
Metric display name. |
|
| businessCaliber |
String |
No |
300 |
Metric description. |
|
| owner |
String |
Yes |
|
Metric owner. |
|
| businessOwner |
String |
Yes |
|
Business owner. |
|
| metricCategoryId |
String |
Yes |
|
Metric category ID. |
|
| type |
String |
Yes |
|
Metric type (ATOMIC/DERIVED/COMPOSITE). |
|
| status |
String |
Yes |
|
Final metric status. Enum values: ONLINE: online; OFFLINE: offline. |
|
| publishStatus |
String |
Yes |
|
Publishing status. Enum values: DRAFT: draft; PUBLISHED: published. |
|
| displayStatus |
String |
No |
|
Current metric status. Enum values: UNPUBLISHED: unpublished; PUBLISHED: published; SAVED_NOT_PUBLISHED: saved but not published; OFFLINE: offline; PENDING_PUBLISH: publishing; PENDING_OFFLINE: taking offline; PENDING_DELETE: pending deletion. |
|
| unit |
String |
No |
|
Metric unit. For details, see "Metric Unit Description". |
|
| cnUnit |
String |
No |
|
Chinese metric unit. For details, see "Metric Unit Description". |
|
| metricViewCount |
Integer |
Yes |
|
Number of metric queries. |
|
| properties |
Array |
No |
|
Metric attributes. For details, see "properties Parameter Description". |
|
| gmtCreate |
String |
No |
|
Creation time of the metric. |
|
| gmtUpdate |
String |
No |
|
Update time of the metric. |
|
| timeGranularity |
String |
Yes |
|
Time granularity, meaning the time unit used for data statistics. This field is currently not set and has a value of null. |
|
| hasDateLimit |
Boolean |
Yes |
|
Whether the metric has a date constraint. false means no constraint. |
|
| hasDerivationMethod |
Boolean |
Yes |
|
Whether the metric has a derivation method. false means this is not a derived metric and has no derivation logic. |
|
| metricTimeDataType |
Boolean |
Yes |
|
Metric time data type. DATE_TIME means the value includes a specific time. |
|
| canEdit |
String |
Yes |
|
Whether the metric can be edited. true means the caller has permission. |
|
| canDelete |
Boolean |
Yes |
|
Whether the metric can be deleted. true means the caller has permission. |
|
| canUsage |
Boolean |
Yes |
|
Whether the metric can be used. true means the caller has permission. |
|
| canAuth |
Boolean |
Yes |
|
Whether the metric can be authorized to others. true means the caller has permission. |
|
| canTransfer |
Boolean |
Yes |
|
Whether ownership of the metric can be transferred. true means the caller has permission. |
|
properties
| Parameter |
Type |
Required |
Maximum Length |
Description |
| MANAGE |
String |
No |
128 |
Management attributes. |
| BUSINESS |
String |
No |
|
Business attributes. |
| TECHNOLOGY |
String |
No |
128 |
Technical attributes. |
| BASE |
String |
No |
300 |
Basic attributes. |
Metric Unit Description
| Category |
Enum Value |
Description |
| Currency |
CNY_FEN |
Fen (CNY) |
| CNY_YUAN |
Yuan (CNY) |
|
| CNY_WAN |
Ten thousand yuan (CNY) |
|
| CNY_BAI_WAN |
Million yuan (CNY) |
|
| CNY_YI_YUAN |
Hundred million yuan (CNY) |
|
| USD_CENT |
Cent (USD) |
|
| USD_DOLLAR |
Dollar (USD) |
|
| EUR_EURO |
Euro (EUR) |
|
| HKD_DOLLAR |
Dollar (HKD) |
|
| NEW_TAIWAN_DOLLAR |
Dollar (TWD) |
|
| Time |
DAY |
Day |
| MONTH |
Month |
|
| WEEK |
Week |
|
| YEAR |
Year |
|
| HOUR |
Hour |
|
| MINUTE |
Minute |
|
| SECOND |
Second |
|
| QUARTER |
Quarter |
|
| MILLISECOND |
Millisecond |
|
| Ratio |
DECIMAL |
Decimal |
| PERCENTAGE |
Percentage |
|
| PERMILLE |
Per mille |
|
| Noun |
RANK |
Rank |
| Object Count |
HOUSEHOLD |
Household |
| TRANSACTION |
Transaction |
|
| ITEM |
Item |
|
| INDIVIDUAL |
Individual |
|
| OCCURRENCE |
Occurrence |
|
| PERSON_DAY |
Person-day |
|
| FAMILY |
Family |
|
| HAND |
Hand |
|
| SHEET |
Sheet |
|
| PACKAGE |
Package |
|
| Weight |
TON |
Ton |
| KILOGRAM |
Kilogram |
|
| Other |
OTHER |
Other |
Request Example
http://127.0.0.1/anymetrics/api/v1/metrics/list?keyword=Test&pageNumber=1&pageSize=1&metricCategoryId=-1
Response Example
{
"data": {
"total": 67,
"pageNumber": 1,
"pageSize": 20,
"hasNext": true,
"data": [
{
"code": "1a1234b829db4b3eb97af9fd1d9a0c67",
"metricName": "count_CustomerNamess",
"version": 2,
"metricCode": null,
"metricDisplayName": "Customer Count",
"businessCaliber": "Counts CustomerName in Customers.",
"owner": null,
"businessOwner": "jingming",
"type": "ATOMIC",
"unit": "OTHER",
"cnUnit": "Other",
"metricCategoryId": "8e57c5b8-dca7-45ea-9ec5-35d17d6e67dd",
"metricViewCount": 61,
"status": "ONLINE",
"publishStatus": "PUBLISHED",
"properties": {
"MANAGE": {},
"BUSINESS": {
"businessOwner": "jingming"
},
"TECHNOLOGY": {},
"BASE": {
"metricLevel": "T4"
}
},
"displayStatus": "PUBLISHED",
"gmtCreate": "2024-10-08 15:39:11",
"gmtUpdate": "2024-10-08 15:40:12"
}
]
},
"success": true,
"code": "200",
"errorMsg": null,
"detailErrorMsg": null,
"traceId": "2f609a60ed284e7384a6828b29fe25a0.152.17284434132120547"
}