We use Orion to register subscriptions. There are two kinds of subscriptions in our application:
The problem is to distinguish the two, in order to present the user with only user-oriented subscriptions. Which field of the subscriptions can I use? It would be nice to have a field "type", for instance.
I agree with what Jose Manuel says, it would be a really nice feature.
In addition to his reply, in the meantime I think you can use "metadata" field in subscriptions for distinguish between user subscriptions and internal subscriptions. Just have in mind that this field is not supposed for this purposes and its kind a "dark" way to implement the behavior that you want.
Here is an example of a subscription creation with my approach. In this case you create a subscription with the metadata field "isInternal" that just tells you that this is an internal subscription. Then you can use another different metadata field as a token, just to identify a user subscription:
curl -X POST \
http://localhost:1026/v2/subscriptions \
-H 'Content-Type: application/json' \
-d '{
"description": "A subscription to get info about Room1",
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
],
"condition": {
"attrs": [
"temperature"
]
}
},
"notification": {
"http": {
"url": "http://localhost:1028/accumulate"
},
"attrs": ["temperature"],
"metadata": ["isInternal"]
}
}'
For more information about metadata field in subscriptions and his normal use please refer to this documentation.