创建场景
开发中POST
/api/v1/scene请求参数
Body 参数application/json
name
string
场景名称
description
string
场景描述
actions
array [object {6}]
场景动作列表
action_type
string
必需
动作类型
10: 单个设备;
11: 单类设备
30 : 触发告警
40: 服务
action_target
string
必需
动作目标id,如设备id、设备配置id,场景id、告警id
action_param_type
string
可选
参数类型
TEL:遥测
ATTR:属性
CMD:命令
action_param
string
必需
动作类型为10,11时为具体参数; 当动作类型是30时,固定为 {间隔时间}, 单位 分
action_value
string
可选
目标值, 当动作类型是30时,记录上次触发时间
remark
string
可选
示例
{
"name": "yanhao",
"description": "haoyan",
"actions": [
{
"action_type": "10",
"action_target": "1",
"action_param_type": "2",
"action_param": "3",
"action_value": "4",
"remark": "5"
},
{
"action_type": "10",
"action_target": "3",
"action_param_type": "11",
"action_param": "44",
"action_value": "55",
"remark": "remark"
}
]
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
必需
message
string
必需
data
object
必需
scene_id
string
必需
示例
{
"code": 200,
"message": "create scene successfully",
"data": {
"scene_id": "e3969cc5-a741-99c2-e442-e3e44da95655"
}
}
最后修改时间: 9 months ago