取消订阅天鹅座 [英] Cancel Subscription on Cygnus
问题描述
我对MySql接收器的实体属性进行了订阅.问题是,当我测试我的休息服务以进行订阅(如果数据尚未持久)时,我进行了大量的订阅.现在,每次我对实体的属性进行更新时,都会发生一次,该值被保留了很多次.无论如何,是否可以删除没有subscriptionID的订阅?
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?
推荐答案
是的.首先,您可以使用GET /v2/subscriptions
操作列出现有的订阅(查看 NGSIv2规范草案).
Yes, it is. First, you can list the existing subscriptions with the GET /v2/subscriptions
operation (have a look to the draft NGSIv2 specification).
一旦有了ID,就会执行unsubscribeContext操作:
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
我建议看看 Orion上下文代理文档.
这篇关于取消订阅天鹅座的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!