ce9a693d5d38269cfae84e65690efbe911782bd6
[holmes/rule-management.git] / api / swagger.json
1 {
2   "swagger" : "2.0",
3   "info" : {
4     "description" : "This page shows all the APIs available in the Holmes rule management module.",
5     "version" : "v1",
6     "title" : "API Descriptions for Holmes Rule Management",
7     "termsOfService" : "http://www.github.com/kongchen/swagger-maven-plugin",
8     "contact" : {
9       "name" : "Guangrong Fu",
10       "email" : "fu.guangrong@zte.com.cn"
11     },
12     "license" : {
13       "name" : "Apache 2.0",
14       "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
15     }
16   },
17   "basePath" : "/api/holmes-rule-mgmt/v1/",
18   "tags" : [ {
19     "name" : "Health Check"
20   }, {
21     "name" : "Holmes Rule Management"
22   } ],
23   "paths" : {
24     "/healthcheck" : {
25       "get" : {
26         "tags" : [ "Health Check" ],
27         "summary" : "Interface for the health check of the rule management module for Holmes",
28         "description" : "",
29         "operationId" : "healthCheck",
30         "produces" : [ "text/plain" ],
31         "responses" : {
32           "200" : {
33             "description" : "successful operation",
34             "schema" : {
35               "type" : "boolean"
36             }
37           }
38         }
39       }
40     },
41     "/rule" : {
42       "get" : {
43         "tags" : [ "Holmes Rule Management" ],
44         "summary" : "Query rules using certain criteria.",
45         "description" : "",
46         "operationId" : "getCorrelationRules",
47         "produces" : [ "application/json" ],
48         "parameters" : [ {
49           "name" : "queryrequest",
50           "in" : "query",
51           "description" : "A JSON string used as a query parameter, which comprises \"ruleId\"(optional), \"ruleName\"(optional), \"creator\"(optional), \"modifier\"(optional) and \"enabled\"(optional). E.g. {\"ruleId\":\"rule_1484727187317\"}",
52           "required" : false,
53           "type" : "string"
54         } ],
55         "responses" : {
56           "200" : {
57             "description" : "successful operation",
58             "schema" : {
59               "$ref" : "#/definitions/RuleQueryListResponse"
60             }
61           }
62         }
63       },
64       "post" : {
65         "tags" : [ "Holmes Rule Management" ],
66         "summary" : "Update an existing rule; deploy it to the Drools engine if it is enabled.",
67         "description" : "",
68         "operationId" : "updateCorrelationRule",
69         "produces" : [ "application/json" ],
70         "parameters" : [ {
71           "in" : "body",
72           "name" : "body",
73           "description" : "The request entity of the HTTP call, which comprises \"ruleId\"(required), \"content\"(required), \"enabled\"(required) and \"description\"(optional)",
74           "required" : true,
75           "schema" : {
76             "$ref" : "#/definitions/RuleUpdateRequest"
77           }
78         } ],
79         "responses" : {
80           "200" : {
81             "description" : "successful operation",
82             "schema" : {
83               "$ref" : "#/definitions/RuleAddAndUpdateResponse"
84             }
85           }
86         }
87       },
88       "put" : {
89         "tags" : [ "Holmes Rule Management" ],
90         "summary" : "Save a rule into the database; deploy it to the Drools engine if it is enabled.",
91         "description" : "",
92         "operationId" : "addCorrelationRule",
93         "produces" : [ "application/json" ],
94         "parameters" : [ {
95           "in" : "body",
96           "name" : "body",
97           "description" : "The request entity of the HTTP call, which comprises \"ruleName\"(required), \"loopControlName\"(required), \"content\"(required), \"enabled\"(required) and \"description\"(optional)",
98           "required" : true,
99           "schema" : {
100             "$ref" : "#/definitions/RuleCreateRequest"
101           }
102         } ],
103         "responses" : {
104           "200" : {
105             "description" : "successful operation",
106             "schema" : {
107               "$ref" : "#/definitions/RuleAddAndUpdateResponse"
108             }
109           }
110         }
111       }
112     },
113     "/rule/{ruleId}" : {
114       "delete" : {
115         "tags" : [ "Holmes Rule Management" ],
116         "summary" : "Remove a rule from Holmes.",
117         "description" : "",
118         "operationId" : "deleteCorrelationRule",
119         "produces" : [ "application/json" ],
120         "parameters" : [ {
121           "name" : "ruleId",
122           "in" : "path",
123           "required" : true,
124           "type" : "string"
125         } ],
126         "responses" : {
127           "200" : {
128             "description" : "successful operation",
129             "schema" : {
130               "type" : "boolean"
131             }
132           }
133         }
134       }
135     }
136   },
137   "definitions" : {
138     "RuleAddAndUpdateResponse" : {
139       "type" : "object",
140       "properties" : {
141         "ruleId" : {
142           "type" : "string"
143         }
144       }
145     },
146     "RuleCreateRequest" : {
147       "type" : "object",
148       "properties" : {
149         "description" : {
150           "type" : "string"
151         },
152         "content" : {
153           "type" : "string"
154         },
155         "enabled" : {
156           "type" : "integer",
157           "format" : "int32"
158         },
159         "ruleName" : {
160           "type" : "string"
161         },
162         "loopControlName" : {
163           "type" : "string"
164         }
165       }
166     },
167     "RuleQueryListResponse" : {
168       "type" : "object",
169       "properties" : {
170         "correlationRules" : {
171           "type" : "array",
172           "items" : {
173             "$ref" : "#/definitions/RuleResult4API"
174           }
175         },
176         "totalCount" : {
177           "type" : "integer",
178           "format" : "int32"
179         }
180       }
181     },
182     "RuleResult4API" : {
183       "type" : "object",
184       "properties" : {
185         "description" : {
186           "type" : "string"
187         },
188         "content" : {
189           "type" : "string"
190         },
191         "creator" : {
192           "type" : "string"
193         },
194         "modifier" : {
195           "type" : "string"
196         },
197         "enabled" : {
198           "type" : "integer",
199           "format" : "int32"
200         },
201         "ruleId" : {
202           "type" : "string"
203         },
204         "ruleName" : {
205           "type" : "string"
206         },
207         "createtime" : {
208           "type" : "string",
209           "format" : "date-time"
210         },
211         "updatetime" : {
212           "type" : "string",
213           "format" : "date-time"
214         },
215         "loopControlName" : {
216           "type" : "string"
217         }
218       }
219     },
220     "RuleUpdateRequest" : {
221       "type" : "object",
222       "properties" : {
223         "description" : {
224           "type" : "string"
225         },
226         "content" : {
227           "type" : "string"
228         },
229         "enabled" : {
230           "type" : "integer",
231           "format" : "int32"
232         },
233         "ruleId" : {
234           "type" : "string"
235         },
236         "loopControlName" : {
237           "type" : "string"
238         }
239       }
240     }
241   }
242 }