Mixiot API接口文档

1. 文档说明

本文档为Mixiot API 对外接口文档,提供第三方开发使用!

2. 修订记录

日期 文档版本 描述 修订
2021-05-18 v1.0 创建api文档 Mixlinker
2021-06-21 v1.1 新增tcp/websocket说明 Mixlinker
2021-06-28 v1.2 新增接口Token鉴权说明 Mixlinker

3. 接口规范

Mixiot API支持HTTP、TCP、Websocket等3种不同方式调用;HTTP为短连接,TCP和Websocket既可以短连接、也可以长连接。

特别地,HTTP、TCP、Websocket等方式的请求参数与响应参数是相同的。一般情况,只需用HTTP方式请求接口;特殊场景,则根据实际用TCP或Websocket方式。

其中,HTTP方式时参数请求头编码格式为Content-Type: application/json,请求方法为POST

3.1. 接口地址

Mixiot API接口地址为:域名 + 端口+ /apiproxy/api(TCP方式时无需/apiproxy/api);

域名以服务器实际部署为准,端口分别为31507(HTTP)31505(TCP)31503(Websocket)(TCP端口部署时默认不开放,实际需要请联系管理员!)。

  • 以xxx.mixiot.top 域名为例,接口地址如下:
调用方式 接口地址
HTTP http://xxx.mixiot.top:31507/apiproxy/api
TCP xxx.mixiot.top:31505
Websocket ws://xxx.mixiot.top:31503/apiproxy/api

3.2. 参数说明

Mixiot API请求参数和响应参数的数据格式为JSON格式,字符编码为UTF-8

3.2.1. 请求参数

参数名称 是否必选 数据类型 描述
action string 请求命令
actionid string 命令标识
... ... ... ...

请求参数包括action和actionid两个预定义参数,以及具体接口的自定义参数;预定义参数所有接口遵循,自定义参数以实际接口为准。其中:

  • action是必选参数,表示接口的请求命令,是Mixiot的接口方法(即接口地址);action命名通常为动词+名词(或只有动词),描述了接口含义;

  • actionid为非必选参数,是请求命令标识;每次请求接口时,请求方自定义发送actionid、接口将会原样返回actionid,以提供第三方区分不同请求进程。

示例如下:

{
    "action": "ping",
    "actionid": ""
}

3.2.2. 响应参数

参数名称 数据类型 描述
resp string 响应命令
actionid string 命令标识
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

响应参数是统一的返回格式,其中:

  • resp是响应命令(即响应接口方法),一般与请求的action一致

  • actionid是响应命令标识,请求时发送了什么、则响应时返回什么;

  • code是返回码,200表示请求成功、非200表示请求失败;

  • msg是提示信息,如成功(success)或失败(error);

  • info是详细信息,一般错误时的详细描述;

  • result是返回结果,具体的返回数据由接口定义(json格式)。

示例如下:

{
    "resp": "ping",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "pong": "mixlinker"
    }
}

3.3. 返回码

Mixiot API 返回码 200为请求成功、非200为请求失败,具体如下:

code 含义 备注
200 请求成功 请求正常
500 请求失败 参数错误或服务异常等,具体信息可以查看info说明
10401 请求失败 请求参数错误
10402 请求失败 鉴权错误,token过期或者没有token

3.4. 接口鉴权

Mixiot API使用Token方式鉴权,调用接口时需要发送Token。Token一般长度为288个字符,存储空间建议为512字符;Token有效期默认为2小时,需定时刷新。

3.5. 获取Token

Mixiot API通过登录接口(login)获取Token。

  • 请求参数
参数名称 是否必选 数据类型 数据约束 描述
action String login 请求命令
actionid String 命令标识
username string 登录账户
password string 登录密码

示例如下:

{
    "action": "login",
    "actionid": "",
    "username": "mixuser",
    "password": "xxxxxxxx"
}
  • 响应参数
参数名称 数据类型 描述
code int 返回码
msg string 提示消息
action string 响应命令
actionid string 命令标识
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 用户编号
permission_company_id string 所属组织编号,
username string 用户名称
head_image string 用户头像
description string 描述
mobile string 手机号码
email string 邮箱
is_active string 是否有效:1-是,0-否
is_super string 是否超级用户:1-是,0-否
is_default string 是否默认用户:1-是,0-否
created_at string 创建时间
updated_at string 更新时间
token string 令牌

示例如下:

{
    "code": 200,
    "msg": "success",
    "action": "login",
    "actionid": "",
    "result": {
        "id": 1001,
        "permission_company_id": 1001,
        "username": "mixuser",
        "head_image": "",
        "description": "智物联用户",
        "mobile": "1318888xxxx",
        "email": "mixuser@mixlinker.com",
        "is_active": 1,
        "is_super": 0,
        "is_default": 1,
        "created_at": "2021-01-01 14:17:22",
        "updated_at": "2021-06-23 10:40:33",
        "token": "N2EzMzU3NDMzMDU5MzAzNzUxNmU2ODZjNTM2OTJmNTQ0Mzc3NmEzNDZmN2E2ODQ4NmY2NTM0NTg0NjQ3NTEzMjUyMzQ0MjRjNDI0OTQ0Mzk2OTY2NmI0ZTUzNzI1ODM5NGQ3Nzc3Mzc3NTZjMzM2ZTMzMzU2MzY3NjU0MTZkNWE2ZTUyNTkzNjJmNGI1NDY3NmY3NTZiNDE1MzY4Njg2YjMxNzk0NTRjMzA2NjU2NzMyYjU5NDI3MDZhNGQ3MjU4NDE2ZjQ3NTU3NjM5NDQ3MzU3NzkzNDNk"
    }
}

3.6. 使用Token

  • HTTP方式

HTTP方式请求接口时,在Header请求头中发送:Authorization:Bearer ${token}

示例如下:

Authorization:Bearer N2EzMzU3NDMzMDU5MzAzNzUxNmU2ODZjNTM2OTJmNTQ0Mzc3NmEzNDZmN2E2ODQ4NmY2NTM0NTg0NjQ3NTEzMjUyMzQ0MjRjNDI0OTQ0Mzk2OTY2NmI0ZTUzNzI1ODM5NGQ3Nzc3Mzc3NTZjMzM2ZTMzMzU2MzY3NjU0MTZkNWE2ZTUyNTkzNjJmNGI1NDY3NmY3NTZiNDE1MzY4Njg2YjMxNzk0NTRjMzA2NjU2NzMyYjU5NDI3MDZhNGQ3MjU4NDE2ZjQ3NTU3NjM5NDQ3MzU3NzkzNDNk

其中,token有效期为2小时,失效后需要重新登录获取。

  • Websocket方式

Websocket方式请求接口时,客户端连接上服务器后,请求ping接口发送Token校验。

示例如下:

{
    "action": "ping",
    "Authorization": "Bearer N2EzMzU3NDMzMDU5MzAzNzUxNmU2ODZjNTM2OTJmNTQ0Mzc3NmEzNDZmN2E2ODQ4NmY2NTM0NTg0NjQ3NTEzMjUyMzQ0MjRjNDI0OTQ0Mzk2OTY2NmI0ZTUzNzI1ODM5NGQ3Nzc3Mzc3NTZjMzM2ZTMzMzU2MzY3NjU0MTZkNWE2ZTUyNTkzNjJmNGI1NDY3NmY3NTZiNDE1MzY4Njg2YjMxNzk0NTRjMzA2NjU2NzMyYjU5NDI3MDZhNGQ3MjU4NDE2ZjQ3NTU3NjM5NDQ3MzU3NzkzNDNk"
}

其中,token校验通过后,如果Websocket连接未断开则一直有效;如果Websocket断开则需要重新请求ping接口校验(注意token有效期为2小时,超时需重新获取)。

4. 快速入门

Mixiot API接口是简洁规范的。下面简单介绍几种工具,分别演示HTTP、TCP和Websocket等不同方式的接口调用。

4.1. 登录获取Token

通过登录接口(login) 获取token,提供其他接口使用。

登录获取Token图示

4.2. 请求实际接口

以请求响应接口(ping)为例:ping命令是请求响应接口,用来检测接口服务是否正常;当请求ping时,将会返回pong。

请求参数:

参数名称 是否必选 数据类型 数据约束 描述
action String ping 请求命令
actionid String 命令标识
message String 请求消息

响应参数:

参数名称 数据类型 描述
resp string 返回命令
actionid string 返回命令编号
code int 返回码
msg string 提示消息
info string 详细信息
result json 返回结果
+ pong string 响应消息

4.3. HTTP方式

HTTP测试在线地址:https://www.lddgo.net/network/httprequest

  • 请求头(Header)

http图示

  • 请求参数(Body)
http图示
Image - http图示

同时,你也可以下载postman客户端:https://www.postman.com/downloads/

  • 请求头(Header)

http图示

  • 请求参数(Body) http图示

4.4. Websocket方式

Websocket测试在线地址一:https://www.lddgo.net/network/websocket (支持wss方式)

  • 连接成功后,请求ping发送token鉴权

Websocket图示

Websocket测试在线地址二:http://coolaf.com/tool/chattest(支持ws方式)

  • 连接成功后,请求ping发送token鉴权

Websocket图示

4.5. TCP方式(暂未开放端口)

TCP测试在线地址:https://www.lddgo.net/network/tcp

tcp图示

5. 接口列表

5.1. 对象配置

5.1.1. 创建终端

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端唯一编号
name string 终端名称
description string 终端描述
type string 终端类型
maker string 终端制造商
config_id string 终端配置编号
mode string 检验模式
username string 用户名
pin string 密码
access string 访问权限
topic string 主题
server string gards服务器
session_expiry int 会话过期时间
keep_alive int 保活时间
encryption int 是否加密
dixie int 是否启用scram-sha-1高级鉴权
rsa_privatekey string rsa私钥
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回终端唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "create_terminal",
    "actionid": "12345",
    "uid": "AX2021063000101",
    "name": "AX101适配器",
    "description": "",
    "type": "Aprus-X",
    "maker": "智物联",
    "config_id": "CFG1212994600001",
    "mode": "pwd",
    "username": "test",
    "pin": "test",
    "access": "all",
    "topic": "all",
    "server": "192.168.0.132",
    "session_expiry": 120,
    "keep_alive": 30,
    "encryption": 0,
    "dixie": 1,
    "rsa_privatekey": "12345678",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "create_terminal",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "AX2021063000101"
    }
}

5.1.2. 更新终端

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端唯一编号
name string 终端名称
description string 终端描述
type string 终端类型
maker string 终端制造商
config_id string 终端配置编号
mode string 检验模式
username string 用户名
pin string 密码
access string 访问权限
topic string 主题
server string gards服务器
session_expiry int 会话过期时间
keep_alive int 保活时间
encryption int 是否加密
dixie int 是否启用scram-sha-1高级鉴权
rsa_privatekey string rsa私钥
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回终端唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "update_terminal",
    "actionid": "12345",
    "id": 1012,
    "uid": "AX2021063000101",
    "name": "AX1010适配器",
    "description": "",
    "type": "Aprus-X",
    "maker": "智物联",
    "config_id": "CFG1212994600001",
    "is_route": 1,
    "mode": "auto",
    "username": "test",
    "pin": "test",
    "access": "all",
    "topic": "all",
    "server": "192.168.0.132",
    "session_expiry": 120,
    "keep_alive": 30,
    "encryption": 0,
    "dixie": 1,
    "rsa_privatekey": "12345678",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "update_terminal",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "AX2021063000101"
    }
}

5.1.3. 删除终端

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回终端唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "delete_terminal",
    "actionid": "12345",
    "uid": "AX2021063000101"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "delete_terminal",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "AX2021063000101"
    }
}

5.1.4. 终端详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 终端唯一编号
name string 终端名称
description string 终端描述
type string 终端类型
maker string 终端制造商
config_id string 终端配置编号
mode string 检验模式
username string 用户名
pin string 密码
access string 访问权限
topic string 主题
server string gards服务器
session_expiry int 会话过期时间
keep_alive int 保活时间
encryption int 是否加密
dixie int 是否启用scram-sha-1高级鉴权
rsa_privatekey string rsa私钥
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更新人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_terminal_item",
    "actionid": "13454",
    "uid": "AX2021063000101"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_terminal_item",
    "actionid": "13454",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 1026,
        "uid": "AX2021063000101",
        "name": "AX101适配器",
        "description": "",
        "type": "Aprus-X",
        "maker": "智物联",
        "config_id": "TCF1233360400001",
        "mode": "pwd",
        "username": "test",
        "pin": "test",
        "access": "all",
        "topic": "all",
        "server": "192.168.0.132",
        "session_expiry": 120,
        "keep_alive": 30,
        "encryption": 1,
        "dixie": 1,
        "rsa_privatekey": "12345678",
        "terminal_object_map": null,
        "reference": "参考号123",
        "created": "2021-02-24 16:07:50",
        "created_by": 1,
        "last_modified": "2021-02-24 16:07:50",
        "last_modified_by": 1,
        "is_available": 1
    }
}

5.1.5. 终端列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uids []string 终端唯一编号列表,若存在,返回指定终端列表

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 终端唯一编号
name string 终端名称
description string 终端描述
type string 终端类型
maker string 终端制造商
config_id string 终端配置编号
mode string 检验模式
username string 用户名
pin string 密码
access string 访问权限
topic string 主题
server string gards服务器
session_expiry int 会话过期时间
keep_alive int 保活时间
encryption int 是否加密
dixie int 是否启用scram-sha-1高级鉴权
rsa_privatekey string rsa私钥
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更新人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_terminal_list",
    "actionid": "123",
    "uids": ["test", "test1"]
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_terminal_list",
    "actionid": "123",
    "code": 200,
    "msg": "成功",
    "result": [
        {
            "id": 1022,
            "uid": "AX2021081800007",
            "name": "AX007适配器",
            "description": "",
            "type": "Aprus-X",
            "maker": "智物联",
            "config_id": "TCF1233360400001",
            "mode": "pwd",
            "username": "test",
            "pin": "test",
            "access": "all",
            "topic": "all",
            "server": "192.168.0.132",
            "session_expiry": 120,
            "keep_alive": 30,
            "encryption": 1,
            "dixie": 1,
            "rsa_privatekey": "12345678",
            "terminal_object_map": null,
            "reference": "参考号123",
            "created": "2021-02-23 17:55:54",
            "created_by": 1,
            "last_modified": "2021-02-23 17:55:54",
            "last_modified_by": 1,
            "is_available": 1
        }
    ]
}

