Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
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 |
|
---|
Operation | Deleting a Rule |
---|
URL | api/holmes-rule-mgmt/v1/rule/{ruleid} |
---|
Method | DELETE |
---|
Request | Field Name | Mandatory | Data Type | Default Value | Description |
---|
ruleid | Y | string |
| the id of the rule which is to be deleted |
|
---|
Response | Success Code | 200 |
---|
Error Code | 499 |
---|
Message on Success | none |
---|
Message on Error | { "code": 499, "message": "The detailed error message is displayed here." } |
---|
Field Name | Description |
---|
code | the error code returned from the server | message | the detailed message if any error occurs |
|
---|
Operation | Querying Rules |
---|
URL | api/holmes-rule-mgmt/v1/rule |
---|
Method | GET |
---|
Request | Message Type | JSON String |
---|
Message | { “ruleid": "ruleid0937261", "rulename": "Alarm Compression", "enabled": 0 } |
---|
Field Name | Mandatory | Data Type | Default Value | Description |
---|
ruleid | N | string |
| the id of the rule which is to be deleted | rulename | N | string |
| the name of the rule | enabled | N | integer |
| 0 or 1 which stands for "disabled" and "enabled" respectively. Both enabled and disabled rules will be returned if it's empty. |
|
---|
Response | Success Code | 200 |
---|
Error Code | 499 |
---|
Message on Success | { "rules": [ { "ruleid": "ruleid098271", "rulename": "Alarm Compression", "description": "The description of the rule.", "content": "template header\n ruleId\n package packageName...", "createtime": 1484188925231, "creator": "admin", "updatetime": 1485188925231, "modifier": "user1", "enabled": 0 } ], "totalcount": 1 } |
---|
Message on Error | { "code": 499, "message": "The detailed error message is displayed here." } |
---|
Field Name | Description |
---|
rules | an array contains all the rules which fulfill the query criteria | totalcount | the number of the rules which fulfill the query criteria | ruleid | the id of the rule | rulename | the name of the rule | description | the description of the rule which helps the users to tell one rule from another | content | the content of the rule which should be fully in compliance with the grammatical regulations of Drools | createtime | the time when the rule is created | creator | the id of the creator of the rule | updatetime | the time of the last modification | modifier | the id of the last user who has modified the rule | enabled | 0 or 1 which stands for "disabled" and "enabled" respectively | code | the error code returned from the server | message | the detailed message if any error occurs |
|
---|