1. Retainer接口文档

1.1. 获取列表

body:

{
    "action":"get_retainer_list"
}

curl:

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

response:

{
    "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,
                "category": "OTHER"
            },
            {
                "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,
                "category": "OTHER"
            }
        ]
    }
}

1.2. 获取项目

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

curl:

curl -X POST --data '{"action":"get_retainer_item","uid":"RETAINER1323077500001"}' http://127.0.0.1:6061/retainer/api

response:

{
    "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,
        "category": "OTHER"
    }
}

1.3. 创建项目

用于创建retainer项目。

body:

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

curl:

curl -X POST --data '{"action":"create_retainer","is_active":0,"description":"12164461","name":"test","script":[["a2b","a2b_en","a2b_cn","1001","1002"],["b2c","b2c_en","b2c_cn","1002","1003"]],"object_list":["1001","1002"],"category":"FAULT"}' http://127.0.0.1:6061/retainer/api

response:

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

1.4. 更新项目

body:

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

curl:

curl -X POST --data '{"action":"update_retainer","uid":"RETAINER1622294400001","description":"666666","name":"test111","script":[["a2b","a2b_en","a2b_cn","1001","1002"],["b2c","b2c_en","b2c_cn","1002","1003"]],"object_list":["OBJ_TEST1001"],"category":"EVENT"}' http://127.0.0.1:6061/retainer/api

response:

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

1.5. 删除项目

body:

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

curl:

curl -X POST --data '{"action":"delete_retainer","uid":"RETAINER1622294400001"}' http://127.0.0.1:6061/retainer/api

response:

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

1.6. 启动项目

body:

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

curl:

curl -X POST --data '{"action":"create_retainer","uid":"RETAINER1323077500001"}' http://127.0.0.1:6061/retainer/api

response:

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

1.7. 停止项目

body:

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

curl:

curl -X POST --data '{"action":"create_retainer","uid":"RETAINER1323077500001"}' http://127.0.0.1:6061/retainer/api

response:

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

1.8. 获取历程列表

body:

{
    "page_index": 1,
    "page_size": 20,
    "where_and": "[[\"object_id\",\"=\",\"OBJ1001\"],[\"retained\",\"=\",0],[\"category\",\"=\",\"FAULT\"]]",
    "action": "get_retainer_result_list",
    "organization_id":"ORGANIZATION1658222117234135"
}
retained 说明
1 开放状态
0 关闭状态
category 说明
EVENT 事件列表
ALERT 报警列表
FAULT 故障列表
OTHER 其他列表

response:

{
    "resp": "get_retainer_result_list",
    "code": 200,
    "msg": "成功",
    "result": {
        "page_index": 1,
        "page_size": 20,
        "total_pages": 1,
        "total_records": 0,
        "data": [
            {}
        ]
    }
}
文档更新时间: 2024-04-12 17:57   作者:技术支持