5.1.6. 创建终端配置

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
name string 终端配置名称
description string 终端配置描述信息
hardware string 终端硬件信息
mcu_file string mcu文件
mcu_version string mcu版本
remosu_file string remosu文件
remosu_version string remosu版本
lua_file string lua文件
lua_version string lua版本
terminal_script string 终端脚本
config_script string 配置脚本
reference string 参考号
created_by int 创建人
last_modified_by int 更改人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回终端配置唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "create_terminal_config",
    "actionid": "1233445",
    "name": "config1",
    "description": "config number 1",
    "hardware": "arm",
    "mcu_file": "/var/image/default",
    "mcu_version": "v1.0.0",
    "remosu_file": "var/image/default",
    "remosu_version": "v1.0.0",
    "lua_file": "var/image/default",
    "lua_version": "v1.0.0",
    "terminal_script": "{\"alt\": 1}",
    "config_script": "{\"alt\": 1}",
    "reference": "参考号123",
    "created": "2020/9/28 14:44:1",
    "created_by": 1,
    "last_modified": "2020/9/28 14:44:1",
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "create_terminal_config",
    "actionid": "1233445",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TCF1324495600002"
    }
}

5.1.7. 更新终端配置

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端配置唯一编号
name string 终端配置名称
description string 终端配置描述信息
hardware string 终端硬件信息
mcu_file string mcu文件
mcu_version string mcu版本
remosu_file string remosu文件
remosu_version string remosu版本
lua_file string lua文件
lua_version string lua版本
terminal_script string 终端脚本
config_script string 配置脚本
reference string 参考号
created_by int 创建人
last_modified_by int 更改人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回终端配置唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "update_terminal_config",
    "actionid": "1233445",
    "uid": "TCF1324495600002",
    "name": "config2",
    "description": "config number 2",
    "hardware": "arm",
    "mcu_file": "/var/image/default",
    "mcu_version": "v1.0.0",
    "remosu_file": "var/image/default",
    "remosu_version": "v1.0.0",
    "lua_file": "var/image/default",
    "lua_version": "v1.0.0",
    "terminal_script": "{\"alt\": 1}",
    "config_script": "{\"alt\": 1}",
    "reference": "参考号123",
    "created": "2020/9/28 14:44:1",
    "created_by": 1,
    "last_modified": "2020/9/28 14:44:1",
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "update_terminal_config",
    "actionid": "1233445",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TCF1324495600002"
    }
}

5.1.8. 删除终端配置

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端配置唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回终端配置唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "delete_terminal_config",
    "actionid": "1234",
    "uid": "TCF1324495600002"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "delete_terminal_config",
    "actionid": "1234",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TCF1324495600002"
    }
}

5.1.9. 终端配置详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 终端配置唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 终端配置唯一编号
name string 终端配置名称
description string 终端配置描述信息
hardware string 终端硬件信息
mcu_file string mcu文件
mcu_version string mcu版本
remosu_file string remosu文件
remosu_version string remosu版本
lua_file string lua文件
lua_version string lua版本
terminal_script object 终端脚本
config_script object 配置脚本
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更改人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_terminal_config_item",
    "actionid": "12345",
    "uid": "TCF1245422100001"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_terminal_config_item",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 1008,
        "uid": "TCF1245422100001",
        "name": "config1",
        "description": "config number 1",
        "hardware": "arm",
        "mcu_file": "/var/image/default",
        "mcu_version": "v1.0.0",
        "remosu_file": "var/image/default",
        "remosu_version": "v1.0.0",
        "lua_file": "var/image/default",
        "lua_version": "v1.0.0",
        "terminal_script": {
            "alt": 1
        },
        "config_script": {
            "alt": 1
        },
        "reference": "参考号123",
        "created": "2021-02-24 16:07:54",
        "created_by": 1,
        "last_modified": "2021-02-24 16:07:54",
        "last_modified_by": 1,
        "is_available": 1
    }
}

5.1.10. 终端配置列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 终端配置唯一编号
name string 终端配置名称
description string 终端配置描述信息
hardware string 终端硬件信息
mcu_file string mcu文件
mcu_version string mcu版本
remosu_file string remosu文件
remosu_version string remosu版本
lua_file string lua文件
lua_version string lua版本
terminal_script object 终端脚本
config_script object 配置脚本
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更改人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
   "action": "get_terminal_config_list",
    "actionid": "123454"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_terminal_config_list",
    "actionid": "123454",
    "code": 200,
    "msg": "成功",
    "result": [
        {
            "id": 1007,
            "uid": "TCF1233360400001",
            "name": "config1",
            "description": "config number 1",
            "hardware": "arm",
            "mcu_file": "/var/image/default",
            "mcu_version": "v1.0.0",
            "remosu_file": "var/image/default",
            "remosu_version": "v1.0.0",
            "lua_file": "var/image/default",
            "lua_version": "v1.0.0",
            "terminal_script": {
                "alt": 1
            },
            "config_script": {
                "alt": 1
            },
            "reference": "参考号123",
            "created": "2021-02-23 15:22:34",
            "created_by": 1,
            "last_modified": "2021-02-23 15:22:34",
            "last_modified_by": 1,
            "is_available": 1
        }
    ]
}

5.1.11. 创建映射表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
name string 映射表名称
description string 映射表描述
script string 映射表脚本
addition string 附加信息
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回映射表唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "create_mapping",
    "actionid": "123454",
    "name": "mapping1",
    "description": "mapping number 1",
    "script": "[[\"v1\", \"\", \"STA变量-相对适配器\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"\", \"\"], [\"v2\", \"\", \"STA变量-相对适配器\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"v1+10\", \"\"], [\"v3\", \"\", \"STA变量-固定适配器\", \"STA\", \"AX20210229000249.L1_3_7_2\", \"v2+10\", \"\"], [\"v4\", \"\", \"离线推送\", \"STA\", \"$CollectID-1.Tem\", \"Tem+20\", \"\"], [\"v5\", \"\", \"离线推送\", \"STA\", \"COL12236500002.Tem\", \"Tem+5\", \"\"], [\"v6\", \"\", \"函数计算\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"min(v1, v2)\", \"\"], [\"v7\", \"\", \"比较运算\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"v1>v2?v1:v2\", \"\"], [\"1001\", \"start event\", \"开始事件\", \"EVNT\", \"$AprusID-1.L1_3_7_2\", \"\", \"v1==0\"], [\"1002\", \"stop event\", \"停止事件\", \"EVNT\", \"$AprusID-1.L1_3_7_2\", \"\", \"v1==1\"]]",
    "addition": "{\"id\":1}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "create_mapping",
    "actionid": "123454",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MAP1324472700003"
    }
}

5.1.12. 更新映射表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 映射表唯一编号
name string 映射表名称
description string 映射表描述
script string 映射表脚本
addition string 附加信息
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回映射表唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "update_mapping",
    "actionid": "123454",
    "uid": "MAP1324472700003",
    "name": "mapping1",
    "description": "mapping number 1",
    "script": "[[\"v1\", \"\", \"STA变量-相对适配器\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"\", \"\"], [\"v2\", \"\", \"STA变量-相对适配器\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"v1+10\", \"\"], [\"v3\", \"\", \"STA变量-固定适配器\", \"STA\", \"AX20210229000249.L1_3_7_2\", \"v2+10\", \"\"], [\"v4\", \"\", \"离线推送\", \"STA\", \"$CollectID-1.Tem\", \"Tem+20\", \"\"], [\"v5\", \"\", \"离线推送\", \"STA\", \"COL12236500002.Tem\", \"Tem+5\", \"\"], [\"v6\", \"\", \"函数计算\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"min(v1, v2)\", \"\"], [\"v7\", \"\", \"比较运算\", \"STA\", \"$AprusID-1.L1_3_7_2\", \"v1>v2?v1:v2\", \"\"], [\"1001\", \"start event\", \"开始事件\", \"EVNT\", \"$AprusID-1.L1_3_7_2\", \"\", \"v1==0\"], [\"1002\", \"stop event\", \"停止事件\", \"EVNT\", \"$AprusID-1.L1_3_7_2\", \"\", \"v1==1\"]]",
    "addition": "{\"id\":1}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "update_mapping",
    "actionid": "123454",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MAP1324472700003"
    }
}

5.1.13. 删除映射表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 映射表唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回映射表唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "delete_mapping",
    "actionid": "123456",
    "uid": "MAP1324472700003"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "delete_mapping",
    "actionid": "123456",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MAP1324472700003"
    }
}

5.1.14. 映射表详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 映射表唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
action string 指令
actionid string 指令编号
uid string 映射表唯一编号
name string 映射表名称
description string 映射表描述
script []array 映射表脚本
addition []object 附加信息
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新人
last_modified_by int 更新人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_mapping_item",
    "actionid": "12345",
    "uid": "MAP1212994600001"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_mapping_item",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 1020,
        "uid": "MAP1212994600001",
        "name": "mapping",
        "description": "mapping number 1",
        "script": [
            [
                "v1",
                "",
                "STA变量-相对适配器",
                "STA",
                "$AprusID-1.L1_3_7_2",
                "",
                ""
            ],
            [
                "v2",
                "",
                "STA变量-相对适配器",
                "STA",
                "$AprusID-1.L1_3_7_2",
                "v1+10",
                ""
            ],
            [
                "1001",
                "start event",
                "开始事件",
                "EVNT",
                "$AprusID-1.L1_3_7_2",
                "",
                "v1==0"
            ],
            [
                "1002",
                "stop event",
                "停止事件",
                "EVNT",
                "$AprusID-1.L1_3_7_2",
                "",
                "v1==1"
            ]
        ],
        "addition": [
            {
                "data": [
                    [
                        "a",
                        ""
                    ],
                    [
                        "b",
                        ""
                    ]
                ],
                "title": "扩展信息1"
            }
        ],
        "reference": "参考号123",
        "created": "2021-02-21 14:13:30",
        "created_by": 1,
        "last_modified": "2021-03-25 14:51:53",
        "last_modified_by": 1,
        "is_available": 1
    }
}

5.1.15. 映射表列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
action string 指令
actionid string 指令编号
uid string 映射表唯一编号
name string 映射表名称
description string 映射表描述
script []array 映射表脚本
addition []object 附加信息
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新人
last_modified_by int 更新人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_mapping_list",
    "actionid": "12345"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_mapping_list",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": [
        {
            "id": 1020,
            "uid": "MAP1212994600001",
            "name": "mapping",
            "description": "mapping number 1",
            "script": [
                [
                    "v1",
                    "",
                    "STA变量-相对适配器",
                    "STA",
                    "$AprusID-1.L1_3_7_2",
                    "",
                    ""
                ],
                [
                    "v2",
                    "",
                    "STA变量-相对适配器",
                    "STA",
                    "$AprusID-1.L1_3_7_2",
                    "v1+10",
                    ""
                ],
                [
                    "1001",
                    "start event",
                    "开始事件",
                    "EVNT",
                    "$AprusID-1.L1_3_7_2",
                    "",
                    "v1==0"
                ],
                [
                    "1002",
                    "stop event",
                    "停止事件",
                    "EVNT",
                    "$AprusID-1.L1_3_7_2",
                    "",
                    "v1==1"
                ]
            ],
            "addition": [
                {
                    "data": [
                        [
                            "a",
                            ""
                        ],
                        [
                            "b",
                            ""
                        ]
                    ],
                    "title": "扩展信息1"
                }
            ],
            "reference": "参考号123",
            "created": "2021-02-21 14:13:30",
            "created_by": 1,
            "last_modified": "2021-03-25 14:51:53",
            "last_modified_by": 1,
            "is_available": 1
        }
    ]
}

5.1.16. 创建对象

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
name string 对象名称
description string 对象描述
image string 图片路径
province string 省份
city string 城市/地区
mapping_id string 映射表编号
control_id string 控制码编号
customer_id string 客户编号
terminal_list []string 终端列表
object_list []string 对象列表
collect_list []string 离线列表
tag []string 标签列表
model string 型号
serial_no string 序列号
gis string 位置信息
secret string 关注密码
control string 控制代码
addition string 附加信息
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回对象唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "create_object",
    "actionid": "",
    "name": "object1",
    "description": "temperature object",
    "image": "/var/image/default.png",
    "province": "广东省",
    "city": "深圳市",
    "mapping_id": "MAP1212994600001",
    "control_id": "CTL1212994600001",
    "customer_id": "CST18317192300735",
    "terminal_list": ["test","test1"],
    "object_list": [],
    "collect_list": ["test","test1"],
    "tag": ["test","test1"],
    "model": "model1",
    "serial_no": "1234566778999999",
    "gis": "",
    "secret": "1234567887654321",
    "control": "1234567887654321",
    "addition": "{\"id\":1}",
    "reference": "123456",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "create_object",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "OBJ1321207800001"
    }
}

5.1.17. 更新对象

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 对象唯一编号
name string 对象名称
description string 对象描述
image string 图片路径
province string 省份
city string 城市/地区
mapping_id string 映射表编号
control_id string 控制码编号
customer_id string 客户编号
terminal_list []string 终端列表
object_list []string 对象列表
collect_list []string 离线列表
tag []string 标签列表
model string 型号
serial_no string 序列号
gis string 位置信息
secret string 关注密码
control string 控制代码
addition string 附加信息
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回对象唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "update_object",
    "actionid": "",
    "id": 1001,
    "uid": "OBJ1321207800001",
    "name": "object1",
    "description": "temperature object",
    "image": "/var/image/default.png",
    "province": "广东省",
    "city": "深圳市",
    "mapping_id": "MAP1212994600001",
    "control_id": "CTL1212994600001",
    "customer_id": "CST18317192300735",
    "terminal_list": ["test","test1"],
    "object_list": [],
    "collect_list": ["test","test1"],
    "tag": ["test","test1"],
    "model": "model1",
    "serial_no": "1234566778999999",
    "gis": "深圳南山区",
    "secret": "1234567887654321",
    "control": "1234567887654321",
    "addition": "{\"id\":1}",
    "reference": "123456",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "update_object",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "OBJ1321207800001"
    }
}

5.1.18. 删除对象

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 对象唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回对象唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "delete_object",
    "actionid": "123",
    "uid": "OBJ1321207800001"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "delete_object",
    "actionid": "123",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "OBJ1321207800001"
    }
}

5.1.19. 对象详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 对象唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

