Merge "Add Swagger Related Configurations"
[holmes/rule-management.git] / rulemgt / src / main / resources / 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), \"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       }
163     },
164     "RuleQueryListResponse" : {
165       "type" : "object",
166       "properties" : {
167         "rules" : {
168           "type" : "array",
169           "items" : {
170             "$ref" : "#/definitions/RuleResult4API"
171           }
172         },
173         "totalcount" : {
174           "type" : "integer",
175           "format" : "int32"
176         }
177       }
178     },
179     "RuleResult4API" : {
180       "type" : "object",
181       "properties" : {
182         "description" : {
183           "type" : "string"
184         },
185         "content" : {
186           "type" : "string"
187         },
188         "creator" : {
189           "type" : "string"
190         },
191         "modifier" : {
192           "type" : "string"
193         },
194         "enabled" : {
195           "type" : "integer",
196           "format" : "int32"
197         },
198         "ruleid" : {
199           "type" : "string"
200         },
201         "rulename" : {
202           "type" : "string"
203         },
204         "createtime" : {
205           "type" : "string",
206           "format" : "date-time"
207         },
208         "updatetime" : {
209           "type" : "string",
210           "format" : "date-time"
211         }
212       }
213     },
214     "RuleUpdateRequest" : {
215       "type" : "object",
216       "properties" : {
217         "description" : {
218           "type" : "string"
219         },
220         "content" : {
221           "type" : "string"
222         },
223         "enabled" : {
224           "type" : "integer",
225           "format" : "int32"
226         },
227         "ruleid" : {
228           "type" : "string"
229         }
230       }
231     }
232   }
233 }