Rules Versions¶
List Rules Versions¶
User can get all the matching rules versions for the given conditions.
GET http://<domain>/MessageRouting/v2.0/versions
Below are the query parameters that can be used.
Parameter
Required
Values
Description
search_text
false
string
text search based on rule name and description.
start_time
false
string
Applied start datetime (DD-MMM-YYYY HH:mm:ss zzz). Default value Epoch time.
end_time
false
string
Applied end datetime (DD-MMM-YYYY HH:mm:ss zzz). Default is current date and time.
Click on GET /versions API in swagger and hit Try it out!
button , it will display all the routing rules as below :
[{
"rule_id": 61,
"user_id": null,
"status": "DELETED",
"applied_at": "22-Apr-2019 18:01:45.711",
"version": 2,
"metadata": null,
"routingRules": {
"input": {
"type": "",
"MQName": "",
"RoutingKey": "uKK6WjaZZnnYBj1G6rONQgNAIuc=",
"DirectExchange": "Direct.Exchange"
},
"RuleID": 61,
"Status": "Created",
"output": {
"Topic": "test1.*",
"TopicExchange": "testEx2"
},
"params": [{
"name": "feature",
"value": "abc"
},
{
"name": "sensorID",
"value": ""
},
{
"name": "time",
"value": {
"endtime": "",
"starttime": ""
}
},
{
"name": "expression",
"value": {
"if": "",
"else": "",
"then": ""
}
},
{
"name": "ObservedProperties",
"value": []
}
],
"RuleName": "test5",
"RuleDescription": "test5 for temp",
"parallelismFactor": 1
}
},
{
"rule_id": 61,
"user_id": "abc",
"status": "CREATED",
"applied_at": "19-Apr-2019 12:27:53.735",
"version": 1,
"metadata": null,
"routingRules": {
"input": {
"type": "",
"MQName": "",
"RoutingKey": "uKK6WjaZZnnYBj1G6rONQgNAIuc=",
"DirectExchange": "Direct.Exchange"
},
"RuleID": 61,
"Status": "Created",
"output": {
"Topic": "test1.*",
"TopicExchange": "testEx2"
},
"params": [{
"name": "feature",
"value": "abc"
},
{
"name": "sensorID",
"value": ""
},
{
"name": "time",
"value": {
"endtime": "",
"starttime": ""
}
},
{
"name": "expression",
"value": {
"if": "",
"else": "",
"then": ""
}
},
{
"name": "ObservedProperties",
"value": []
}
],
"RuleName": "test5",
"RuleDescription": "test5 for temp",
"parallelismFactor": 1
}
}]
Note
It displays the versions in a descending manner based on update time.
The swagger image for all the matching rules version for the given conditions are as follows:
List Versions for a Rule¶
User can get all the versions of a rule.
GET http://<domain>/MessageRouting/v2.0/versions/{rule_id}
The path parameters mentioned below are to be used.
Parameter
Required
Values
Description
rule_id
true
number
routing rule id.
Click on GET /versions/{rule_id} API in swagger and hit Try it out!
button , it will display details of versions of a rule as below:
[
{
"rule_id": 1,
"user_id": "abcd",
"status": "UPDATED",
"applied_at": "17-Apr-2019 15:56:03.094",
"version": 2,
"metadata": null,
"routingRules": {
"input": {
"type": "",
"MQName": "",
"RoutingKey": "uKK6WjaZZnnYBj1G6rONQgNAIuc=",
"DirectExchange": "Direct.Exchange"
},
"RuleID": 1,
"Status": "Created",
"output": {
"Topic": "test1.*",
"TopicExchange": "testEx2"
},
"params": [{
"name": "feature",
"value": "abc"
},
{
"name": "sensorID",
"value": ""
},
{
"name": "time",
"value": {
"endtime": "",
"starttime": ""
}
},
{
"name": "expression",
"value": {
"if": "",
"else": "",
"then": ""
}
},
{
"name": "ObservedProperties",
"value": []
}
],
"RuleName": "test1",
"RuleDescription": "test1-test2",
"parallelismFactor": 1
}
},
{
"rule_id": 1,
"user_id": "abcd",
"status": "CREATED",
"applied_at": "17-Apr-2019 12:21:09.831",
"version": 1,
"metadata": null,
"routingRules": {
"input": {
"type": "",
"MQName": "",
"RoutingKey": "uKK6WjaZZnnYBj1G6rONQgNAIuc=",
"DirectExchange": "Direct.Exchange"
},
"RuleID": 1,
"Status": "Created",
"output": {
"Topic": "test1.*",
"TopicExchange": "testEx2"
},
"params": [{
"name": "feature",
"value": "abc"
},
{
"name": "sensorID",
"value": ""
},
{
"name": "time",
"value": {
"endtime": "",
"starttime": ""
}
},
{
"name": "expression",
"value": {
"if": "",
"else": "",
"then": ""
}
},
{
"name": "ObservedProperties",
"value": []
}
],
"RuleName": "test1",
"RuleDescription": "test1",
"parallelismFactor": 1
}
}
]
Note
It displays the versions in a descending manner based on update time.
The swagger image for get all version of rule is as follows:
Get a Version of a Rule¶
User can get the version of a specific rule.
GET http://<domain>/MessageRouting/v2.0/versions/{rule_id}/{version}
Click on GET /versions/{rule_id}/{version} API in swagger and hit Try it out!
button , it will display details of the version of the rule as mentioned below:
{
"rule_id": 1,
"user_id": "abcd",
"status": "UPDATED",
"applied_at": "17-Apr-2019 15:56:13.211",
"version": 3,
"metadata": null,
"routingRules": {
"input": {
"type": "",
"MQName": "",
"RoutingKey": "uKK6WjaZZnnYBj1G6rONQgNAIuc=",
"DirectExchange": "Direct.Exchange"
},
"RuleID": 1,
"Status": "Created",
"output": {
"Topic": "test1.*",
"TopicExchange": "testEx2"
},
"params": [{
"name": "feature",
"value": "abc"
},
{
"name": "sensorID",
"value": ""
},
{
"name": "time",
"value": {
"endtime": "",
"starttime": ""
}
},
{
"name": "expression",
"value": {
"if": "",
"else": "",
"then": ""
}
},
{
"name": "ObservedProperties",
"value": []
}
],
"RuleName": "test1",
"RuleDescription": "test1-test3",
"parallelismFactor": 1
}
}
Below are the description of each parameters of the above JSON.
Parameter
Values
Description
rule_id
number
Rule id.
user_id
string
User id.
status
string
status possible values are CREATED/UPDATED/DELETED.
applied_at
string
Applied time-stamp
version
number
Rule version number
metadata
string
currently not used , kept for future use
routingRules
JSON
Routing rule JSON.
The swagger image to get a specific rule statistics is as follows: