简体   繁体   中英

Orion subscriptions do not detect the removal of entities

Subscriptions detect the creation and update of entities but do not detect the removal of entities.

  • Subscription creation:

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"
        }
    }
}
  • Entity creation:

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"
        }]
    }]

}

  • Entity update:

PUT http://myhost:orion_port/v2/entities/entity_test_orion/attrs/name

{
     "value": true
}
  • Delete entity:

DELETE http://myhost:orion_port/v2/entities/entity_test_orion

DELETE http://myhost:iot_aget_json_port/iot/devices/entity_test_agent

First, I send the subscription creation to detect changes in entities.

Later, I create an entity and the subscription is executed without problems. Then I update the entity name and I receive the subscription again perfectly, but if I delete the entity I do not receive any event.

There are any way to receive subscription events to detect when an entity is deleted?

不幸的是,没有订阅处理删除事件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM