Versions Compared

Key

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

{

"rulenameruleName": "Alarm Compression",

"loopcontrolnameloopControlName": "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

rulenameruleNameYstring
the name of the rule
loopcontrolnameloopControlNameYstring
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

 {

"ruleidruleId": "ruleid0281721"

}

Message on Error

{

"code": 499,

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

}

Field Name

Description

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

{

“ruleid“ruleId": "ruleid0937261",

"loopcontrolnameloopControlName": "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

ruleidruleIdYstring
the id of the rule which is being edited
loopcontrolnameloopControlNameYstring
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

 {

"ruleidruleId": "ruleid0281721"

}

Message on Error

{

"code": 499,

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

}

Field Name

Description

ruleidruleIdthe ruleid returned from the server
codethe error code returned from the server
messagethe detailed message if any error occurs

...

OperationQuerying Rules
URLapi/holmes-rule-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

 {

"rulescorrelationRules": [

{

"ruleidruleId": "ruleid098271",

"rulenameruleName": "Alarm Compression",

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

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

 "createtimecreateTime": 1484188925231,

"creator": "admin",

"updatetimeupdateTime": 1485188925231,

"modifier": "user1",

"enabled": 0

}

],

"totalcounttotalCount": 1

}

Message on Error

{

"code": 499,

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

}

Field Name

Description

rulescorrelationRulesan array contains all the rules which fulfill the query criteria
totalcounttotalCountthe number of the rules which fulfill the query criteria
ruleidruleIdthe id of the rule
rulenameruleNamethe 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
createtimecreateTimethe time when the rule is created
creatorthe id of the creator of the rule
updatetimeupdateTimethe 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