响应参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 对象唯一编号
name string 对象名称
description string 对象描述
image string 图片路径
province string 省份
city string 城市/地区
mapping_id string 映射表编号
control_id string 控制码编号
terminal_list []string 终端列表
object_list []string 对象列表
collect_list []string 离线列表
tag []string 标签列表
model string 型号
serial_no string 序列号
gis string 位置信息
secret string 关注密码
control string 控制代码
addition object 附加信息
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更新人
is_available int 是否生效
is_boot int 是否启动
object_fv_map object 对象的fv映射关系

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_object_item",
    "actionid": "123",
    "uid": "OBJ1310573400002"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_object_item",
    "actionid": "123",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 1047,
        "uid": "OBJ1310573400002",
        "name": "object1",
        "description": "temperature object",
        "image": "/var/image/default.png",
        "province": "广东省",
        "city": "深圳市",
        "mapping_id": "MAP1212994600001",
        "control_id": "CTL1212994600001",
        "terminal_list": [
            "test",
            "test1"
        ],
        "object_list": [],
        "collect_list": [
            "test",
            "test1"
        ],
        "tag": [
            "test",
            "test1"
        ],
        "model": "model1",
        "serial_no": "1234566778999999",
        "gis": "深圳南山区",
        "secret": "1234567887654321",
        "control": "1234567887654321",
        "addition": {
            "id": 1
        },
        "reference": "123456",
        "created": "2021-03-11 17:10:06",
        "created_by": 1,
        "last_modified": "2021-03-11 17:10:06",
        "last_modified_by": 1,
        "is_available": 1,
        "is_online": 0,
        "is_boot": 0,
        "is_retainer": 0,
        "object_fv_map": {
            "OBJ1310573400002": [
                {
                    "object_id": "OBJ1310573400002",
                    "fv": "v1",
                    "label_en": "",
                    "label_local": "STA变量-相对适配器",
                    "category": "STA",
                    "datasource": "test.L1_3_7_2",
                    "logic_expr1": "",
                    "logic_expr2": "return true"
                },
                {
                    "object_id": "OBJ1310573400002",
                    "fv": "v2",
                    "label_en": "",
                    "label_local": "STA变量-相对适配器",
                    "category": "STA",
                    "datasource": "test.L1_3_7_2",
                    "logic_expr1": "return varlist.v1+10",
                    "logic_expr2": ""
                },
                {
                    "object_id": "OBJ1310573400002",
                    "fv": "1001",
                    "label_en": "start event",
                    "label_local": "开始事件",
                    "category": "EVNT",
                    "datasource": "test.L1_3_7_2",
                    "logic_expr1": "",
                    "logic_expr2": "if (varlist.v1==0) {return true} else {return false}"
                },
                {
                    "object_id": "OBJ1310573400002",
                    "fv": "1002",
                    "label_en": "stop event",
                    "label_local": "停止事件",
                    "category": "EVNT",
                    "datasource": "test.L1_3_7_2",
                    "logic_expr1": "",
                    "logic_expr2": "if (varlist.v1==1) {return true} else {return false}"
                }
            ]
        }
    }
}

5.1.20. 对象列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uids []string 对象编号列表,若存在,则返回指定对象编号列表的对象

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

响应参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 对象唯一编号
name string 对象名称
description string 对象描述
image string 图片路径
province string 省份
city string 城市/地区
mapping_id string 映射表编号
control_id string 控制码编号
terminal_list []string 终端列表
object_list []string 对象列表
collect_list []string 离线列表
tag []string 标签列表
model string 型号
serial_no string 序列号
gis string 位置信息
secret string 关注密码
control string 控制代码
addition object 附加信息
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更新人
is_available int 是否生效
is_boot int 是否启动
object_fv_map object 对象的fv映射关系

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_object_list",
    "actionid": "1234",
    "uids": ["OBJ1343732600001", "OBJ1312304800002"]
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_object_list",
    "actionid": "1234",
    "code": 200,
    "msg": "成功",
    "result": [
        {
            "id": 1028,
            "uid": "OBJ1343732600001",
            "name": "object1",
            "description": "temperature object",
            "image": "/var/image/default.png",
            "province": "广东省",
            "city": "深圳市",
            "mapping_id": "MAP1352825300001",
            "control_id": "CTL1212994600001",
            "terminal_list": [
                "test",
                "test1"
            ],
            "object_list": [
                "OBJ1343732600001"
            ],
            "collect_list": [
                "test",
                "test1"
            ],
            "tag": [
                "test",
                "test1"
            ],
            "model": "model1",
            "serial_no": "1234566778999999",
            "gis": "深圳南山区",
            "secret": "1234567887654321",
            "control": "1234567887654321",
            "addition": {
                "id": 1
            },
            "reference": "123456",
            "created": "2021-03-04 11:50:37",
            "created_by": 1,
            "last_modified": "2021-03-04 11:50:37",
            "last_modified_by": 1,
            "is_available": 1,
            "is_online": 0,
            "is_boot": 0,
            "is_retainer": 0,
            "object_fv_map": {
                "OBJ1343732600001": [
                    {
                        "object_id": "OBJ1343732600001",
                        "fv": "v1",
                        "label_en": "",
                        "label_local": "STA变量-相对适配器",
                        "category": "STA",
                        "datasource": "test.L1_3_7_2",
                        "logic_expr1": "",
                        "logic_expr2": "return true"
                    },
                    {
                        "object_id": "OBJ1343732600001",
                        "fv": "v2",
                        "label_en": "",
                        "label_local": "STA变量-相对适配器",
                        "category": "STA",
                        "datasource": "test.L1_3_7_2",
                        "logic_expr1": "return varlist.v1+10",
                        "logic_expr2": ""
                    },
                    {
                        "object_id": "OBJ1343732600001",
                        "fv": "1001",
                        "label_en": "start event",
                        "label_local": "开始事件",
                        "category": "EVNT",
                        "datasource": "test.L1_3_7_2",
                        "logic_expr1": "",
                        "logic_expr2": "if (varlist.v1==0) {return true} else {return false}"
                    },
                    {
                        "object_id": "OBJ1343732600001",
                        "fv": "1002",
                        "label_en": "stop event",
                        "label_local": "停止事件",
                        "category": "EVNT",
                        "datasource": "test.L1_3_7_2",
                        "logic_expr1": "",
                        "logic_expr2": "if (varlist.v1==1) {return true} else {return false}"
                    }
                ]
            }
        }
    ]
}

5.1.21. 查询指定映射表对应的对象编号列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
mapping_id string 映射表编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_objectids_by_mappingid",
    "mapping_id": "MAP1212994600001"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_objectids_by_mappingid",
    "code": 200,
    "msg": "成功",
    "result": [
        "OBJ1243475500001",
        "OBJ1312304800002",
        "OBJ1315157900003",
        "OBJ1315925700001",
        "OBJ1315495000001",
        "OBJ1310573400002"
    ]
}

5.1.22. 查询指定离线编号对应的对象编号列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
collect_id string 离线类型编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_objectids_by_collectid",
    "collect_id": "COL1212994600001"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_objectids_by_collectid",
    "code": 200,
    "msg": "成功",
    "result": [
        "OBJ1243475500001",
        "OBJ1312304800002",
        "OBJ1315157900003",
        "OBJ1315925700001",
        "OBJ1315495000001",
        "OBJ1310573400002"
    ]
}

5.1.23. 创建控制表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
name string 控制码编号
description string 控制码描述
script string 控制码脚本
template string 控制码模板
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回控制码唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "create_control",
    "actionid": "123455",
    "name": "control1",
    "description": "control number 1",
    "script": "[[\"S001\",\"\",\"模拟变量1\",\"OBJ\",\"$AprusID-1.L1_3_8\",\"\"],[\"S002\",\"\",\"模拟变量2\",\"OBJ\",\"$AprusID-1.L1_3_9\",\"\"],[\"AXUpgrade\",\"Aprus Upgrade\",\"适配器升级\",\"APR\",\"$AprusID-1\",\"LUA\"]]",
    "template": "{\"id\":1}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "create_control",
    "actionid": "123455",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CTL1322264700004"
    }
}

5.1.24. 更新控制表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 控制码唯一编号
name string 控制码编号
description string 控制码描述
script string 控制码脚本
template string 控制码模板
reference string 参考号
created_by int 创建人
last_modified_by int 更新人
is_available int 是否生效

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回控制码唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "update_control",
    "actionid": "123455",
    "uid": "CTL1322264700004",
    "name": "control2",
    "description": "control number 2",
    "script": "[[\"S001\",\"\",\"模拟变量1\",\"OBJ\",\"$AprusID-1.L1_3_8\",\"\"],[\"S002\",\"\",\"模拟变量2\",\"OBJ\",\"$AprusID-1.L1_3_9\",\"\"],[\"AXUpgrade\",\"Aprus Upgrade\",\"适配器升级\",\"APR\",\"$AprusID-1\",\"LUA\"]]",
    "template": "{\"id\":1}",
    "reference": "参考号123",
    "created_by": 1,
    "last_modified_by": 1,
    "is_available": 1
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "update_control",
    "actionid": "123455",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CTL1322264700004"
    }
}

5.1.25. 删除控制表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 控制码唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回控制码唯一编号

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "delete_control",
    "actionid": "12345",
    "uid": "CTL1322264700004"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "delete_control",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CTL1322264700004"
    }
}

5.1.26. 控制表详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 控制码唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
action string 指令
actionid string 指令编号
uid string 控制码唯一编号
name string 控制码编号
description string 控制码描述
script []array 控制码脚本
template object 控制码模板
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更新人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_control_item",
    "actionid": "123456",
    "uid": "CTL1322264700004"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_control_item",
    "actionid": "123456",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 1006,
        "uid": "CTL1235832900001",
        "name": "control1",
        "description": "control number 1",
        "script": [
            [
                "S001",
                "",
                "模拟变量1",
                "OBJ",
                "$AprusID-1.L1_3_8",
                ""
            ],
            [
                "S002",
                "",
                "模拟变量2",
                "OBJ",
                "$AprusID-1.L1_3_9",
                ""
            ],
            [
                "AXUpgrade",
                "Aprus Upgrade",
                "适配器升级",
                "APR",
                "$AprusID-1",
                "LUA"
            ]
        ],
        "template": {
            "id": 1
        },
        "reference": "参考号123",
        "created": "2021-02-23 15:07:58",
        "created_by": 1,
        "last_modified": "2021-02-23 15:07:58",
        "last_modified_by": 1,
        "is_available": 1
    }
}

5.1.27. 控制表列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
action string 指令
actionid string 指令编号
uid string 控制码唯一编号
name string 控制码编号
description string 控制码描述
script []array 控制码脚本
template object 控制码模板
reference string 参考号
created string 创建时间
created_by int 创建人
last_modified string 更新时间
last_modified_by int 更新人
is_available int 是否生效

请求示例:

curl -H "Content-Type: application/json" -X POST -d '{
    "action": "get_control_list",
    "actionid": "12345"
}' http://xxx.mixiot.top:31507/apiproxy/api

响应示例:

{
    "resp": "get_control_list",
    "actionid": "12345",
    "code": 200,
    "msg": "成功",
    "result": [
        {
            "id": 1006,
            "uid": "CTL1235832900001",
            "name": "control1",
            "description": "control number 1",
            "script": [
                [
                    "S001",
                    "",
                    "模拟变量1",
                    "OBJ",
                    "$AprusID-1.L1_3_8",
                    ""
                ],
                [
                    "S002",
                    "",
                    "模拟变量2",
                    "OBJ",
                    "$AprusID-1.L1_3_9",
                    ""
                ],
                [
                    "AXUpgrade",
                    "Aprus Upgrade",
                    "适配器升级",
                    "APR",
                    "$AprusID-1",
                    "LUA"
                ]
            ],
            "template": {
                "id": 1
            },
            "reference": "参考号123",
            "created": "2021-02-23 15:07:58",
            "created_by": 1,
            "last_modified": "2021-02-23 15:07:58",
            "last_modified_by": 1,
            "is_available": 1
        }
    ]
}

5.1.28. 创建显示板

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 显示板唯一编号,不填则系统自动生成
name string 显示板名称
description string 描述
type string 显示板类型:pro/app/show/mixmanager
script json 显示板脚本

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回唯一编号

请求示例:

{

    "action": "create_dashboard",
    "uid": "",
    "name": "demo",
    "type": "pro",
    "description": "",
    "script": {}
}

响应示例:

{
    "resp": "create_dashboard",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 784,
        "uid": "DSH18915071400784",
        "name": "demo",
        "type": "pro",
        "description": "",
        "script": [],
        "created": "2021-08-19 15:07:14",
        "last_modified": "2021-08-19 15:07:14"
    }
}

5.1.29. 更新显示板

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
id int 表自增编号
uid string 显示板唯一编号
name string 显示板名称
description string 描述
type string 显示板类型:pro/app/show/mixmanager
script json 显示板脚本

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 唯一编号

请求示例:

{
    "action": "update_dashboard",
    "id": 782,
    "uid": "DSH18915024700782",
    "name": "demo",
    "type": "pro",
    "description": "无",
    "script": {}
}

响应示例:

{
    "resp": "update_dashboard",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 784,
        "uid": "DSH18915071400784",
        "name": "demo",
        "type": "pro",
        "description": "",
        "script": [],
        "created": "2021-08-19 15:07:14",
        "last_modified": "2021-08-19 15:07:14",
        "is_available": 1,
    }
}

5.1.30. 删除显示板

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 唯一编号

请求示例:

{
    "action": "delete_dashboard",
    "uid": "DSH18915071400784"
}

响应示例:

{
    "resp": "delete_dashboard",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 784,
        "uid": "DSH18915071400784",
        "name": "demo",
        "type": "pro",
        "description": "",
        "script": [],
        "created": "2021-08-19 15:07:14",
        "last_modified": "2021-08-19 15:07:14",
        "is_available": 1,
    }
}

5.1.31. 获取显示板详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 显示板唯一编号
name string 显示板名称
description string 描述
type string 显示板类型:pro/app/show/mixmanager
script json 显示板脚本
object_list json 绑定对象列表
created int 创建时间
last_modified int 更新时间
is_available int 是否有效

请求示例:

{
    "action": "get_dashboard_item",
    "uid": "DSH18915024700782"
}

响应示例:

{
    "resp": "get_dashboard_item",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 784,
        "uid": "DSH18915071400784",
        "name": "demo",
        "type": "pro",
        "description": "",
        "script": [],
         "object_list": [
            "demo",
            "demo0819"
        ],
        "created": "2021-08-19 15:07:14",
        "last_modified": "2021-08-19 15:07:14",
        "is_available": 1,
    }
}

5.1.32. 获取显示板列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
page_index int 页数
page_size int 每页数量
where_and json and查询条件
where_or json or查询条件时间
where_in json in查询条件

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 显示板唯一编号
name string 显示板名称
description string 描述
type string 显示板类型:pro/app/show/mixmanager
script json 显示板脚本
object_list json 绑定对象列表
created int 创建时间
last_modified int 更新时间
is_available int 是否有效

请求示例:

{
    "action": "get_dashboard_list",
    "page_index": 1,
    "page_size": 1,
    "where_and": [["name","like","%demo%"]],
    "where_or": [["name","like","%demo%"]]
}

响应示例:

