Query Meta Generic Data


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

请求格式


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

请求参数


名称

位置

必需/可选

数据类型

描述

orgId

Query

必需

String

数据所属的组织 ID。如何获取 orgId 信息>>

mdmTypes

Query/Form

可选

String

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

mdmIds

Query/Form

可选

String

数据对应的对象实例的标识符,多个对象实例之间用英文逗号隔开。单次查询指定的对象实例数量不超过 20000。为保证查询性能,建议单次查询指定的对象实例数量不超过 100。

metaTypes

Query/Form

可选

String

元数据类型,目前支持 measurement-point、attribute、metric。多个类型之间用英文逗号隔开。

locale

Query/Form

可选

String

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

withI18n

Query/Form

可选

Boolean

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

withDataSourceInfo

Query/Form

可选

Boolean

是否返回数据源信息。

备注

mdmTypes 和 mdmIds 均为可选参数,但至少需要使用一个。若同时指定了两个参数,优先使用 mdmIds。

返回内容类型


application/json; charset = UTF-8

返回码


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

示例

请求示例


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

返回示例


{
   "data":[
         "measurement-point":[
            {
                "mdmType":"yourMdmType",
                "modelId": "yourModelId",
                "name": "Site Active Power",
                "units": "kW",
                "type": "Double",
                "measurementPoint": "SITE.GenActivePW",
                "timeAggMethods": "avg,sum,max,min,first,last",
                "mdmAggMethods": "sum",
                "interval":"5,15,60",
                "accumulable": false,
                "signalType": "AI"
            },
            {
                "mdmType":"yourMdmType",
                "modelId": "yourModelId",
                "name": "Site POA",
                "units": "W/m²",
                "type": "Double",
                "measurementPoint": "SITE.Radiation",
                "timeAggMethods": "avg,sum,max,min,first,last",
                "mdmAggMethods": "sum",
                "interval":"5,15,60",
                "accumulable": true,
                "signalType": "AI"
            }
        ],
        "attribute":[
            {
                "mdmType":"yourMdmType",
                "modelId": "yourModelId",
                "name":"Commissioning Date",
                "attribute":"operativeDate",
                "units":"--",
                "type":"date"
            },
            {
                "mdmType":"yourMdmType",
                "modelId": "yourModelId",
                "name":"Onboarding Date",
                "attribute":"etlDate",
                "units":"--",
                "type":"date"
            },
            {
                "mdmType":"yourMdmType",
                "modelId": "yourModelId",
                "name":"objectTypeID",
                "attribute":"objectTypeID",
                "units":"--",
                "type":"string"
            },
            {
                "mdmType":"yourMdmType",
                "modelId": "yourModelId",
                "name":"Unit Price",
                "attribute":"correctedPrice",
                "units":"--",
                "type":"Double"
            }
        ],
        "metric":[
            {
                "mdmType":"yourMdmType",
                "metric": "activeProduction",
                "name": "Active Production",
                "units": "kWh",
                "type": "Double",
                "interval": "D,M,Y,T",
                "mdmAggMethods": "sum",
                "accumulativePoint": "SITE.ActiveProduction"
            },
            {
                "mdmType":"yourMdmType",
                "metric": "SITE.StringDownLossRecoverable",
                "name": "Recoverable Down String Loss",
                "units": "kWh",
                "type": "Double",
                "interval": "D,M,Y,T",
                "mdmAggMethods": "sum",
                "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"
}