Query Meta Metric


根据对象类型标识符等信息获取指标元数据。

请求格式


GET https://{api-gateway}/cds-meta-service/v1.0/metric?action=query

请求参数


名称

位置

必需/可选

数据类型

描述

orgId

Query

必需

String

指标所属的组织 ID。如何获取 orgId 信息>>

mdmTypes

Query

必需

String

指标所属的对象类型的标识符,多个对象类型之间用英文逗号隔开。单次查询指定的对象类型数量不超过 100。 如何获取 mdmTypes 信息>>

locale

Query

可选

String

中文:zh-CN, 英文:en-US, 日语:ja-JP,西班牙语:es-ES。默认为 en-US。

withI18n

Query

可选

Boolean

是否返回完整的国际化内容。

withDataSourceInfo

Query

可选

Boolean

是否返回数据源信息。

返回内容类型


application/json; charset = UTF-8

返回码


参见 通用数据服务 API 返回码

示例

请求示例


GET https://{api-gateway}/cds-meta-service/v1.0/metric?action=query&orgId=yourOrgId&mdmTypes=yourMdmType

返回示例


{
   "data":[
        {
            "mdmType":"yourMdmType",
            "metric": "activeProduction",
            "name": "Active Production",
            "units": "kWh",
            "type": "Double",
            "interval": "D,M,Y,T",
            "mdmAggMethods": "sum",
            "accumulativePoint": "SITE.ActiveProduction",
            "dimensions": "inverterModel,inverterMfr",
            "dataSources": "SolarAPI,OLAPAPI"
        },
        {
            "mdmType":"yourMdmType",
            "metric": "SITE.StringDownLossRecoverable",
            "name": "Recoverable Down String Loss",
            "units": "kWh",
            "type": "Double",
            "interval": "D,M,Y,T",
            "mdmAggMethods": "sum"
        },
        {
            "mdmType":"yourMdmType",
            "metric": "SITE.PR",
            "name": "Performance Ratio",
            "units": "%",
            "type": "Double",
            "interval": "D,M,Y,T",
            "expression": "#{Metric['SITE.PR150_Numerator'] / Metric['SITE.PR150_Denominator']}",
            "standardType": "illegal",
            "filters": ">,>=",
            "sortable": false,
            "dataSources": "SolarAPI",
            "dataSourceCapability": {
                "dimensionFilter": "2",
                "pagination": "1",
                "mdmGroup": "1",
                "virtualDimension": "1",
                "dimensionSort": "2",
                "metricSort": "2",
                "metricFilter": "2",
                "rollup": "1"
            }
        }
   ],
   "code":0,
   "msg":"OK",
   "traceId": "1234567890abcdefghijkl0987654321"
}