{
    "resp": "get_dashboard_list",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "data": [
            {
                "id": 784,
                "uid": "DSH18915071400784",
                "name": "demo",
                "type": "pro",
                "description": "",
                "script": [],
                "object_list": [
                    "demo",
                    "demo0819"
                ],
                "created": "2021-08-19 15:07:14",
                "last_modified": "2021-08-19 15:07:14",
                "is_available": 1,
            }
        ],
        "page_index": 1,
        "page_size": 1,
        "total_pages": 3,
        "total_records": 3
    }
}

5.1.33. 对象绑定显示板

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
object_id string 对象编号uid
dashboard_id json 显示板编号列表:["demo"]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "bind_object_dashboard",
    "object_id":"demo",
    "dashboard_id": ["DSH18915024700782"]
}

响应示例:

{
    "resp": "bind_object_dashboard",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {}
}

5.1.34. 创建客户

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 客户唯一编号,不填则系统自动生成
name string 客户名称
description string 描述
email string 电子邮箱
contact string 联系人
mobile string 手机号码
phone string 电话号码
province string 省份
city string 城市
address string 详细地址
secret string 授权码,不填则系统生成
responsible string 责任人
responsible_phone string 责任人电话

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 返回唯一编号

请求示例:

{
    "action": "create_customer",
    "uid": "",
    "name": "mixlinker",
    "description": "无",
    "email": "mix@mixlinker.com",
    "contact": "mix",
    "mobile": "13800138000",
    "phone": "075523746592",
    "province": "广东省",
    "city": "深圳市",
    "address": "",
    "secret": "",
    "responsible": "mix",
    "responsible_phone": ""
}

响应示例:

{
    "resp": "create_customer",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 744,
        "uid": "CST18414161600744",
        "name": "mixlinker",
        "description": "无",
        "email": "mix@mixlinker.com",
        "contact": "mix",
        "mobile": "13800138000",
        "phone": "075523746592",
        "province": "广东省",
        "city": "深圳市",
        "address": "无",
        "secret": "mO3V",
        "responsible": "mix",
        "responsible_phone": "",
        "reference": "",
        "created": "2021-08-24 14:16:16",
        "last_modified": "2021-08-24 14:16:16"
    }
}

5.1.35. 更新客户

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
id int 表自增编号
uid string 客户唯一编号
name string 客户名称
description string 描述
email string 电子邮箱
contact string 联系人
mobile string 手机号码
phone string 电话号码
province string 省份
city string 城市
address string 详细地址
secret string 授权码
responsible string 责任人
responsible_phone string 责任人电话

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 唯一编号

请求示例:

{
    "action": "update_customer",
    "id": 744,
    "uid": "CST18414161600744",
    "name": "mixlinker",
    "description": "无",
    "email": "mix@mixlinker.com",
    "contact": "mix",
    "mobile": "13800138000",
    "phone": "075523746592",
    "province": "广东省",
    "city": "深圳市",
    "address": "",
    "secret": "",
    "responsible": "mix",
    "responsible_phone": ""
}

响应示例:

{
    "resp": "update_customer",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 744,
        "uid": "CST18414161600744",
        "name": "mixlinker",
        "description": "无",
        "email": "mix@mixlinker.com",
        "contact": "mix",
        "mobile": "13800138000",
        "phone": "075523746592",
        "province": "广东省",
        "city": "深圳市",
        "address": "无",
        "secret": "mO3V",
        "responsible": "mix",
        "responsible_phone": "",
        "reference": "",
        "created": "2021-08-24 14:16:16",
        "last_modified": "2021-08-24 14:16:16"
    }
}

5.1.36. 删除客户

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
uid string 唯一编号

请求示例:

{
    "action": "delete_customer",
    "uid": "CST18414161600744"
}

响应示例:

{
    "resp": "delete_customer",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 744,
        "uid": "CST18414161600744",
        "name": "mixlinker",
        "description": "无",
        "email": "mix@mixlinker.com",
        "contact": "mix",
        "mobile": "13800138000",
        "phone": "075523746592",
        "province": "广东省",
        "city": "深圳市",
        "address": "无",
        "secret": "mO3V",
        "responsible": "mix",
        "responsible_phone": "",
        "reference": "",
        "created": "2021-08-24 14:16:16",
        "last_modified": "2021-08-24 14:16:16"
    }
}

5.1.37. 获取客户详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid string 唯一编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 客户唯一编号
name string 客户名称
description string 描述
email string 电子邮箱
contact string 联系人
mobile string 手机号码
phone string 电话号码
province string 省份
city string 城市
address string 详细地址
secret string 授权码
responsible string 责任人
responsible_phone string 责任人电话
created int 创建时间
last_modified int 更新时间
is_available int 是否有效

请求示例:

{
    "action": "get_customer_item",
    "uid": "CST18414161600744"
}

响应示例:

{
    "resp": "get_customer_item",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "id": 744,
        "uid": "CST18414161600744",
        "name": "mixlinker",
        "description": "无",
        "email": "mix@mixlinker.com",
        "contact": "mix",
        "mobile": "13800138000",
        "phone": "075523746592",
        "province": "广东省",
        "city": "深圳市",
        "address": "无",
        "secret": "mO3V",
        "responsible": "mix",
        "responsible_phone": "",
        "reference": "",
        "created": "2021-08-24 14:16:16",
        "last_modified": "2021-08-24 14:16:16"
    }
}

5.1.38. 获取客户列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
page_index int 页数
page_size int 每页数量
where_and json and查询条件
where_or json or查询条件时间
where_in json in查询条件

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

result参数字段:

参数名称 数据类型 描述
id int 表自增编号
uid string 客户唯一编号
name string 客户名称
description string 描述
email string 电子邮箱
contact string 联系人
mobile string 手机号码
phone string 电话号码
province string 省份
city string 城市
address string 详细地址
secret string 授权码
responsible string 责任人
responsible_phone string 责任人电话
created int 创建时间
last_modified int 更新时间
is_available int 是否有效

请求示例:

{
    "action": "get_customer_list",
    "page_index": 1,
    "page_size": 1,
    "where_and": [["name","like","%mix%"]],
    "where_or": [["name","like","%%"]]
}

响应示例:

{
    "resp": "get_customer_list",
    "actionid": "",
    "code": 200,
    "msg": "success",
    "info": "success",
    "result": {
        "data": [
            {
                "id": 744,
                "uid": "CST18414161600744",
                "name": "mixlinker",
                "description": "无",
                "email": "mix@mixlinker.com",
                "contact": "mix",
                "mobile": "13800138000",
                "phone": "075523746592",
                "province": "广东省",
                "city": "深圳市",
                "address": "无",
                "secret": "mO3V",
                "responsible": "mix",
                "responsible_phone": "",
                "reference": "",
                "created": "2021-08-24 14:16:16",
                "last_modified": "2021-08-24 14:16:16"
            }
        ],
        "page_index": 1,
        "page_size": 1,
        "total_pages": 1,
        "total_records": 1
    }
}

5.2. 对象数据

5.2.1. 获取最新一条马赛克

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
object_id string 对象编号
keys json 变量Key

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_last_mosaic",
    "keys": ["Y02_1", "Y03_1"],
    "object_id": "OBJ1393762000004"
}

响应示例

{
    "resp": "get_last_mosaic",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "Y02_1": 79,
                "Y03_1": 203.2,
                "time": "2021-03-29 17:50:07"
            }
        ]
    }
}

5.2.2. 按时间获取单条马赛克

获取到的数据是请求参数时间之后的第一条数据

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
object_id string 对象编号
keys json 变量Key
time string 时间点

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_mosaic_item",
    "keys": ["Y02_1", "Y03_1"],
    "time": "2021-03-29 17:50:07",
    "object_id": "OBJ1393762000004"
}

响应示例

{
    "resp": "get_mosaic_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "Y02_1": 79,
                "Y03_1": 203.2,
                "time": "2021-03-29 17:50:07"
            }
        ]
    }
}

5.2.3. 获取最新N条马赛克

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
object_id string 对象编号
keys json 变量Key
items int 数量

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_last_mosaic_list",
    "keys": ["Y02_1", "Y03_1"],
    "items": 2,
    "object_id": "OBJ1393762000004"
}

响应示例

{
    "resp": "get_last_mosaic_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "Y02_1": 79,
                "Y03_1": 203.2,
                "time": "2021-03-29 17:50:07"
            },
            {
                "Y02_1": 79,
                "Y03_1": 202.9,
                "time": "2021-03-29 17:49:36"
            },
            {
                "Y02_1": 79,
                "Y03_1": 203.6,
                "time": "2021-03-29 17:43:01"
            }
        ],
        "items": 2
    }
}

5.2.4. 获取分页马赛克列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
object_id string 对象编号
keys json 变量Key
start_time string 开始时间
end_time string 结束时间

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_mosaic_list",
    "keys": ["Y02_1", "Y03_1"],
    "object_id": "OBJ1393762000004",
    "start_time": "2021-03-29 17:30:00",
    "end_time": "2021-03-30 00:00:00"
}

响应示例

{
    "resp": "get_mosaic_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "Y02_1": 79,
                "Y03_1": 203.2,
                "time": "2021-03-29 17:50:07"
            },
            {
                "Y02_1": 79,
                "Y03_1": 202.9,
                "time": "2021-03-29 17:49:36"
            },
            {
                "Y02_1": 79,
                "Y03_1": 203.6,
                "time": "2021-03-29 17:43:01"
            },
            {
                "Y02_1": 82,
                "Y03_1": 203.8,
                "time": "2021-03-29 17:31:02"
            }
        ],
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 4
    }
}

5.2.5. 获取最新一条栅格

terminal_id 为终端 id,必填 topic 字段筛选栅格数据,不填则为所有 topic,下同

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
terminal_id string 终端编号
topic json 报文主题

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_last_grid",
    "terminal_id": "A220161221008951",
    "topic": ["r", "disconnected"]
}

响应示例

{
    "resp": "get_last_grid",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "payload": {
                    "csq": 25
                },
                "time": "2021-03-30 16:42:29",
                "topic": "r"
            }
        ]
    }
}

5.2.6. 按时间获取单条栅格

获取到的数据是请求参数时间之后的第一条数据

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
terminal_id string 终端编号
topic json 报文主题
time string 时间点

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求

{
    "action":"get_grid_item",
    "terminal_id": "A220161221008951",
    "topic": ["r", "disconnected"],
    "time": "2021-03-30 16:42:30"
}

响应

{
    "resp": "get_grid_item",
    "code": 200,
    "msg": "成功",
    "result": {
       "data": [
            {
                "payload": {
                    "csq": 25
                },
                "time": "2021-03-30 16:42:39",
                "topic": "r"
            }
        ]
    }
}

5.2.7. 获取最新N条栅格

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
terminal_id string 终端编号
topic json 报文主题
items int 数量

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_last_grid_list",
    "terminal_id": "A220161221008951",
    "topic": ["r", "disconnected"],
    "items": 2
}

响应示例

{
    "resp": "get_last_grid_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "payload": {
                    "csq": 23
                },
                "time": "2021-03-30 16:47:42",
                "topic": "r"
            },
            {
                "payload": {
                    "csq": 23
                },
                "time": "2021-03-30 16:47:32",
                "topic": "r"
            }
        ],
        "items": 2
    }
}

5.2.8. 按分页栅格列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
terminal_id string 终端编号
topic json 报文主题
page_index int 页数
page_size int 每页数量
start_time string 开始时间
end_time string 结束时间

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_grid_list",
    "terminal_id": "A220161221008951",
    "start_time": "2021-03-30 12:00:00",
    "end_time": "2021-03-30 18:00:00",
    "topic": ["r", "disconnected"],
    "page_index": 1,
    "page_size": 2
}

响应示例

{
    "resp": "get_grid_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "payload": {
                    "csq": 26
                },
                "time": "2021-03-30 17:59:59",
                "topic": "r"
            },
            {
                "payload": {
                    "L1_3_0": 267.6225,
                    "L1_3_14": 26.844,
                    "L1_3_16": 1630892.375,
                    "L1_3_2": 193,
                    "L1_3_20": 3788661,
                    "L1_3_4": 0,
                    "L1_3_6": 0.644,
                    "L1_3_8": 37.4
                },
                "time": "2021-03-30 17:59:48",
                "topic": "r"
            }
        ],
        "page_index": 1,
        "page_size": 2,
        "total_pages": 1068,
        "total_records": 2135
    }
}

5.2.9. 获取最新一条统计结果

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
script_uid string 统计编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_last_statistics",
    "script_uid": "STATISTICS1302924600002"
}

响应示例

{
    "resp": "get_last_statistics",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "id": 58,
                "script_uid": "STATISTICS1302924600002",
                "object_id": "OBJ1392682700001",
                "description": "this(2021-03-30 18:10:00,2021-03-30 18:11:00.205736257) real(2021-03-30 18:10:07.158470936,2021-03-30 18:10:44.267138313) next(2021-03-30 18:10:44.267138313,2021-03-30 18:12:00)",
                "data": "",
                "var_name": "RSTATISTICS1302924600002",
                "start_time": "2021-03-30T18:10:07+08:00",
                "end_time": "2021-03-30T18:10:44+08:00",
                "created": "2021-03-30T18:11:00+08:00",
                "is_available": 1
            }
        ]
    }
}

5.2.10. 获取统计结果列表(分页)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
script_uid string 统计编号
page_index int 页数
page_size int 每页数量
where_and json and查询条件
where_or json or查询条件时间
where_in json in查询条件
order_by json 结束时间

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数

{
    "action":"get_statistics_list",
    "script_uid": "STATISTICS1302924600002",
    "page_index": 1,
    "page_size": 2,
    "where_and": "[['script_uid','=','STATISTICS1302924600002']]",
    "where_or": "[['script_uid','=','STATISTICS1302924600002']]",
    "where_in": "",
    "order_by": "[\"end_time\", \"asc\"]", // 按指定字段排序,json字符串 [字段名, asc 或 desc]
}

响应参数

{
    "resp": "get_statistics_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 2,
        "total_pages": 941,
        "total_records": 1881,
        "data": [
            {
                "id": 1880,
                "script_uid": "STATISTICS1302924600002",
                "object_id": "OBJ1392682700001",
                "description": "this(2021-03-31 09:21:00,2021-03-31 09:22:00.205427629) real(2021-03-31 09:20:12.218593571,2021-03-31 09:21:58.301710943) next(2021-03-31 09:21:58.301710943,2021-03-31 09:23:00)",
                "data": "",
                "var_name": "RSTATISTICS1302924600002",
                "start_time": "2021-03-31T09:20:12+08:00",
                "end_time": "2021-03-31T09:21:58+08:00",
                "created": "2021-03-31T09:22:00+08:00",
                "is_available": 1
            },
            {
                "id": 1881,
                "script_uid": "STATISTICS1303439700001",
                "object_id": "OBJ1392682700001",
                "description": "this(2021-03-31 09:21:00,2021-03-31 09:22:00.504208789) real(2021-03-31 09:20:12.218593571,2021-03-31 09:21:58.301710943) next(2021-03-31 09:21:58.301710943,2021-03-31 09:23:00)",
                "data": "3.8497847e+06",
                "var_name": "RSTATISTICS1303439700001",
                "start_time": "2021-03-31T09:20:12+08:00",
                "end_time": "2021-03-31T09:21:58+08:00",
                "created": "2021-03-31T09:22:00+08:00",
                "is_available": 1
            }
        ]
    }
}

