订阅会检测实体的创建和更新,但不会检测到实体的移除。
POST http://myhost:orion_port/v2/subscriptions
{
"description": "Send a notification to detect any change",
"subject": {
"entities": [{
"idPattern": ".*"
}]
},
"notification": {
"http": {
"url": "http://myhost:myport/myendpoint"
}
}
}
POST http://myhost:iot_aget_json_port/iot/devices
{
"devices": [{
"device_id": "entity_test_agent",
"entity_name": "entity_test_orion",
"entity_type": "test",
"transport": "HTTP",
"protocol": "IoTA-JSON",
"attributes": [{
"object_id": "status",
"name": "status",
"type": "Text"
}],
"static_attributes": [{
"name": "name",
"type": "Text",
"value": "Test"
}]
}]
}
输入http://myhost:orion_port/v2/entities/entity_test_orion/attrs/name
{
"value": true
}
删除http://myhost:orion_port/v2/entities/entity_test_orion
删除http://myhost:iot_aget_json_port/iot/devices/entity_test_agent
首先,我发送订阅创建以检测实体中的更改。
此后,我创建了一个实体,并且订阅得以顺利执行。然后,我更新了实体名称,并再次完美地收到了预订,但是如果删除实体,我将不会收到任何事件。
有什么方法可以接收订阅事件以检测何时删除实体?
答案 0 :(得分:1)
很遗憾,没有订阅处理删除事件