获取工厂模型某一层级下的生产设备列表
路径 | /industry/modelling/equipment/list/query |
版本号 | 1.0.2 |
协议 | HTTPS |
请求方法 | POST |
是否需要用户身份鉴权 | 否 |
超时时间 | 3000 |
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
id | Long | 否 | {"id":123} | 指定id,跟levelValue配合使用,levelValue=5时指定的是设备id,levelValue=4时指定的是加工中心id(获取指定加工中心下的所有设备) |
level | Int | 是 | {"level":1} | 从哪一级别开始,5=设备,4=加工中心,3=产线,2=车间,1=工厂 |
code | String | 否 | {"code":"code123"} | 指定编码,跟levelValue配合使用,levelValue=5时指定的是设备编码,levelValue=4时指定的是加工中心编码(获取指定加工中心下的所有设备) |
appId | String | 否 | {"appId”:”xxxxx”} | 应用id |
employeeId | String | 否 | {"employeeId”:”xxxxx”} | 用户id,需要做用户级别鉴权时需要传入此参数 |
corpId | String | 否 | 企业标识,每个企业拥有唯一的CorpID,比如钉钉corpID、LH里面的appId,用参数source来区分参数含义 | |
userId | String | 否 | 员工在当前企业内的唯一标识,比如钉钉userId或者IoT的employeeId | |
source | String | 否 | 参数来源,枚举值,钉钉填写DINGDING,多租户saas应用填SAAS,source、corpId、userId配合使用 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
code | Int |
响应码, 200: 成功 |
|
message | String |
错误消息 |
|
localizedMsg | String |
本地语言错误消息 |
|
data | JSON |
响应结果 |
|
equipments | JSON |
设备列表 |
|
id | Long |
设备id |
|
assetNum | String |
固定资产编号 |
|
brevityCode | String |
简码 |
|
equipmentModel | String |
设备型号 |
|
equipmentModelName | String |
设备型号名称 |
|
iotDeviceId | String |
关联的物联网设备的iotid |
|
usableCondition | String |
使用状态(1-新建;2-使用中;3-已停用;4-已报废) |
|
description | String |
设备描述 |
|
parentId | Long |
父节点id |
|
parentType | String |
父节点类型 |
|
name | String |
设备名称 |
示例
请求示例
// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();
ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");
SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);
IoTApiRequest request = new IoTApiRequest();
// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.2");
// 设置参数
request.putParam("id", "value0");
request.putParam("level", value1");
request.putParam("code", value2");
request.putParam("appId", value3");
request.putParam("employeeId", value4");
request.putParam("corpId", value5");
request.putParam("userId", value6");
request.putParam("source", value7");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");
// 设置请求参数域名, path, request, isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/industry/modelling/equipment/list/query", request, true, headers);
System.out.println(
"response code = " + response.getCode()
+ " response = " + new String(response.getBody(), "UTF-8")
+ " headers = " + response.getHeaders().toString()
);
正常返回示例
JSON
格式
{
"code": 200,
"data": {
"equipments": [
{
"iotDeviceId": "",
"usableCondition": "新建",
"assetNum": "equipment2",
"name": "生产设备2",
"description": "equipment2",
"id": 2,
"equipmentModel": "2",
"equipmentModelName": "日常模拟用设备型号",
"brevityCode": "equipment2",
"parentId": 94,
"parentType": "machiningCenter"
}
]
},
"id": "5dc17ec4c6d04556a76c6d515d490d3c"
}
异常返回示例
JSON
格式
{
"id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
"code": 403,
"message": "request forbidden.",
"localizedMsg": "请求被禁止",
"data": null
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
500 | 500 | Internal Error | Internal Error |
503 | 503 | Service Unavailable | Service Unavailable |
403 | 403 | Request Limited | Request Limited |
401 | 401 | Empty Signature | Empty Signature |
400 | 400 | Request Format Error | Request Format Error |
200 | 20003 | Find Backend Error | Find Backend Error |
200 | 20004 | Backend Service Error | Backend Service Error |
200 | 20055 | Backend Service Invalid | Request Format Error |
200 | 20056 | Hsf Invoke Timeout | Hsf Invoke Timeout |
200 | 401 | Request Authorized Error | Request Authorized Error |
200 | 403 | Request Forbidden | Request Forbidden |
200 | 500 | Server Error | Server Error |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 500 | server error. | 系统错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 403 | request forbidden. | 请求被禁止 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 500 | server error. | 系统错误 |
200 | 500 | server error. | 系统错误 |
200 | 460 | request parameter error. | 请求参数错误 |
200 | 403 | request forbidden. | 请求被禁止 |