Query Asset Topology


Get asset topology by object instance IDs.

Request Format


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

Request Parameters


Name Location Mandatory/Optional Data Type Description
orgId Query Mandatory String The organization ID which the topology belongs to. How to get orgId >>
mdmIds Query Mandatory String The object instance ID of the asset. Separate multiple IDs by commas. Up to 20000 object instances are allowed in a single query. To ensure query performance, it is recommended that you pass in no more than 100 object instances in a single query.
mdmTypes Query Optional String The object type ID which the topology belongs to. Separate multiple IDs by commas. Up to 100 object type IDs are allowed in a single query. How to get mdmTypes>>
topologyRuleId Query Mandatory String The topology rule ID. How to get topologyRuleId>>
attributes Query Optional String The attribute of the asset. Separate multiple attributes by commas. Both model attributes and “virtual attributes” defined in Common Data Service are supported. How to get attributes>>
filter Query/Form Optional String Specify how to filter the returned data by attributes. For example, [[{“field”:”field1”,”operator”:”>=”,”value”:”1”},{“field”:”field2”,”operator”:”<=”,”value”:”2”}],[{“field”:”field3”,”operator”:”==”,”value”:”3”}]], which means the returned data is filtered by (field1 >= 1 and field2 <= 2) or (field3=3).
locale Query Optional String Use zh-CN, en-US, ja-JP, or es-ES. If not specified, the value is set to en_US by default.
withI18n Query Optional Boolean Whether to return the internationalization content. The value is true or false. Default is false.

Response Content Type


application/json; charset = UTF-8

Response Parameters


Name To Return Definitely/Conditionally Data Type Description
assetTopology Definitely AssetTopology Struct Describe the topology of the asset. See AssetTopology Struct.
assets Definitely Asset Struct Describe the asset information. See Query Accessible Asset.

AssetTopology Struct


Name To Return Definitely/Conditionally Data Type Description
mdmId Definitely String The identifier of the asset instance. To ensure query performance, it is recommended that you pass in no more than 100 object instances in a single query.
children Definitely AssetTopology Struct Describe the topology of the child assets.

Samples

Request Sample


GET https://{api-gateway}/cds-asset-service/v1.0/topology?action=query&orgId=yourOrgId&mdmIds=yourMdmId&topologyRuleId=yourTopologyRuleId

Response Sample


{
   "data": {
        "assetTopology": {
            "mdmId": "yourMdmId",
            "children": [
                {
                    "mdmId": "yourChildMdmId",
                    "children": []
                },
                {
                    "mdmId": "yourChildMdmId",
                    "children": []
                }
            ]
        },
        "assets": {
            "yourMdmId": {
                "mdmType": "EnOS_Solar_Site",
                "mdmId": "yourMdmId",
                "name": "yourMdmId",
                "capacity": 3.6
            },
            "yourChildMdmId": {
                "mdmType": "EnOS_Solar_Inverter",
                "mdmId": "yourMdmId",
                "name": "yourMdmId",
                "capacity": 1800.0
            },
            "yourChildMdmId": {
                "mdmType": "EnOS_Solar_Inverter",
                "mdmId": "yourMdmId",
                "name": "yourMdmId",
                "capacity": 1800.0
            }
        }
    },
    "code": 0,
    "msg": "OK",
    "traceId": "1234567890abcdefghijkl0987654321"
}