5.2.11. 获取最新一条计算结果

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
script_uid string 统计编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_last_calculate",
    "script_uid": "STATISTICS1302924600002"
}

响应示例

{
    "resp": "get_last_calculate",
    "code": 200,
    "msg": "成功",
    "result": {
        "data": [
            {
                "id": 58,
                "script_uid": "CACULATE1302924600002",
                "object_id": "OBJ1392682700001",
                "description": "this(2021-03-30 18:10:00,2021-03-30 18:11:00.205736257) real(2021-03-30 18:10:07.158470936,2021-03-30 18:10:44.267138313) next(2021-03-30 18:10:44.267138313,2021-03-30 18:12:00)",
                "data": "",
                "var_name": "RSTATISTICS1302924600002",
                "start_time": "2021-03-30T18:10:07+08:00",
                "end_time": "2021-03-30T18:10:44+08:00",
                "created": "2021-03-30T18:11:00+08:00",
                "is_available": 1
            }
        ]
    }
}

5.2.12. 获取计算结果列表(分页)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
script_uid string 统计编号
page_index int 页数
page_size int 每页数量
where_and json and查询条件
where_or json or查询条件时间
where_in json in查询条件
order_by json 结束时间

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例

{
    "action":"get_calculate_list",
    "script_uid": "CACULATE1302924600002",
    "page_index": 1,
    "page_size": 2,
    "where_and": "[['script_uid','=','STATISTICS1302924600002']]",
    "where_or": "[['script_uid','=','STATISTICS1302924600002']]",
    "where_in": "",
    "order_by": "[\"end_time\", \"asc\"]", // 按指定字段排序,json字符串 [字段名, asc 或 desc]
}

响应示例

{
    "resp": "get_calculate_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 2,
        "total_pages": 941,
        "total_records": 1881,
        "data": [
            {
                "id": 1880,
                "script_uid": "CACULATE1302924600002",
                "object_id": "OBJ1392682700001",
                "description": "this(2021-03-31 09:21:00,2021-03-31 09:22:00.205427629) real(2021-03-31 09:20:12.218593571,2021-03-31 09:21:58.301710943) next(2021-03-31 09:21:58.301710943,2021-03-31 09:23:00)",
                "data": "",
                "var_name": "RSTATISTICS1302924600002",
                "start_time": "2021-03-31T09:20:12+08:00",
                "end_time": "2021-03-31T09:21:58+08:00",
                "created": "2021-03-31T09:22:00+08:00",
                "is_available": 1
            },
            {
                "id": 1881,
                "script_uid": "CACULATE1302924600001",
                "object_id": "OBJ1392682700001",
                "description": "this(2021-03-31 09:21:00,2021-03-31 09:22:00.504208789) real(2021-03-31 09:20:12.218593571,2021-03-31 09:21:58.301710943) next(2021-03-31 09:21:58.301710943,2021-03-31 09:23:00)",
                "data": "3.8497847e+06",
                "var_name": "RSTATISTICS1303439700001",
                "start_time": "2021-03-31T09:20:12+08:00",
                "end_time": "2021-03-31T09:21:58+08:00",
                "created": "2021-03-31T09:22:00+08:00",
                "is_available": 1
            }
        ]
    }
}

5.3. 指令控制

5.3.1. 发送对象控制单指令

向对象发布对象配置好的控制码指令

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
object_id string 对象编号
command string 控制码
value string 控制值

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "publish_object_command",
    "object_id": "OBJ1243475500001",
    "command": "Control_01", // 对应控制码脚本中的第一列
    "value": "1"
}

响应示例:

{
    "resp": "publish_object_command",
    "code": 200,
    "msg": "成功",
    "result": {}
}

5.3.2. 发送对象控制多指令

向对象发布对象配置好的控制码指令

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
publishes json 指令列表

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "publish_object_commnad_plus",
    "publishes": [
        {
            "object_id": "OBJ1243475500001",
            "command": "Control_01", // 对应控制码脚本中的第一列
            "value": "1"
        }, 
        {
            "object_id": "OBJ1243475500002",
            "command": "Control_01", // 对应控制码脚本中的第一列
            "value": "1"
        }, 
    ]
}

响应示例:

{
    "resp": "publish_object_commnad_plus",
    "code": 200,
    "msg": "成功",
    "result": {}
}

5.3.3. 发送终端控制指令

直接向终端发送控制指令

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
terminal_id string 终端编号
command string 控制码
value string 控制值

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "publish_terminal_command",
    "terminal_id": "AX1001",
    "command": "AXUpgrade", // 对应控制码脚本中的第一列
    "value": "LUA"
}

响应示例:

{
    "resp": "publish_terminal_command",
    "code": 200,
    "msg": "成功",
    "result": {}
}

5.4. 历程数据

5.4.1. 创建历程脚本(项目)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
name 名称
description 描述
object_list json 对象列表
script json 脚本

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "action":"create_retainer",
    "name":"test",
    "description":"12164461",
    "object_list":["1001","1002"],
    "script":[["a2b", "a2b_en", "a2b_cn", "1001", "1002"], ["b2c", "b2c_en", "b2c_cn", "1002", "1003"]]
}

响应参数示例:

{
    "resp": "create_retainer",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "RETAINER1622294400001"
    }
}

5.4.2. 更新历程脚本(项目)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid 历程脚本项目编号
name 名称
description 描述
object_list json 对象列表
script json 脚本

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "action":"update_retainer",
    "uid":"RETAINER1622294400001",
    "name":"test111",
    "description":"666666",
    "script":[["a2b", "a2b_en", "a2b_cn", "1001", "1002"], ["b2c", "b2c_en", "b2c_cn", "1002", "1003"]],
    "object_list":["OBJ_TEST1001"]
}

响应参数示例:

{
    "resp": "update_retainer",
    "code": 200,
    "msg": "成功"
}

5.4.3. 删除历程脚本(项目)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid 历程脚本项目编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "action":"delete_retainer",
    "uid":"RETAINER1622294400001"
}

响应参数示例:

{
    "resp": "delete_retainer",
    "code": 200,
    "msg": "成功"
}

5.4.4. 启动历程脚本(项目)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid 历程脚本项目编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "action":"start_retainer",
    "uid":"RETAINER1323077500001"
}

响应参数示例:

{
    "resp": "start_retainer",
    "code": 200,
    "msg": "成功"
}

5.4.5. 停止历程脚本(项目)

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid 历程脚本项目编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "action":"stop_retainer",
    "uid":"RETAINER1323077500001"
}

响应参数示例:

{
    "resp": "stop_retainer",
    "code": 200,
    "msg": "成功"
}

5.4.6. 获取历程脚本(项目)列表

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "resp": "get_retainer_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 10,
        "total_pages": 1,
        "total_records": 2,
        "data": [
            {
                "id": 1017,
                "uid": "RETAINER1515245014412",
                "name": "adasdad",
                "description": "adad",
                "objectlist": ["OBJ1572697700024","OBJ1632060900003"],
                "is_active": 0,
                "script": [],
                "created": "2021-05-31T17:27:52+08:00",
                "last_modified": "2021-06-21T18:28:31+08:00",
                "last_modified_by": 0,
                "is_available": 1
            },
            {
                "id": 1014,
                "uid": "RETAINER1484592500004",
                "name": "test",
                "description": "",
                "objectlist": [],
                "is_active": 0,
                "script": [
                    [
                        "RV1",
                        "running_stop1",
                        "设备启停1",
                        "1711",
                        "1710"
                    ]
                ],
                "created": "2021-04-08T17:18:45+08:00",
                "last_modified": "2021-04-09T12:08:36+08:00",
                "last_modified_by": 0,
                "is_available": 1
            }
        ]
    }
}

响应参数示例:

{
    "resp": "stop_retainer",
    "code": 200,
    "msg": "成功"
}

5.4.7. 获取历程脚本(项目)详情

请求参数:

参数名称 是否必选 数据类型 描述
action string 指令
actionid string 指令编号
uid 历程脚本项目编号

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求参数示例:

{
    "action": "get_retainer_item",
    "uid": "RETAINER1323077500001"
}

响应参数示例:

{
    "resp": "get_retainer_item",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 1008,
        "uid": "RETAINER1323077500001",
        "name": "test111",
        "description": "666666",
        "is_active": 1,
        "script": [
            [
                "a2b",
                "a2b_en",
                "a2b_cn",
                "1001",
                "1002"
            ],
            [
                "b2c",
                "b2c_en",
                "b2c_cn",
                "1002",
                "1003"
            ]
        ],
        "created": "2021-03-12T15:54:30+08:00",
        "last_modified": "2021-03-12T15:55:42+08:00",
        "last_modified_by": 0,
        "is_available": 1
    }
}

5.4.8. 手动关闭历程

用于手动关闭一个历程。需要一个历程的对应属性,包括对象的uidobject_id,历程统一编码code,历程脚本模板(template_id,以这三个属性查找出唯一的一个历程,然后进行关闭。

body:

{
    "action": "close_retainer",
    "object_id": "OBJ_TEST1001",
    "code": "a2b",
    "template_id": "RETAINER1323077500001"
}

curl:

curl -X POST --data '{"action":"close","object_id":"OBJ_TEST1001","code":"a2b","template_id":"RETAINER1323077500001"}' http://127.0.0.1:6061/retainer/api

5.4.9. 获取开放历程列表

查看正在进行中的历程列表。

body:

{
    "action": "get_open_retainer_list"
}

curl:

curl -X POST --data '{"action":"get_open_retainer_list"}' http://127.0.0.1:6061/retainer/api

5.5. 分析数据

5.5.1. 获取平衡值计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_balance_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.2. 获取平衡值计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_balance_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.3. 获取综合计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_compose_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.4. 获取综合计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_compose_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.5. 获取相关性计算结果列表

请求参数:

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_correlation_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.6. 获取相关性计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.6. 获取偏态值计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_deviation_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.7. 获取偏态值计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.8. 获取增量值计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_increment_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.9. 获取增量值计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_increment_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.10. 获取指数计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_index_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.12. 获取指数计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_index_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.13. 获取风险计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_risk_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.14. 获取风险计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_risk_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.15. 获取映像图计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_runimage_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.16. 获取映像图计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_runimage_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.17. 获取稳定性计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_stability_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.18. 获取稳定性最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_stability_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.5.19. 获取趋势计算结果列表

请求参数

参数名 是否必传 类型 示例
action string 指令
actionid string 指令编号
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_tendency_result_list",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "data": [{
                "block_id": "correlation",
                "class_id": "Correlation",
                "created": "2021-04-23 17:33:48",
                "id": "2021-04-23T17:33:48.353324Z",
                "mapping_id": null,
                "object_id": "OBJ1444398300010",
                "project_id": "1001",
                "value": {
                    "correlation": "[[1.0,-0.028,-0.205,-0.212,-0.024,0.02,0.08,0.002],[-0.028,1.0,-0.088,0.174,-0.09,0.079,-0.098,-0.312],[-0.205,-0.088,1.0,0.244,0.068,-0.324,0.114,-0.431],[-0.212,0.174,0.244,1.0,0.156,0.337,0.045,-0.419],[-0.024,-0.09,0.068,0.156,1.0,0.348,0.333,0.029],[0.02,0.079,-0.324,0.337,0.348,1.0,0.19,-0.174],[0.08,-0.098,0.114,0.045,0.333,0.19,1.0,-0.015],[0.002,-0.312,-0.431,-0.419,0.029,-0.174,-0.015,1.0]]",
                    "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
                    "time": "2021-04-23T17:33:48.353324Z"
                }
            }
        ],
    "page_index": 1,
    "page_size": 2,
    "total_pages": 1757,
    "total_records": 17562
    }
}

5.5.20. 获取趋势计算最新结果

请求参数

参数名 是否必传 类型 示例
page_index int 1
page_size int 20
where_and string [["name", "=", "123"]]
where_or string [["name", "=", "123"]]
where_in string ["name", ["123","456"]]

响应参数:

参数名称 数据类型 描述
resp string 返回指令
actionid string 返回指令编号
code int 返回码
msg string 提示消息
info string 详细信息
result object 返回结果

请求示例:

{
    "action": "get_tendency_latest_result",
    "actionid": ""
}

响应示例:

{
    "code": 200,
    "info": "",
    "msg": "ok",
    "result": {
        "block_id": "correlation",
        "class_id": "Correlation",
        "created": "2021-04-23 17:35:18",
        "id": "2021-04-23T17:35:18.351954Z",
        "mapping_id": null,
        "object_id": "OBJ1444398300010",
        "project_id": "1001",
        "value": {
            "correlation": "[[1.0,0.01,-0.042,0.224,-0.068,0.121,-0.134,0.007],[0.01,1.0,-0.189,0.01,-0.037,-0.228,-0.072,-0.169],[-0.042,-0.189,1.0,-0.21,0.117,0.0,0.3,-0.179],[0.224,0.01,-0.21,1.0,-0.133,0.034,-0.094,0.152],[-0.068,-0.037,0.117,-0.133,1.0,-0.068,0.085,-0.261],[0.121,-0.228,0.0,0.034,-0.068,1.0,-0.005,0.079],[-0.134,-0.072,0.3,-0.094,0.085,-0.005,1.0,-0.246],[0.007,-0.169,-0.179,0.152,-0.261,0.079,-0.246,1.0]]",
            "parameters": "[\"S01\", \"S02\", \"S03\", \"S13\", \"S14\", \"S15\", \"S77\", \"S78\"]",
            "time": "2021-04-23T17:35:18.351954Z"
        }
    }
}

5.6. 离线数据

5.6.1. 获取离线类型列表

获取离线项目列表

{
    "action":"get_collect_key_list",
    "page_index": 1,
    "page_size": 20,
    "where_and": "",
    "where_or": "",
    "where_in": "",
}

5.6.2. 获取离线类型记录

获取离线项目

{
    "action":"get_collect_key_item",
    "uid": "COL1"
}

5.6.3. 添加离线数据

添加上报一条离线数据,离线ID对应的项目需要启动并且上报的 value 中的 key 与对应项目配置的脚本匹配

