Get Topology Definition¶
获取拓扑结构的元数据,以及拓扑规则允许的设备类型相关信息。支持场站内和场站外拓扑结构。
操作权限¶
使用此 API 前,确保服务账号已被授予包含下列服务和操作权限的策略。有关授权服务账号的更多信息,参见 管理服务账号。
| 需授权的策略 | 所需操作权限 | 
|---|---|
| 组织管理员 | Full Access | 
前提条件¶
当前 OU 已绑定 OU 模板,且模板内已配置拓扑规则。
请求格式¶
GET https://{apigw-address}/amc/v1.0/topology?action=getDefinition
请求参数(URI)¶
| 名称 | 位置(Path/Query) | 必需/可选 | 数据类型 | 描述 | 
|---|---|---|---|---|
| orgId | Query | 必需 | String | 组织 ID。获取 orgId 信息>> | 
| topologyId | Query | 必需 | String | 
响应参数¶
| 名称 | 数据类型 | 描述 | 
|---|---|---|
| data | TopologyDefinition 结构体 | 拓扑信息。 | 
TopologyDefinition 结构体¶
| 名称 | 数据类型 | 描述 | 
|---|---|---|
| name | StringI18n | 拓扑结构名称。 | 
| description | StringI18n | 拓扑结构的描述信息。 | 
| topologyMetaData | TopologyMetaData 结构体 | 拓扑相关的元数据信息。 | 
TopologyMetaData 结构体¶
| 名称 | 数据类型 | 描述 | 
|---|---|---|
| deviceTypes | Metadata 结构体数组 | 设备类型信息。 | 
Metadata 结构体¶
| 名称 | 数据类型 | 描述 | 
|---|---|---|
| identifier | String | 设备类型标识符。 | 
| name | StringI18n | 设备类型名称。 | 
| type | String | 设备的业务对象分类:DEVICE。 | 
错误码¶
| 代码 | 错误信息 | 描述 | 
|---|---|---|
| 99500 | Internal server error | 服务器内部错误,请联系 EnOS 技术支持团队。 | 
| 99400 | topologyId is missing | topologyId 未填。 | 
| 99400 | topologyId is invalid | topologyId 参数无效,请检查请求参数。 | 
| 98404 | topologyId does not exist | topologyId 不存在。 | 
示例¶
请求示例¶
URL: https://{apigw-address}/amc/v1.0/topology?action=getDefinition&orgId=yourOrgId&topologyId=yourTopologyId
method: GET
返回示例¶
{
    "code":0,
    "msg":"OK",
    "requestId":"40f8fe15-cb52-436c-8e71-b7217023efd3",
    "data":{
        "name":{
            "defaultValue":"Soiling Group",
            "i18nValue":{
            }
        },
        "description":{
            "defaultValue":"If you are not using the Ensight Solar application for this site, you can skip the configuration of the Soiling Group topology.",
            "i18nValue":{
                "en_US":"If you are not using the Ensight Solar application for this site, you can skip the configuration of the Soiling Group topology.",
                "zh_CN":"如果该场站不接入 Ensight Solar,可跳过灰尘组的拓扑配置"
            }
        },
        "topologyMetaData":{
            "deviceTypes":[
                {
                    "identifier":"Inverter",
                    "name":{
                        "defaultValue":"Inverter",
                        "i18nValue":{
                            "en_US":"Inverter",
                            "zh_CN":"逆变器"
                        }
                    },
                    "type":"Device"
                },
                {
                    "identifier":"WeatherStation",
                    "name":{
                        "defaultValue":"Weather Station",
                        "i18nValue":{
                            "en_US":"Weather Station",
                            "zh_CN":"气象站"
                        }
                    },
                    "type":"Device"
                }
            ]
        }
    }
}