Add Swagger Related Configurations
[holmes/rule-management.git] / rulemgt / src / main / resources / swagger.json
diff --git a/rulemgt/src/main/resources/swagger.json b/rulemgt/src/main/resources/swagger.json
new file mode 100644 (file)
index 0000000..748a311
--- /dev/null
@@ -0,0 +1,233 @@
+{
+  "swagger" : "2.0",
+  "info" : {
+    "description" : "This page shows all the APIs available in the Holmes rule management module.",
+    "version" : "v1",
+    "title" : "API Descriptions for Holmes Rule Management",
+    "termsOfService" : "http://www.github.com/kongchen/swagger-maven-plugin",
+    "contact" : {
+      "name" : "Guangrong Fu",
+      "email" : "fu.guangrong@zte.com.cn"
+    },
+    "license" : {
+      "name" : "Apache 2.0",
+      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
+    }
+  },
+  "basePath" : "/api/holmes-rule-mgmt/v1/",
+  "tags" : [ {
+    "name" : "Health Check"
+  }, {
+    "name" : "Holmes Rule Management"
+  } ],
+  "paths" : {
+    "/healthcheck" : {
+      "get" : {
+        "tags" : [ "Health Check" ],
+        "summary" : "Interface for the health check of the rule management module for Holmes",
+        "description" : "",
+        "operationId" : "healthCheck",
+        "produces" : [ "text/plain" ],
+        "responses" : {
+          "200" : {
+            "description" : "successful operation",
+            "schema" : {
+              "type" : "boolean"
+            }
+          }
+        }
+      }
+    },
+    "/rule" : {
+      "get" : {
+        "tags" : [ "Holmes Rule Management" ],
+        "summary" : "Query rules using certain criteria.",
+        "description" : "",
+        "operationId" : "getCorrelationRules",
+        "produces" : [ "application/json" ],
+        "parameters" : [ {
+          "name" : "queryrequest",
+          "in" : "query",
+          "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\"}",
+          "required" : false,
+          "type" : "string"
+        } ],
+        "responses" : {
+          "200" : {
+            "description" : "successful operation",
+            "schema" : {
+              "$ref" : "#/definitions/RuleQueryListResponse"
+            }
+          }
+        }
+      },
+      "post" : {
+        "tags" : [ "Holmes Rule Management" ],
+        "summary" : "Update an existing rule; deploy it to the Drools engine if it is enabled.",
+        "description" : "",
+        "operationId" : "updateCorrelationRule",
+        "produces" : [ "application/json" ],
+        "parameters" : [ {
+          "in" : "body",
+          "name" : "body",
+          "description" : "The request entity of the HTTP call, which comprises \"ruleid\"(required), \"content\"(required), \"enabled\"(required) and \"description\"(optional)",
+          "required" : true,
+          "schema" : {
+            "$ref" : "#/definitions/RuleUpdateRequest"
+          }
+        } ],
+        "responses" : {
+          "200" : {
+            "description" : "successful operation",
+            "schema" : {
+              "$ref" : "#/definitions/RuleAddAndUpdateResponse"
+            }
+          }
+        }
+      },
+      "put" : {
+        "tags" : [ "Holmes Rule Management" ],
+        "summary" : "Save a rule into the database; deploy it to the Drools engine if it is enabled.",
+        "description" : "",
+        "operationId" : "addCorrelationRule",
+        "produces" : [ "application/json" ],
+        "parameters" : [ {
+          "in" : "body",
+          "name" : "body",
+          "description" : "The request entity of the HTTP call, which comprises \"rulename\"(required), \"content\"(required), \"enabled\"(required) and \"description\"(optional)",
+          "required" : true,
+          "schema" : {
+            "$ref" : "#/definitions/RuleCreateRequest"
+          }
+        } ],
+        "responses" : {
+          "200" : {
+            "description" : "successful operation",
+            "schema" : {
+              "$ref" : "#/definitions/RuleAddAndUpdateResponse"
+            }
+          }
+        }
+      }
+    },
+    "/rule/{ruleid}" : {
+      "delete" : {
+        "tags" : [ "Holmes Rule Management" ],
+        "summary" : "Remove a rule from Holmes.",
+        "description" : "",
+        "operationId" : "deleteCorrelationRule",
+        "produces" : [ "application/json" ],
+        "parameters" : [ {
+          "name" : "ruleid",
+          "in" : "path",
+          "required" : true,
+          "type" : "string"
+        } ],
+        "responses" : {
+          "200" : {
+            "description" : "successful operation",
+            "schema" : {
+              "type" : "boolean"
+            }
+          }
+        }
+      }
+    }
+  },
+  "definitions" : {
+    "RuleAddAndUpdateResponse" : {
+      "type" : "object",
+      "properties" : {
+        "ruleid" : {
+          "type" : "string"
+        }
+      }
+    },
+    "RuleCreateRequest" : {
+      "type" : "object",
+      "properties" : {
+        "description" : {
+          "type" : "string"
+        },
+        "content" : {
+          "type" : "string"
+        },
+        "enabled" : {
+          "type" : "integer",
+          "format" : "int32"
+        },
+        "rulename" : {
+          "type" : "string"
+        }
+      }
+    },
+    "RuleQueryListResponse" : {
+      "type" : "object",
+      "properties" : {
+        "rules" : {
+          "type" : "array",
+          "items" : {
+            "$ref" : "#/definitions/RuleResult4API"
+          }
+        },
+        "totalcount" : {
+          "type" : "integer",
+          "format" : "int32"
+        }
+      }
+    },
+    "RuleResult4API" : {
+      "type" : "object",
+      "properties" : {
+        "description" : {
+          "type" : "string"
+        },
+        "content" : {
+          "type" : "string"
+        },
+        "creator" : {
+          "type" : "string"
+        },
+        "modifier" : {
+          "type" : "string"
+        },
+        "enabled" : {
+          "type" : "integer",
+          "format" : "int32"
+        },
+        "ruleid" : {
+          "type" : "string"
+        },
+        "rulename" : {
+          "type" : "string"
+        },
+        "createtime" : {
+          "type" : "string",
+          "format" : "date-time"
+        },
+        "updatetime" : {
+          "type" : "string",
+          "format" : "date-time"
+        }
+      }
+    },
+    "RuleUpdateRequest" : {
+      "type" : "object",
+      "properties" : {
+        "description" : {
+          "type" : "string"
+        },
+        "content" : {
+          "type" : "string"
+        },
+        "enabled" : {
+          "type" : "integer",
+          "format" : "int32"
+        },
+        "ruleid" : {
+          "type" : "string"
+        }
+      }
+    }
+  }
+}
\ No newline at end of file