示例

{
    "action": "add_collect_value",
    "actionid": "",
    "name": "数据采集1",
    "description": "",
    "collect_id": "COL1332295612308",
    "object_id": "OBJ1001",
    "value": {
        "temp": 88.5,
        "pressure": 202
    },
    "file": "",
    "collect_at": "2021-03-03 10:88:10",
    "collector": "mixuser",
    "reference": ""
}

5.6.4. 获取最新离线数据

根据离线ID和对象ID获取最新一条API类型手工上报的离线数据

示例

{
    "action": "get_last_collect_value",
    "collect_id": "COL12236500002",
    "object_id": "OBJ1243475500001"
}

5.6.5. 获取离线值历史列表

获取历史的离线值

示例

{
    "action": "get_collect_value_list",
    "page_index": 1,
    "page_size": 20,
    "where_and": "",
    "where_or": "",
    "where_in": "",
    "order_by": "",
}

5.6.6. UID获取指定离线值

根据离线值ID获取单条离线值记录

示例

{
    "action": "get_collect_value",
    "uid": "COLVAL1"
}

5.7. 事件代理

Mixiot事件消息的订阅通过Mixiot接口实现,有回调和长连接两种方式。

5.7.1. 建立事件订阅连接

  • 描述

订阅连接是一种长连接方式。此方式下,发起订阅的一方必须按照格式描述的要求发送Json数据到Agent;在与Anget建立连接之后,需要与Agent保持连接。此后,Agent会将匹配到的消息发通过这个连接发送给订阅方,一旦订阅方断开连接,则Agent会根据这个断开的连接自动取消订阅。

事件订阅连接目前只支持 TCP,Websocket 方式

  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String sub_agent_event 方法名
actionid String 活动标识
event Json 指明agent类型是event
+ event String
+ ... 依据实际而定 依据实际情况而定
  • 示例
{
    "action": "sub_agent_event",
    "actionid": "abc",
    "event": {
        "event": "timer_event",
        "type": "one_second_event"
    }
}
  • 返回

{
    "resp": "sub_event",
    "actionid": "abc",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "EVNT1463595100003"
    }
}

5.7.2. 添加事件回调任务

  • 描述

事件回调是一种短连接方式。此方式下,发起订阅的一方必须按照格式描述的要求发送Json数据到Agent;Agent不关心当前的连接是否存在,当Agent匹配到消息之后,会根据格式描述的回调地址和回调参数和消息进行回调。

事件回调任务方式支持 HTTP,TCP,Websocket,gRPC 等四种方式

  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String 异步方式add_agent_task 方法名
actionid String 活动标识
task Json 指明agent类型是task
+ event String
+ ... 依据实际情况而定 依据实际情况而定
+ callback_addr String 事件回调地址
++ callback_params Json
+++ action String
+++ method String http | tcp | websocket | grpc -

订阅者必须确保 callback_addr 是一个可以访问的地址,并且callback_addr的方式和 callback_params.method 必须一致

  • 示例
{
    "action": "add_agent_task",
    "actionid": "abc",
    "task": {
        "event": "timer_event",
        "type": "one_second_event",
        "callback_addr": "http://192.168.1.208:1235/mixlog/api",
        "callback_params": {
            "action": "get_action_list",
            "actionid": "",
            "method": "http"
        }
    }
}
  • 返回
{
    "resp": "add_task",
    "actionid": "abc",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TASK1460995400162"
    }
}

5.7.3. 取消事件订阅连接

  • 描述

取消订阅的时候,必须通过UID来取消。特别的,在此订阅模式下,并不一定需要显式的取消订阅,当订阅者断开连接的时候,Agent会强制自动取消订阅。

  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String unsub_event 方法名
actionid String 活动标识
uid String
  • 示例

{
    "action":"unsub_agent_event",
    "uid":"EVNT1343675700011"
}
  • 返回

{
    "resp": "unsub_event",
    "code": 200,
    "msg": "成功"
}

5.7.4. 取消事件回调任务

  • 描述

取消订阅的时候,必须通过UID来取消。特别的,在此订阅模式下,一定需要显式的取消订阅。

  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String cancel_task 方法名
actionid String 活动标识
uid String
  • 示例

{
    "action":"cancel_agent_task",
    "uid":"SUB1262842000001"
}
  • 返回

{
    "resp": "cancel_task",
    "code": 200,
    "msg": "成功"
}

5.7.5. 获取事件订阅连接列表

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String get_event_list 方法名
actionid String 活动标识
uid String
  • 示例

{
    "action":"get_agent_event_list"
}
  • 返回
{
    "resp": "get_agent_event_list",
    "code": 200,
    "msg": "成功",
    "result": [
        "EVNT1342988000006"
    ]
}

5.7.6. 获取事件回调任务列表

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String get_task_list 方法名
actionid String 活动标识
  • 示例

{
    "action":"get_agent_task_list"
}
  • 返回

{
    "resp": "get_agent_task_list",
    "code": 200,
    "msg": "成功",
    "result": [
        "TASK1344865700014"
    ]
}

5.7.7. 获取事件订阅连接详情

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_event_detail 方法名
actionid String 活动标识
  • 示例

{
    "action": "get_agent_event_detail",
    "uid":"EVNT1342988000006"
}
  • 返回

{
    "resp": "get_agent_event_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "event": "timer_event",
        "type": "one_second_event"
    }
}

5.7.8. 获取事件回调任务详情

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_task_detail 方法名
actionid String 活动标识
  • 示例

{
    "action": "get_agent_task_detail",
    "uid":"TASK1334562600001"
}
  • 返回

{
    "resp": "get_agent_task_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "callback_addr": "http://192.168.1.208:1235/mixlog/api",
        "callback_params": {
            "action": "get_action_list",
            "method": "http"
        },
        "event": "timer_event",
        "type": "one_second_event"
    }
}

5.7.9. 发布用户事件

用户事件是人为或者程序通过API接口发布一个事件消息。

  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String generate_user_event 方法名
actionid String 活动标识
user_event String 事件名称
+ ... 依据实际而定 自定义事件参数
  • 示例
{
    "action": "generate_user_event",
    "actionid": "",
    "user_event": "mix_event"
}
  • 返回
{
    "resp": "generate_user_event",
    "actionid": "mix",
    "code": 200,
    "msg": "成功",
    "result": {
        "event":"user_event",
        "block":"agent",
        "uniqueid":"PUB1344800006032",
        "datetime":"2021-03-04 17:13:48",
        "user_event": "mix_event"
    }
}

5.8. 定时维保

5.8.1. 创建定时维保规则

创建一条定时维保规则

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String create_timer_rule 方法名
actionid String 活动标识
name String 名称
description String 描述
cycle_type String 倒计时类型,可选 NaturalTime自然时间、RunTime运行时间
period String 维保周期
notice String 提醒时间
statistics_id cycle_type 为 RunTime 时必填 String 统计id
  • 示例

自然时间规则

{
    "action":"create_timer_rule",
    "name": "2day_check",
    "description": "2天检查一次设备运行",
    "cycle_type": "NaturalTime",
    "period": "48h",
    "notice": "1h"
}

运行时间规则

{
    "action":"create_timer_rule",
    "name": "2day_check",
    "description": "2天检查一次设备运行",
    "cycle_type": "RunTime",
    "statistics_id": "STATISTICS1001",
    "period": "48h",
    "notice": "1h"
}
  • 响应
{
    "resp": "create_timer_rule",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERULE1"
    }
}

5.8.2. 修改定时维保规则

修改定时维保规则注意:修改并不会影响已应用此规则的所有维保任务)

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String update_timer_rule 方法名
actionid String 活动标识
name String 名称
description String 描述
cycle_type String 倒计时类型,可选 NaturalTime自然时间、RunTime运行时间
period String 维保周期
notice String 提醒时间
statistics_id cycle_type 为 RunTime 时必填 String 统计id
  • 示例
{
    "action":"update_timer_rule",
    "uid": "MIXTIMERULE1",
    "name": "3day_check_update",
    "description": "3天检查一次设备运行修改",
    "cycle_type": "NaturalTime",
    "period": "72h",
    "notice": "1h"
}
  • 响应
{
    "resp": "update_timer_rule",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERULE1"
    }
}

5.8.3. 删除定时维保规则

删除定时维保规则

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String delete_timer_rule 方法名
actionid String 活动标识
uid String uid
  • 示例
{
    "action":"delete_timer_rule",
    "uid": "MIXTIMERULE1581629700001"
}
  • 响应
{
    "resp": "delete_timer_rule",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERULE1581629700001"
    }
}

5.8.4. 获取定时维保规则

获取定时维保规则

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer_rule 方法名
actionid String 活动标识
uid String uid
  • 示例
{
    "action":"get_timer_rule",
    "uid": "MIXTIMERULE1581629700001"
}
  • 响应示例
{
    "resp": "get_timer_rule",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERULE1581629700001",
        "name": "3day_check_update",
        "description": "3天检查一次设备运行修改",
        "cycle_type": "NaturalTime",
        "statistics_id": "",
        "period": "72h0m0s",
        "notice": "1h0m0s",
        "created": "2021-05-08 16:48:16",
        "created_by": 0,
        "last_modified": "2021-05-10 11:41:51",
        "last_modified_by": 0
    }
}

5.8.5. 获取定时维保规则列表

获取定时维保规则列表

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer_rule_list 方法名
actionid String 活动标识
page_index int 页数,不传则获取所有记录
page_size int 页大小,不传则获取所有记录
where_and String and 条件
where_or String or 条件
where_in String in 条件
  • action 参数示例
{
    "action":"get_timer_rule_list",
    "page_size": 10,
    "page_index": 1,
    "where_and": "",
    "where_or": "",
    "where_in": ""
}

响应示例

{
    "resp": "get_timer_rule_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 10,
        "total_pages": 1,
        "total_records": 1,
        "data": [
            {
                "uid": "MIXTIMERULE1581629700001",
                "name": "3day_check_update",
                "description": "3天检查一次设备运行修改",
                "cycle_type": "NaturalTime",
                "statistics_id": "",
                "period": "72h0m0s",
                "notice": "1h0m0s",
                "created": "2021-05-08 16:48:16",
                "created_by": 0,
                "last_modified": "2021-05-10 11:41:51",
                "last_modified_by": 0
            }
        ]
    }
}

5.8.6. 创建定时维保项目

创建一个定时维保项目,多选维保规则和对象ID可以批量创建多个具体对象的维保任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String create_timer_project 方法名
actionid String 活动标识
name String 名称
description String 描述
rule_id_list List 规则id列表
object_id_list List 对象id列表
handler_id_list List 处理人id列表
  • 示例
{
    "action":"create_timer_project",
    "rule_id_list": ["MIXTIMERULE1581629700001"],
    "object_id_list": ["OBJ1", "OBJ2"],
    "handler_id_list": ["1001", "1002"],
    "name": "hello项目",
    "description": "asaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
  • 响应
{
    "resp": "create_timer_project",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERPROJ1"
    }
}

5.8.7. 启动定时维保项目下所有维保任务

启动定时维保项目下所有维保任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String start_timer_project 方法名
actionid String 活动标识
uid String uid
  • 示例
{
    "action":"start_timer_project",
    "uid": "MIXTIMERPROJ1501241100001"
}
  • 响应
{
    "resp": "start_timer_project",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERULE1581629700001"
    }
}

5.8.8. 停止定时维保项目下所有维保任务

停止定时维保项目下所有维保任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String stop_timer_project 方法名
actionid String 活动标识
uid String uid
  • 示例
{
    "action":"stop_timer_project",
    "uid": "MIXTIMERPROJ1501241100001"
}
  • 响应
{
    "resp": "stop_timer_project",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERPROJ1501241100001"
    }
}

5.8.9. 获取定时维保项目

获取定时维保项目

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer_project 方法名
actionid String 活动标识
uid String uid
  • 示例
{
    "action":"get_timer_project",
    "uid": "MIXTIMERPROJ1501241100001"
}
  • 响应
{
    "resp": "get_timer_project",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERPROJ1521107600003",
        "name": "高压站定时维保项目",
        "description": "",
        "rule_id_list": [
            "MIXTIMERULE1524979100002"
        ],
        "object_id_list": [
            "OBJ1393762000004",
            "OBJ1390070700005",
            "OBJ1392682700001"
        ],
        "handler_id_list": null,
        "created": "2021-05-12 17:10:11",
        "created_by": 0,
        "last_modified": "",
        "last_modified_by": 0
    }
}

5.8.10. 获取定时维保项目列表

获取定时维保项目列表

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer_project_list 方法名
actionid String 活动标识
page_index int 页数,不传则获取所有记录
page_size int 页大小,不传则获取所有记录
where_and String and 条件
where_or String or 条件
where_in String in 条件
  • 示例
{
    "action":"get_timer_project_list",
    "page_size": 10,
    "page_index": 1,
    "where_and": ""
}
  • 响应
{
    "resp": "get_timer_project_list",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 1,
        "data": [
            {
                "uid": "MIXTIMERPROJ1521107600003",
                "name": "高压站定时维保项目",
                "description": "",
                "rule_id_list": [
                    "MIXTIMERULE1524979100002"
                ],
                "object_id_list": [
                    "OBJ1393762000004",
                    "OBJ1390070700005",
                    "OBJ1392682700001"
                ],
                "handler_id_list": null,
                "created": "2021-05-12 17:10:11",
                "created_by": 0,
                "last_modified": "",
                "last_modified_by": 0
            }
        ]
    }
}

5.8.11. 删除定时维保项目

删除定时维保项目,会停止并删除项目下所有维保任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String delete_timer_project 方法名
actionid String 活动标识
uid String uid
  • 示例
{
    "action":"delete_timer_project",
    "uid":"MIXTIMERPROJ1504124900001"
}
  • 响应
{
    "resp": "delete_timer_project",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERPROJ1504124900001"
    }
}

5.8.12. 创建任务(create_timer)

创建一个定时提醒

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String create_timer 方法名
actionid String 活动标识
name String 名称
description String 描述
object_id String 对象id
cycle_type String 倒计时类型,可选 NaturalTime自然时间、RunTime运行时间
period String 维保周期
notice String 提醒时间
statistics_id cycle_type 为 RunTime 时必填 String 统计id
handler_id_list List 处理人id列表
  • action 参数示例

自然时间

{
    "action": "create_timer",
    "name": "test_2day",
    "description": "2天一",
    "object_id": "OBJ1001",
    "cycle_type": "NaturalTime",
    "period": "48h",
    "notice": "1h",  // 到期前 1 小时提前提醒
    "handler_id_list": ["1001", "1002"],
}

运行时间

