该接口支持将设备信息批量导出为 csv、xlsx 格式,不支持导出设备标签和配置信息。
请求接口
POST /api/device/instance/device/batch/export.{format}/{deviceType}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| X-Access-Token | header | string | true | 平台 token |
| format | path | string | true | 导出文件格式,支持 csv、xlsx |
| deviceType | path | string | true | 设备类型 |
| body | body | object | true | - |
| » allFlag | body | boolean | true | 全选标识, true表示全选 |
| » excludeIds | body | array | false | 排除ID列表(排除在全选范围之外的设备ID列表) |
| » containIds | body | array | false | 包含ID列表,全选标识为 false 时必填 |
| » terms | body | [object] | false | 过滤条件 |
| »» terms | body | string | false | 嵌套条件 |
| »»» termType | body | string | false | 动态条件类型 |
| »»» column | body | string | false | 字段名称 |
| »»» value | body | string | false | 字段值 |
| »»» type | body | string | false | 多个条件关联类型,可选值:or、and |
- deviceType:normalDevice(普通设备)/regulator(控制器)/adaptor(适配器)。
- column:normalDevice对应为superDeviceType,regulator、adaptor对应为categoryType。
- value:value值为deviceType值。
Body示例
json
{
"allFlag":false,
"excludeIds":[],
"containIds":["111","1686270632456732672","createDevice"],
"terms":[
{
"terms":[
{
"termType":"eq",
"column":"superDeviceType",
"value":"normalDevice",
"type":"and"
}
]
}
]
}{
"allFlag":false,
"excludeIds":[],
"containIds":["111","1686270632456732672","createDevice"],
"terms":[
{
"terms":[
{
"termType":"eq",
"column":"superDeviceType",
"value":"normalDevice",
"type":"and"
}
]
}
]
}