Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
OperationCreating a Rule
URLapi/
correlation
holmes-rule-
mgt
mgmt/v1/rule
MethodPUT
Request
Message TypeJSON String
Message

{

"

rulename

ruleName": "Alarm Compression",

"loopControlName": "Control Loop Name",

"description": "This is the description of the rule.",

"content": "template header\n ruleId\n package packageName...",

"enabled": 0

}

Field Name

Mandatory

Data Type

Default Value

Description

rulename
ruleNameYstring
 

the name of the rule
loopControlNameYstring
the control loop name which is generated by CLAMP.
descriptionNstring
 

the description of the rule which helps the users to tell one rule from another
contentYstring
 

the content of the rule which should be fully in compliance with the grammatical regulations of Drools
enabledYinteger
 

0 or 1 which stands for "disabled" and "enabled" respectively
Response
Success Code200
Error Code499
Message on Success

 {

"

ruleid

ruleId": "ruleid0281721"

}

Message on Error

{

"code": 499,

"message": "The detailed error message is displayed here."

}

Field Name

Description

ruleid
ruleIdthe ruleid returned from the server
codethe error code returned from the server
messagethe detailed message if any error occurs
OperationModifying a Rule
URLapi/
correlation
holmes-rule-
mgt
mgmt/v1/rule
MethodPOST
Request
Message TypeJSON String
Message

{

“ruleid

“ruleId": "ruleid0937261",

"loopControlName": "Control Loop Name",

"description": "This is the description of the rule.",

"content": "template header\n ruleId\n package packageName...",

"enabled": 0

}

Field Name

Mandatory

Data Type

Default Value

Description

ruleid
ruleIdYstring
 

the id of the rule which is being edited
loopControlNameYstring
the control loop name which is generated by CLAMP.
descriptionNstring
 

the description of the rule which helps the users to tell one rule from another
contentYstring
 

the content of the rule which should be fully in compliance with the grammatical regulations of Drools
enabledYinteger
 

0 or 1 which stands for "disabled" and "enabled" respectively
Response
Success Code200
Error Code499
Message on Success

 {

"

ruleid

ruleId": "ruleid0281721"

}

Message on Error

{

"code": 499,

"message": "The detailed error message is displayed here."

}

Field Name

Description

ruleid
ruleIdthe ruleid returned from the server
codethe error code returned from the server
messagethe detailed message if any error occurs
OperationDeleting a Rule
URLapi/
correlation
holmes-rule-
mgt
mgmt/v1/rule/{ruleid}
MethodDELETE
Request
Message TypeJSON String
Message

{

“ruleid": "ruleid0937261"

}

Field Name

Mandatory

Data Type

Default Value

Description

ruleidYstring
 

the id of the rule which is to be deleted
Response
Success Code200
Error Code499
Message on Success

none

Message on Error

{

"code": 499,

"message": "The detailed error message is displayed here."

}

Field Name

Description

codethe error code returned from the server
messagethe detailed message if any error occurs
OperationQuerying Rules
URLapi/
correlation
holmes-rule-
mgt
mgmt/v1/rule
MethodGET
Request
Message TypeJSON String
Message

{

“ruleid": "ruleid0937261",

"rulename": "Alarm Compression",

"enabled": 0

}

Field Name

Mandatory

Data Type

Default Value

Description

ruleidNstring
 

the id of the rule which is to be deleted
rulenameNstring
 

the name of the rule
enabledNinteger
 

0 or 1 which stands for "disabled" and "enabled" respectively. Both enabled and disabled rules will be returned if it's empty.
Response
Success Code200
Error Code499
Message on Success

 {

"

rules

correlationRules": [

{

"

ruleid

ruleId": "ruleid098271",

"

rulename

ruleName": "Alarm Compression",

"description": "The description of the rule.",

"content": "template header\n ruleId\n package packageName...",

 "

createtime

createTime": 1484188925231,

"creator": "admin",

"

updatetime

updateTime": 1485188925231,

"modifier": "user1",

"enabled": 0

}

],

"

totalcount

totalCount": 1

}

Message on Error

{

"code": 499,

"message": "The detailed error message is displayed here."

}

Field Name

Description

rules
correlationRulesan array contains all the rules which fulfill the query criteria
totalcount
totalCountthe number of the rules which fulfill the query criteria
ruleid
ruleIdthe id of the rule
rulename
ruleNamethe name of the rule
descriptionthe description of the rule which helps the users to tell one rule from another
contentthe content of the rule which should be fully in compliance with the grammatical regulations of Drools
createtime
createTimethe time when the rule is created
creatorthe id of the creator of the rule
updatetime
updateTimethe time of the last modification
modifierthe id of the last user who has modified the rule
enabled0 or 1 which stands for "disabled" and "enabled" respectively
codethe error code returned from the server
messagethe detailed message if any error occurs