Cancel Subscription on Cygnus

戏子无情 提交于 2020-01-02 09:52:12

问题


I have a subscription made to an entity's attribute to a MySql sink. The problem is that while I was testing my rest service to do a subscription if the data was not yet persisted, i made a ton of subscriptions. Now every time I do an update on the entity's attribute what happens is that the value is persisted a lot of times. Is there anyway of deleting a subscription without the subscriptionID?


回答1:


Yes, it is. First, you can list the existing subscriptions with the GET /v2/subscriptions operation (have a look to the draft NGSIv2 specification).

Once you have the IDs the unsubscribeContext operation:

(curl localhost:1026/v1/unsubscribeContext -s -S --header 'Content-Type: application/json' \
    --header 'Accept: application/json' -d @- | python -mjson.tool) <<EOF
{
    "subscriptionId": "51c0ac9ed714fb3b37d7d5a8"
}
EOF

I recommend to have a look to Orion context broker documenation.



来源:https://stackoverflow.com/questions/34354921/cancel-subscription-on-cygnus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!