{
    "action": "create_timer",
    "name": "test_2day",
    "description": "2天一",
    "object_id": "OBJ1001",
    "cycle_type": "RunTime",
    "statistics_id": "STATISTCS1001",
    "period": "48h",
    "notice": "1h",  // 到期前 1 小时提前提醒
    "handler_id_list": ["1001", "1002"]
}
  • 响应
{
    "resp": "create_timer",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMERULE1"
    }
}

5.8.13. 更新任务

修改定时提醒,不能修改已启动状态的 timer,需要先停止再进行修改。

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String update_timer 方法名
actionid String 活动标识
name String 名称
description String 描述
object_id String 对象id
cycle_type String 倒计时类型,可选 NaturalTime自然时间、RunTime运行时间
period String 维保周期
notice String 提醒时间
statistics_id cycle_type 为 RunTime 时必填 String 统计id
handler_id_list List 处理人id列表
  • action 参数示例
{
    "action": "update_timer",
    "notice": "20h",
    "description": "update",
    "uid": "MIXTIMER1390735800002"
}
  • 响应
{
    "resp": "update_timer",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1390735800002"
    }
}

5.8.14. 删除任务

删除定时提醒

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String delete_timer 方法名
actionid String 活动标识
uid String uid
  • action 参数示例
{
    "action": "delete_timer",
    "uid": "MIXTIMER1305938200004"
}
  • 响应
{
    "resp": "delete_timer",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1305938200004"
    }
}

5.8.15. 启动任务

启动一个定时提醒任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String start_timer 方法名
actionid String 活动标识
uid String uid
  • action 参数示例
{
    "action": "start_timer",
    "uid": "MIXTIMER1305938200004"
}
  • 响应
{
    "resp": "start_timer",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1305938200004"
    }
}

5.8.16. 停止任务

停止一个定时提醒任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String stop_timer 方法名
actionid String 活动标识
uid String uid
  • action 参数示例
{
    "action": "stop_timer",
    "uid": "MIXTIMER1305938200004"
}
  • 响应
{
    "resp": "stop_timer",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1305938200004"
    }
}

5.8.17. 获取任务信息

获取定时提醒

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer 方法名
actionid String 活动标识
uid String uid
  • action 参数示例
{
    "action": "get_timer",
    "uid": "MIXTIMER1390735800002"
}
  • 响应
{
    "resp": "get_timer",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1305938200004",
        "name": "test_2day",
        "description": "2天一",
        "object_id": "obj1001",
        "rule_id": "MIXTIMERULE1524979100002",
        "project_id": "MIXTIMERPROJ1521107600003",
        "cycle_type": "NatutalTime",
        "period": "48h0m0s",
        "notice": "1h0m0s",
        "start_time": "2021-03-10 14:57:42",
        "last_handle_time": "",
        "close_time": "",
        "handle_num": 0,
        "handler_id_list": ["1001", "1002"],
        "is_active": 1,
        "created": "2021-03-10 09:59:59",
        "countdown": "47h33m44s",
        "is_expired": false
    }
}

5.8.18. 获取任务列表

获取定时维保列表

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer_list 方法名
actionid String 活动标识
page_index int 页数,不传则获取所有记录
page_size int 页大小,不传则获取所有记录
where_and String and 条件
where_or String or 条件
where_in String in 条件
  • action 参数示例
{
    "action": "get_timer_list",
    "page_index": 1,
    "page_size": 20,
    "where_and": "",
    "where_or": "",
    "where_in": "",
    "order_by": "",
}
  • 响应
{
    "resp": "get_timer_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 7,
        "data": [
            {
                "uid": "MIXTIMER1305938200004",
                "name": "test_2day",
                "description": "2天一",
                "object_id": "obj1001",
                "rule_id": "MIXTIMERULE1524979100002",
                "project_id": "MIXTIMERPROJ1521107600003",
                "cycle_type": "NatutalTime",
                "period": "48h0m0s",
                "notice": "1h0m0s",
                "start_time": "2021-03-10 14:57:42",
                "last_handle_time": "",
                "close_time": "",
                "handle_num": 0,
                "handler_id_list": ["1001", "1002"],
                "is_active": 1,
                "created": "2021-03-10 09:59:59",
                "countdown": "47h33m44s",
                "is_expired": false
            }
        ]
    }
}

5.8.19. 处理任务

处理已到期的定时提醒,倒计时重置回初始值

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String handle_timer 方法名
actionid String 活动标识
timer_id String 维保id
handler_id String 处理人
handler_name String 处理人名称
description String 描述
comment String 维保评价
star Float 评分
fee Float 费用
  • action 参数示例
{
    "action": "handle_timer",
    "timer_id": "MIXTIMER1305938200004",
    "handler_id": 1,
    "handler_name": "处理人",
    "description": "非常好",
    "comment": "非常好comment",
    "star": 0.5,
    "fee": 250.33
}
  • 响应
{
    "resp": "handle_timer",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1305938200004"
    }
}

5.8.20. 设置偏移

给当前运行的定时提醒设置一个偏移时间,正值使倒计时减少,到期时间会提前,负值相反。

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String set_timer_offset 方法名
actionid String 活动标识
uid String uid
offset String 偏移量
  • action 参数示例
{
    "action": "set_timer_offset",
    "uid": "MIXTIMER1305938200004",
    "offset": "2h"
}
  • 响应
{
    "resp": "set_timer_offset",
    "actionid": "",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "MIXTIMER1305938200004"
    }
}

5.8.21. 获取处理记录列表

获取处理记录列表

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_timer_record_list 方法名
actionid String 活动标识
page_index int 页数,不传则获取所有记录
page_size int 页大小,不传则获取所有记录
where_and String and 条件
where_or String or 条件
where_in String in 条件
  • action 参数示例
{
    "action": "get_timer_record_list",
    "page_index": 1,
    "page_size": 20,
    "where_and": "[[\"timer_id\", \"=\", \"MIXTIMER1365456700001\"]]",
    "where_or": "",
    "where_in": ""
}
  • 响应
{
    "resp": "get_timer_record_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 1,
        "total_pages": 1,
        "total_records": 1,
        "data": [
            {
                "uid": "TIMEREC1365456700001",
                "timer_id": "MIXTIMER1365456700001",
                "object_id": "",
                "handler_id": 1,
                "handler_name": "1",
                "fee": 250.33,
                "description": "",
                "images": "",
                "star": 0.5,
                "comment": "",
                "handle_time": "2021-03-11 14:37:23",
                "created": "2021-03-11 14:37:23"
            }
        ]
    }
}

5.9. 统计计算

5.9.1. 创建统计任务

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String create_statistics_task 方法名
actionid String 活动标识
name String 统计名称
func String 统计方法
object_id String 统计设备
key String 统计FV
filter String 过滤Id
result Json 统计结果
+precision float64 结果精度
+var_name String 不填,自动生成 结果变量key
schedule Json 统计周期
+spec String 指定多久生成一次结果
object_list 列表 对象列表
  • 示例
{
    "action": "create_statistics_task",
    "key": "v1",
    "func": "count",
    "name": "123",
    "filter": "sff",
    "result": {
        "precision": 4
    },
    "schedule": {
        "spec": "0 */1 * * * *"
    },
    "object_list": ["OBJ1243475500002","OBJ1243475500001"]
}
  • 返回
    • uid:uid唯一标识一个统计项目
    • var_name:var_name 唯一表示一个统计项目的结果~~
{
    "resp": "create_statistics_task",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "STATISTICS1395846800005"
    }
}

5.9.2. 更新统计任务

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String update_statistics_task 方法名
actionid String 活动标识
uid String 统计编号
name String 统计名称
func String 统计方法
object_id String 统计设备
key String 统计FV
filter String 过滤Id
result Json 统计结果
+precision float64 结果精度
+var_name String 不填,自动生成 结果变量key
schedule Json 统计周期
+spec String 指定多久生成一次结果
object_list 列表 对象列表
  • 示例
{
    "action": "update_statistics_task",
    "uid": "STATISTICS1395846800005",
    "key": "v1",
    "func": "count",
    "name": "123",
    "filter": "sff",
    "result": {
        "precision": 4
    },
    "schedule": {
        "spec": "0 */1 * * * *"
    },
    "object_list": ["OBJ1243475500002","OBJ1243475500001"]
}
  • 返回
    • uid:uid唯一标识一个统计项目
    • var_name:var_name 唯一表示一个统计项目的结果~~
{
    "resp": "update_statistics_task",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "STATISTICS1395846800005"
    }
}

5.9.3. 获取统计任务列表

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_statistics_task_list 方法名
actionid String 活动标识
  • 示例
{
    "action":"get_statistics_task_list"
}
  • 返回
{
    "resp": "get_statistics_task_list",
    "code": 200,
    "msg": "成功",
    "result": [
        "STATISTICS1305433500001"
    ]
}

5.9.4. 获取统计任务详情

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_statistics_task_detail 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例
{
    "action": "get_statistics_task_detail",
    "uid":"STATISTICS1303162000001"
}
  • 返回
{
    "resp": "get_statistics_task_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "func": "accumulate",
        "key": "v1",
        "object_id": "OBJ1343477200007",
        "result": {
            "precision": 4,
            "var_name": "f"
        },
        "schedule": {
            "spec": "0/10 * * * * *"
        }
    }
}

5.9.5. 取消统计任务

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String cancel_statistics_task 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例

{
    "action": "cancel_statistics_task",
    "uid":"STATISTICS1391005100002"
}
  • 返回

{
    "resp": "cancel_statistics_task",
    "code": 200,
    "msg": "成功"
}

5.9.6. 启动统计任务

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String start_statistics_task 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例

{
    "action": "start_statistics_task",
    "uid":"STATISTICS1395587100001"
}
  • 返回

{
    "resp": "start_statistics_task",
    "code": 200,
    "msg": "成功",
    "result": {
        "next": "2021-03-30 09:59:54"
    }
}

5.9.7. 停止统计任务

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String stop_statistics_task 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例

{
    "action": "stop_statistics_task",
    "uid":"STATISTICS1341891700001"
}
  • 返回

{
    "resp": "stop_statistics_task",
    "code": 200,
    "msg": "成功"
}

5.9.8. 创建计算分析任务

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String create_calculate_task 方法名
actionid String 活动标识
expr String 用于计算的表达式
trigger 列表 指定触发计算的一个或者多个统计uid
statis_var_list 列表 需要取出统计结果值做计算的统计var_name列表
object_id String 和mapping_id同时只能存在一个 需要取出的用于计算的设备
obj_var_list 列表 需要取出的用于计算的设备变量FV列表
mapping_id String 和object_id同时只能存在一个 需要取出的用于计算的用同一个mapping_id的多个设备
spec String 指定多久生成一次结果
result Json 结果
+ precison float64 结果精度
+ var_name String 结果变量key
  • 示例
{
    "action": "create_calculate_task",
    "expr":"STATISTICS1391005100002",
    "trigger":["STATISTICS1391005100002"],
    "statis_var_list":["f"],
    "result":{
        "precision":3
    }
}
  • 返回
    • uid:uid唯一标识一个统计项目
    • var_name:var_name 唯一表示一个统计项目的结果
{
    "resp": "create_calculate_task",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CALCULATE1302391300002"
    }
}

5.9.9. 更新计算任务

  • 描述

  • 格式

参数名称 是否必选 数据类型 数据约束 描述
action String update_calculate_task 方法名
actionid String 活动标识
uid String 计算编号
expr String 用于计算的表达式
trigger 列表 指定触发计算的一个或者多个统计uid
statis_var_list 列表 需要取出统计结果值做计算的统计var_name列表
object_id String 和mapping_id同时只能存在一个 需要取出的用于计算的设备
obj_var_list 列表 需要取出的用于计算的设备变量FV列表
mapping_id String 和object_id同时只能存在一个 需要取出的用于计算的用同一个mapping_id的多个设备
spec String 指定多久生成一次结果
result Json 结果
+ precison float64 结果精度
+ var_name String 结果变量key
  • 示例
{
    "action": "update_calculate_task",
    "uid": "CALCULATE1302391300002",
    "expr":"STATISTICS1391005100002",
    "trigger":["STATISTICS1391005100002"],
    "statis_var_list":["f"],
    "result":{
        "precision":3
    }
}
  • 返回
    • uid:uid唯一标识一个统计项目
    • var_name:var_name 唯一表示一个统计项目的结果
{
    "resp": "update_calculate_task",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CALCULATE1302391300002"
    }
}

5.9.10. 获取计算任务列表

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_calculate_task_list 方法名
actionid String 活动标识
  • 示例

{
    "action":"get_calculate_task_list"
}
  • 返回

{
    "resp": "get_calculate_task_list",
    "code": 200,
    "msg": "成功",
    "result": [
        "CALCULATE1305256100003",
        "CALCULATE1305483400004",
        "CALCULATE1305595400005",
        "CALCULATE1305665000006"
    ]
}

5.9.11. 获取计算任务详情

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_calculate_task_detail 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例

{
    "action": "get_calculate_task_detail",
    "uid":"CALCULATE1344002700003"
}
  • 返回

{
    "resp": "get_calculate_task_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "expr": "RSTATISTICS1301522700002",
        "result": {
            "precision": 3,
            "var_name": "Y1"
        },
        "statis_var_list": [
            "RSTATISTICS1301522700002"
        ],
        "trigger": [
            "STATISTICS1301522700002"
        ]
    }
}

5.9.12. 取消计算任务

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String cancel_calculate_task 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例

{
    "action": "cancel_calculate_task",
    "uid":"CALCULATE1302904900002"
}
  • 返回

{
    "resp": "cancel_calculate_task",
    "code": 200,
    "msg": "成功"
}

5.9.13. 启动计算任务

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String start_calculate_task 方法名
actionid String 活动标识
uid String 创建计算命题的时候生成的uid
  • 示例

{
    "action": "start_calculate_task",
    "uid":"CALCULATE1302391300002"
}
  • 返回

{
    "resp": "start_calculate_task",
    "code": 200,
    "msg": "成功"
}

5.9.14. 停止计算任务

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String stop_calculate_task 方法名
actionid String 活动标识
uid String 创建计算命题的时候生成的uid
  • 示例

{
    "action": "stop_calculate_task",
    "uid":"CALCULATE1381575800012"
}
  • 返回
{
    "resp": "stop_calculate_task",
    "code": 200,
    "msg": "成功"
}

5.9.15. 创建过滤模型

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String create_filter_model 方法名
actionid String 活动标识
first_min String
first_max String
sigma String
mean_factor String
  • 示例

{
    "action": "create_filter_model",
    "first_min":4,
    "first_max":3,
    "sigma":2,
    "mean_factor":1
}
  • 返回

{
    "resp": "create_filter_model",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "FILTER1412781700013"
    }
}

5.9.16. 更新过滤模型

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String update_filter_model 方法名
actionid String 活动标识
uid String
first_min String
first_max String
sigma String
mean_factor String
  • 示例

{
    "action":"update_filter_model",
    "uid":"FILTER1412781700013",
    "first_min":4,
    "first_max":3,
    "sigma":2,
    "mean_factor":1
}
  • 返回

{
    "resp": "update_filter_model",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "FILTER1412781700013"
    }
}

5.9.17. 获取过滤模型详情

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_filter_detail 方法名
actionid String 活动标识
uid String
  • 示例

{
    "action":"get_filter_detail",
    "uid":"FILTER1410561000074"
}
  • 返回

{
    "resp": "get_filter_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "first_min": 4,
        "first_max": 3,
        "sigma": 2,
        "mean_factor": 1
    }
}

5.9.18. 获取过滤模型列表

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_filter_list 方法名
actionid String 活动标识
  • 示例

{
    "action":"get_filter_list"
}
  • 返回

{
    "resp": "get_filter_list",
    "code": 200,
    "msg": "成功",
    "result": [
        "FILTER1414932900005",
        "FILTER1410561000074"
    ]
}

5.9.19. 删除过滤模型

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String delete_filter_model 方法名
actionid String 活动标识
  • 示例

{
    "action":"delete_filter_model",
    "uid":"FILTER1412818200003"
}
  • 返回

{
    "resp": "delete_filter_model",
    "code": 200,
    "msg": "成功"
}

5.9.20. 创建条件模型

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String create_condition_model 方法名
actionid String 活动标识
logic_expr String 逻辑表达式
obj_var_list String
default String
  • 示例

{
    "action":"create_condition_model",
    "logic_expr":"v1 + 5 > 0",
    "obj_var_list":["v1"],
    "default":false
}
  • 返回

{
    "resp": "create_condition_model",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CONDITION1414618400001"
    }
}

5.9.21. 更新条件模型

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String update_condition_model 方法名
actionid String 活动标识
uid String
logic_expr String 逻辑表达式
obj_var_list String
default String
  • 示例

{
    "action":"update_condition_model",
    "uid":"CONDITION1414618400001",
    "logic_expr":"v1 + 5 > 4200",
    "obj_var_list":["v1"],
    "default":true
}
  • 返回

{
    "resp": "update_condition_model",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "CONDITION1414618400001"
    }
}

5.9.22. 获取条件模型详情

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_condition_detail 方法名
actionid String 活动标识
uid String
  • 示例

{
    "action":"get_condition_detail",
    "uid":"CONDITION1414932900005"
}
  • 返回

{
    "resp": "get_condition_detail",
    "code": 200,
    "msg": "成功",
    "result": {
        "logic_expr": "v1 + 5 > 4200",
        "obj_var_list": [
            "v1"
        ],
        "default": false
    }
}

5.9.23. 获取条件模型列表

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_condition_list 方法名
actionid String 活动标识
  • 示例

{
    "action":"get_condition_list"
}
  • 返回

{
    "resp": "get_condition_list",
    "code": 200,
    "msg": "成功",
    "result": [
        "CONDITION1410556800016",
        "CONDITION1413955100001"
    ]
}

5.9.24. 删除条件模型

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String delete_condition_model 方法名
actionid String 活动标识
  • 示例

{
    "action":"delete_condition_model",
    "uid":"CONDITION1410556800016"
}
  • 返回

{
    "resp": "delete_condition_model",
    "code": 200,
    "msg": "成功"
}

5.9.25. 获取统计任务最新值-实时值

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_statistics_value 方法名
actionid String 活动标识
uid String 创建统计命题的时候生成的uid
  • 示例

{
    "action": "get_statistics_value",
    "uid":"STATISTICS1354093700001"
}
  • 返回

{
    "resp": "get_statistics_value",
    "code": 200,
    "msg": "成功",
    "result": {
        "time_pair": {
            "start": "2021-03-30 14:12:22.001010625",
            "end": "2021-03-30 14:12:23.000961867"
        },
        "data": 538
    }
}

5.9.26. 获取计算任务最新值-实时值

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_calculate_value 方法名
actionid String 活动标识
uid String 创建计算命题的时候生成的uid
  • 示例

{
    "action": "get_calculate_value",
    "uid":"CALCULATE1344002700003"
}
  • 返回

{
    "resp": "get_calculate_value",
    "code": 200,
    "msg": "成功",
    "result": {
        "time_pair": {
            "start": "2021-03-30 14:12:22.001010625",
            "end": "2021-03-30 14:12:23.000961867"
        },
        "data": 538
    }
}

5.9.27. 获取统计任务最新值-历史值

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_newest_statistics_value 方法名
actionid String 活动标识
uid String 创建计算命题的时候生成的uid
object_id String 创建计算命题的时候object_list中的对象
  • 示例
{
    "action": "get_newest_statistics_value",
    "uid":"STATISTICS1584816000007",
    "object_id":"OBJ1570163200002"
}
  • 返回
{
    "resp": "get_newest_statistics_value",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 668631,
        "name": "123",
        "script_uid": "STATISTICS1584816100008",
        "description": "(2021-05-18 15:04:00,2021-05-18 15:05:00) real(2021-05-18 15:04:03.017409582,2021-05-18 15:04:57.965702444) next(2021-05-18 15:04:57.965702444,2021-05-18 15:06:00)",
        "data": "10.0000",
        "object_id": "OBJ1570163200002",
        "mapping_id": "",
        "var_name": "RSTATISTICS1584816100008",
        "start_time": "2021-05-18T15:04:00+08:00",
        "end_time": "2021-05-18T15:05:00+08:00",
        "created": "2021-05-18T15:05:03+08:00",
        "is_available": 1
    }
}

5.9.28. 获取计算任务最新值-历史值

  • 描述
  • 格式
参数名称 是否必选 数据类型 数据约束 描述
action String get_newest_statistics_value 方法名
actionid String 活动标识
uid String 创建计算命题的时候生成的uid
object_id String 创建计算命题的时候object_list中的对象
  • 示例
{
    "action": "get_newest_statistics_value",
    "uid":"STATISTICS1584816000007",
    "object_id":"OBJ1570163200002"
}
  • 返回
{
    "resp": "get_newest_statistics_value",
    "code": 200,
    "msg": "成功",
    "result": {
        "id": 668631,
        "name": "123",
        "script_uid": "STATISTICS1584816100008",
        "description": "(2021-05-18 15:04:00,2021-05-18 15:05:00) real(2021-05-18 15:04:03.017409582,2021-05-18 15:04:57.965702444) next(2021-05-18 15:04:57.965702444,2021-05-18 15:06:00)",
        "data": "10.0000",
        "object_id": "OBJ1570163200002",
        "mapping_id": "",
        "var_name": "RSTATISTICS1584816100008",
        "start_time": "2021-05-18T15:04:00+08:00",
        "end_time": "2021-05-18T15:05:00+08:00",
        "created": "2021-05-18T15:05:03+08:00",
        "is_available": 1
    }
}

5.10. 任务执行

Mixiot支持通过Lua脚本程序建立不同的可执行任务,提供Mixiot其他应用服务调用执行;除了Lua基本语法逻辑、还支持Mixiot相关命令函数,实现mixiot不同操作。

5.10.1. 创建任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String create_task 方法名
actionid String 请求标识
uid String 最多64个字符,唯一 自定义唯一标识,不填则系统生成
name String 最多64个字符 名称,显示名称
description String 最多255个字符 描述
script String 脚本
reference String 最多64个字符 参考号
  • 示例
{
    "action":"create_task",
    "actionid": "2021-06-09",
    "uid": "TASK1735011100022",
    "name": "demo",
    "description": "无",
    "script": "\nlocal log = require(\"log\")\nlocal json = require(\"json\")\nlocal http = require(\"http\")\nlocal math = require(\"math\")\nlocal exmath = require(\"exmath\")\nlog.info('test log')\na = {1,2,3,4.5}\nlog.info(exmath.max(a))\nlog.info(exmath.min(a))\nlog.info(exmath.sum(a))\nlog.info(exmath.average(a))\nlog.info(exmath.var(a))\nlog.info(exmath.std(a))\n  \nresponse, error_message = http.post(\"http://192.168.88.88:31507/apiproxy/api\", {\n\tbody='{\"action\":\"get_object_list\"}'\n})\nprint(response[\"body\"],error_message)\n\nprint(a,math.pi)\nmath.randomseed(os.time())\na=math.random(100)\nprint(data)\nlog.info(data)\nlog.info(data[\"data\"])\n\t",
    "reference": ""
}
  • 响应
{
    "resp": "create_task",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TASK1735011100022",
        "name": "demo"
    }
}

5.10.2. 更新任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String update_task 方法名
actionid String 请求标识
uid String 最多64个字符,唯一 自定义唯一标识
name String 最多64个字符 名称,显示名称
description String 最多255个字符 描述
script String 脚本
reference String 最多64个字符 参考号
  • 示例
{
    "action":"update_task",
    "actionid": "2021-06-09",
    "uid": "TASK1735011100022",
    "name": "关机任务",
    "description": "指定设备进行远程关机",
    "script": "",
    "reference": ""
}
  • 响应
{
    "resp": "update_task",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TASK1735011100022",
        "name": "关机任务"
    }
}

5.10.3. 删除任务

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String delete_task 方法名
actionid String 请求标识
uid String 最多64个字符,唯一 任务编号
  • 示例
{
    "action":"delete_task",
    "actionid": "2021-06-09",
    "uid": "TASK1735011100022"
}
  • 响应
{
    "resp": "delete_task",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TASK1735011100022"
    }
}

5.10.4. 获取任务详情

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_task_item 方法名
actionid String 请求标识
uid String 最多64个字符,唯一 任务编号
  • 示例
{
    "action":"get_task_item",
    "actionid": "2021-06-09",
    "uid": "TASK1735011100022"
}
  • 响应
{
    "resp": "get_task_item",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "TASK1735011100022",
        "name": "demo",
        "description": "无",
        "script": "\nlocal log = require(\"log\")\nlocal json = require(\"json\")\nlocal http = require(\"http\")\nlocal math = require(\"math\")\nlocal exmath = require(\"exmath\")\nlog.info('test log')\na = {1,2,3,4.5}\nlog.info(exmath.max(a))\nlog.info(exmath.min(a))\nlog.info(exmath.sum(a))\nlog.info(exmath.average(a))\nlog.info(exmath.var(a))\nlog.info(exmath.std(a))\n  \nresponse, error_message = http.post(\"http://192.168.88.88:31507/apiproxy/api\", {\n\tbody='{\"action\":\"get_object_list\"}'\n})\nprint(response[\"body\"],error_message)\n\nprint(a,math.pi)\nmath.randomseed(os.time())\na=math.random(100)\nprint(data)\nlog.info(data)\nlog.info(data[\"data\"])\n\t",
        "checksum": "337a26e20b76d064bed31101151b8d65",
        "token": "f95abbe6-4e11-05ce-ac4d-de1f7d60d236",
        "reference": "",
        "created": "2021-07-12 15:54:38",
        "created_by": "",
        "last_modified": "",
        "last_modified_by": ""
    }
}

5.10.5. 执行任务(执行一次)

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String exec_task 方法名
actionid String 请求标识
uid String 最多64个字符,唯一 任务编号
args json 参数列表
source String 最多64个字符 调用来源,如workflow
token String 任务校验令牌
  • 示例
{
 "action":"exec_task",
 "actionid": "2021-06-09",
 "uid":"TASK1735011100022",
 "args":{"data":"123"},
 "source":"workflow",
 "token":"5c00c2c9-2a29-971e-bb7f-8b4476f63446"
}
  • 响应
{
    "resp": "exec_task",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "RECORD1725270300001"
    }
}

5.10.6. 停止任务(中止执行)

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String stop_task 方法名
actionid String 请求标识
uid String 最多64个字符,唯一 执行记录的编号
  • 示例
{
    "action": "stop_task",
    "actionid": "2021-06-09",
    "uid": "RECORD1725270300001"
}
  • 响应
{
    "resp": "stop_task",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {}
}

5.10.7. 获取执行记录详情

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String get_record_item 方法名
actionid String 请求标识
uid String 执行记录的编号
  • 示例
{
    "action": "get_record_item",
    "actionid": "2021-06-09",
    "uid": "RECORD1725270300001"
}
  • 响应
{
    "resp": "get_record_item",
    "actionid": "2021-06-09",
    "code": 200,
    "msg": "成功",
    "result": {
        "uid": "RECORD1725270300001",
        "task_id": "TASK1735011100022",
        "source": "workflow",
        "ip": "",
        "args": {
            "data": "123"
        },
        "script": "\nlocal log = require(\"log\")\nlocal json = require(\"json\")\nlocal http = require(\"http\")\nlocal math = require(\"math\")\nlocal exmath = require(\"exmath\")\nlog.info('test log')\na = {1,2,3,4.5}\nlog.info(exmath.max(a))\nlog.info(exmath.min(a))\nlog.info(exmath.sum(a))\nlog.info(exmath.average(a))\nlog.info(exmath.var(a))\nlog.info(exmath.std(a))\n  \nresponse, error_message = http.post(\"http://192.168.88.88:31507/apiproxy/api\", {\n\tbody='{\"action\":\"get_object_list\"}'\n})\nprint(response[\"body\"],error_message)\n\nprint(a,math.pi)\nmath.randomseed(os.time())\na=math.random(100)\nprint(data)\nlog.info(data)\nlog.info(data[\"data\"])\n\t",
        "exec_time": "2021-07-12 18:00:53",
        "code": "200",
        "message": "",
        "is_finish": 1,
        "reference": "",
        "last_modified": "2021-07-12 18:00:54"
    }
}

5.10.8. 获取执行日志信息

此接口需要使用websocket方式(或TCP方式),实时获取任务执行的打印日志信息

  • 参数
参数名称 是否必选 数据类型 数据约束 描述
action String sub_task_log 方法名
actionid String 请求标识
uid String 执行记录的编号
  • 示例
{
    "action": "sub_task_log",
    "actionid": "2021-06-09",
    "uid": "RECORD1725270300001"
}
  • 响应
{
    "log": "[2021/08/12 10:54:10.691] RECORD1825565000001:8:[ --15-- ]"
}

响应结果是一条一条实时返回的信息,log是响应字段。其中

  • [2021/08/12 10:54:10.691] 是日志时间

  • RECORD1825565000001 是 执行记录编号

  • 8 是lua脚本行数

  • [ --15-- ] 是 返回的具体打印日志信息

© Mixlinker all right reserved,powered by Gitbook文件修订时间: 2021-11-16 17:24:18

results matching ""

    No results matching ""

    results matching ""

      No results matching ""