Rule Management - Beijing

Rule Management - Beijing

Operation

Creating a Rule

URL

api/holmes-rule-mgmt/v1/rule

Method

PUT

Request

Message Type

JSON String

Message

{

"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

Y

string



the name of the rule

loopControlName

Y

string



the control loop name which is generated by CLAMP.

description

N

string



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

content

Y

string



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

enabled

Y

integer



0 or 1 which stands for "disabled" and "enabled" respectively

Response

Success Code

200

Error Code

499

Message on Success

 {

"ruleId": "ruleid0281721"

}

Message on Error

{

"code": 499,

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

}

Field Name

Description

ruleId

the ruleid returned from the server

code

the error code returned from the server

message

the detailed message if any error occurs

Operation

Modifying a Rule

URL

api/holmes-rule-mgmt/v1/rule

Method

POST

Request

Message Type

JSON String

Message

{

“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

Y

string



the id of the rule which is being edited

loopControlName

Y

string



the control loop name which is generated by CLAMP.

description

N

string



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

content

Y

string



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

enabled

Y

integer



0 or 1 which stands for "disabled" and "enabled" respectively

Response

Success Code

200

Error Code

499

Message on Success

 {

"ruleId": "ruleid0281721"

}

Message on Error

{

"code": 499,

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

}

Field Name

Description

ruleId

the ruleid returned from the server

code

the error code returned from the server

message

the detailed message if any error occurs