Skip to content

List Metrics as a Tree

API Description

Use this API to get the metric list as a tree.

API URL

GET Http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/metrics/treeList

For how to obtain anymetrics_host:anymetrics_port, see Calling APIs.

Request Parameters

Common Request Parameters (HEADERS)

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

None.

Response Parameters

Response Parameter Description

Parameter Type Required Maximum Length Description
categoryId String Yes Current category ID.
categoryName String Yes Current category name.
metricList Array No Metrics under the current category. For details, see "metricList Parameter Description".
subCategory Array No Child categories. This is a recursive structure.

metricList 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.
metricCode String Yes Metric code.
metricDisplayName String Yes Metric display name.
businessCaliber String Yes Business definition.
owner String Yes Metric owner.
type String Yes Metric type.
unit String Yes Metric unit.
metricViewCount Integer Yes Number of metric queries.
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.
properties Map No Metric attributes. For details, see "properties Parameter Description".

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.

Request Example

http://127.0.0.1/anymetrics/api/v1/analysisview/treeList

Response Example

{
    "data": {
        "rootList": [
            {
                "categoryId": "cb26dc45-74b6-4724-8a61-b2c28bf03af1",
                "categoryName": "New Category 0",
                "metricList": [
                    {
                        "metricName": "count_express_no",
                        "metricDisplayName": "express_no Count",
                        "businessCaliber": "Counts express_no in tb_express.",
                        "owner": null,
                        "businessOwner": "436474374799757312",
                        "type": "ATOMIC",
                        "unit": "OTHER",
                        "metricCategoryId": "cb26dc45-74b6-4724-8a61-b2c28bf03af1",
                        "metricViewCount": 0,
                        "status": "ONLINE",
                        "publishStatus": "PUBLISHED",
                        "properties": {
                            "MANAGE": {},
                            "BUSINESS": {},
                            "TECHNOLOGY": {},
                            "BASE": {
                                "metricLevel": "T4"
                            }
                        }
                    }
                ],
                "subCategory": [
                    {
                        "categoryId": "00516287-ab4b-4040-817c-074ab790bdb3",
                        "categoryName": "New Category 1",
                        "metricList": [
                            {
                                "metricName": "sum_OnlineSalesKey",
                                "metricDisplayName": "OnlineSalesKey Sum",
                                "businessCaliber": "Sums OnlineSalesKey in fact_tb1.",
                                "owner": null,
                                "businessOwner": "436932989968977920",
                                "type": "ATOMIC",
                                "unit": "OTHER",
                                "metricCategoryId": "00516287-ab4b-4040-817c-074ab790bdb3",
                                "metricViewCount": 0,
                                "status": "ONLINE",
                                "publishStatus": "PUBLISHED",
                                "properties": {
                                    "MANAGE": {
                                        "sdfdfda": "rsdyfg",
                                        "fsdfg": "hk",
                                        "gfds": "rd"
                                    },
                                    "BUSINESS": {
                                        "asd": "dsfg"
                                    },
                                    "TECHNOLOGY": {},
                                    "BASE": {
                                        "metricLevel": "T4"
                                    }
                                }
                            }
                        ],
                        "subCategory": []
                    }
                ]
            },
            {
                "categoryId": "-1",
                "categoryName": "uncategorized",
                "metricList": [
                    {
                        "metricName": "sum_order_amt",
                        "metricDisplayName": "order_amt Sum",
                        "businessCaliber": "Sums order_amt in tb_order.",
                        "owner": null,
                        "businessOwner": "436474374799757312",
                        "type": "ATOMIC",
                        "unit": "OTHER",
                        "metricCategoryId": "-1",
                        "metricViewCount": 0,
                        "status": "ONLINE",
                        "publishStatus": "PUBLISHED",
                        "properties": {
                            "MANAGE": {},
                            "BUSINESS": {},
                            "TECHNOLOGY": {},
                            "BASE": {}
                        }
                    },
                    {
                        "metricName": "count_buyer_id",
                        "metricDisplayName": "buyer_id Count",
                        "businessCaliber": "Counts buyer_id in tb_order.",
                        "owner": null,
                        "businessOwner": "436474374799757312",
                        "type": "ATOMIC",
                        "unit": "OTHER",
                        "metricCategoryId": "-1",
                        "metricViewCount": 0,
                        "status": "ONLINE",
                        "publishStatus": "PUBLISHED",
                        "properties": {
                            "MANAGE": {},
                            "BUSINESS": {},
                            "TECHNOLOGY": {},
                            "BASE": {}
                        }
                    },
                    {
                        "metricName": "tt",
                        "metricDisplayName": "Total Sales Excluding Shanghai dfss",
                        "businessCaliber": "[order_amt Sum]-[Shanghai order_amt Sum]",
                        "owner": null,
                        "businessOwner": "436474374799757312",
                        "type": "COMPOSITE",
                        "unit": "OTHER",
                        "metricCategoryId": "-1",
                        "metricViewCount": 0,
                        "status": "ONLINE",
                        "publishStatus": "PUBLISHED",
                        "properties": {
                            "MANAGE": {},
                            "BUSINESS": {},
                            "TECHNOLOGY": {},
                            "BASE": {
                                "metricLevel": "T3"
                            }
                        }
                    },
                    {
                        "metricName": "order_amt_sum_shanghai",
                        "metricDisplayName": "Shanghai order_amt Sum",
                        "businessCaliber": "Shanghai order_amt Sum",
                        "owner": null,
                        "businessOwner": "436474374799757312",
                        "type": "DERIVED",
                        "unit": "OTHER",
                        "metricCategoryId": "-1",
                        "metricViewCount": 0,
                        "status": "ONLINE",
                        "publishStatus": "PUBLISHED",
                        "properties": {
                            "MANAGE": {},
                            "BUSINESS": {},
                            "TECHNOLOGY": {},
                            "BASE": {}
                        }
                    }
                ],
                "subCategory": []
            }
        ]
    },
    "success": true,
    "code": null,
    "errorMsg": null,
    "traceId": "586b0dfd92d74ed3985025e7710043f7.200.17161729765280029"
}