Add swagger-sdk support for MSB service (sdk) 29/13929/3
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 20 Sep 2017 16:01:29 +0000 (21:31 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Thu, 21 Sep 2017 14:32:35 +0000 (20:02 +0530)
It adds required changes to create the java sdk
at build time for MSB services.

MSB-78

Change-Id: I84f37e01100f9b55ad231e419d6c3d3e42390a13
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
apiroute/apiroute-service/dependency-reduced-pom.xml
apiroute/apiroute-service/pom.xml
apiroute/apiroute-service/src/main/resources/swagger.json [new file with mode: 0644]

index 4c53010..5189658 100644 (file)
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.8</version>
+        <executions>
+          <execution>
+            <id>ant-create-script</id>
+            <phase>initialize</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <exportAntProperties>true</exportAntProperties>
+              <tasks>
+                <taskdef />
+                <condition>
+                  <os />
+                </condition>
+                <condition>
+                  <os />
+                </condition>
+                <if>
+                  <equals />
+                  <then>
+                    <property />
+                    <echo />
+                    <echo />
+                  </then>
+                  <else>
+                    <property />
+                    <echo />
+                    <echo />
+                    <chmod />
+                  </else>
+                </if>
+              </tasks>
+            </configuration>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>ant-contrib</groupId>
+            <artifactId>ant-contrib</artifactId>
+            <version>1.0b3</version>
+            <exclusions>
+              <exclusion>
+                <artifactId>ant</artifactId>
+                <groupId>ant</groupId>
+              </exclusion>
+            </exclusions>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
+        <groupId>io.swagger</groupId>
+        <artifactId>swagger-codegen-maven-plugin</artifactId>
+        <version>2.2.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate</goal>
+            </goals>
+            <configuration>
+              <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
+              <output>${project.build.directory}/generated-sources</output>
+              <language>java</language>
+              <configOptions>
+                <dateLibrary>joda</dateLibrary>
+              </configOptions>
+              <library>jersey2</library>
+              <groupId>${project.groupId}</groupId>
+              <artifactId>${project.artifactId}-java-sdk</artifactId>
+              <artifactVersion>${project.version}</artifactVersion>
+              <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
+              <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
+              <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.5.0</version>
+        <executions>
+          <execution>
+            <id>swagger-generate-sources</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-clean-plugin</artifactId>
+        <version>3.0.0</version>
+        <executions>
+          <execution>
+            <id>clean-generated-files</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>clean</goal>
+            </goals>
+            <configuration>
+              <filesets>
+                <fileset>
+                  <directory>${project.build.directory}/generated-sources</directory>
+                </fileset>
+              </filesets>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
   <dependencies>
index 3502768..d328521 100644 (file)
           <groupId>org.onap.msb.swagger-sdk</groupId>
           <artifactId>swagger-sdk</artifactId>
           <version>1.0.0-SNAPSHOT</version>
-        </dependency>
+          <exclusions>
+              <exclusion>
+                  <groupId>org.slf4j</groupId>
+                  <artifactId>slf4j-log4j12</artifactId>
+              </exclusion>
+          </exclusions>
+      </dependency>
 
        </dependencies>
        <build>
                                                </execution>
                                        </executions>
                                </plugin>
+
+                               <!-- SDK -->
+                               <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-antrun-plugin</artifactId>
+                               <version>1.8</version>
+                               <executions>
+                                 <execution>
+                                       <phase>initialize</phase>
+                                       <id>ant-create-script</id>
+                                       <configuration>
+                                         <exportAntProperties>true</exportAntProperties>
+                                         <tasks>
+                                               <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="maven.plugin.classpath"/>
+                                               <condition property="is_windows" value="true">
+                                                 <os family="windows"/>
+                                               </condition>
+                                               <condition property="isLinux" value="true">
+                                                 <os family="unix"/>
+                                               </condition>
+                                               <if>
+                                                 <equals arg1="${is_windows}" arg2="true"/>
+                                                 <then>
+                                                       <property name="swagger.sdk.script.file" value="generated-source-script.bat"/>
+                                                       <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
+                                                       <echo file="${project.build.directory}${file.separator}generated-source-script.bat" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
+                                                 </then>
+                                                 <else>
+                                                       <property name="swagger.sdk.script.file" value="generated-source-script.sh"/>
+                                                       <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="cd ${project.build.directory}${file.separator}generated-sources${line.separator}"/>
+                                                       <echo file="${project.build.directory}${file.separator}generated-source-script.sh" append="true" message="mvn clean install -Dmaven.test.skip=true${line.separator}"/>
+                                                       <chmod file="${project.build.directory}${file.separator}generated-source-script.sh" perm="755"/>
+                                                 </else>
+                                               </if>
+                                         </tasks>
+                                       </configuration>
+                                       <goals>
+                                         <goal>run</goal>
+                                       </goals>
+                                 </execution>
+                               </executions>
+                               <dependencies>
+                                 <dependency>
+                                       <groupId>ant-contrib</groupId>
+                                       <artifactId>ant-contrib</artifactId>
+                                       <version>1.0b3</version>
+                                       <exclusions>
+                                         <exclusion>
+                                               <artifactId>ant</artifactId>
+                                               <groupId>ant</groupId>
+                                         </exclusion>
+                                       </exclusions>
+                                 </dependency>
+                               </dependencies>
+                         </plugin>
+                         <plugin>
+                               <groupId>io.swagger</groupId>
+                               <artifactId>swagger-codegen-maven-plugin</artifactId>
+                               <version>2.2.1</version>
+                               <executions>
+                                 <execution>
+                                       <goals>
+                                         <goal>generate</goal>
+                                       </goals>
+                                       <configuration>
+                                         <inputSpec>${basedir}/src/main/resources/swagger.json</inputSpec>
+                                         <output>${project.build.directory}/generated-sources</output>
+                                         <language>java</language>
+                                         <configOptions>
+                                               <dateLibrary>joda</dateLibrary>
+                                         </configOptions>
+                                         <library>jersey2</library>
+                                         <groupId>${project.groupId}</groupId>
+                                         <artifactId>${project.artifactId}-java-sdk</artifactId>
+                                         <artifactVersion>${project.version}</artifactVersion>
+                                         <modelPackage>${project.groupId}.${project.artifactId}.client.model</modelPackage>
+                                         <apiPackage>${project.groupId}.${project.artifactId}.client.api</apiPackage>
+                                         <invokerPackage>${project.groupId}.${project.artifactId}.client.invoker</invokerPackage>
+                                       </configuration>
+                                 </execution>
+                               </executions>
+                         </plugin>
+                         <plugin>
+                               <artifactId>exec-maven-plugin</artifactId>
+                               <groupId>org.codehaus.mojo</groupId>
+                               <version>1.5.0</version>
+                               <executions>
+                                 <execution>
+                                       <id>swagger-generate-sources</id>
+                                       <phase>generate-sources</phase>
+                                       <goals>
+                                         <goal>exec</goal>
+                                       </goals>
+                                       <configuration>
+                                         <executable>${project.build.directory}${file.separator}${swagger.sdk.script.file}</executable>
+                                       </configuration>
+                                 </execution>
+                               </executions>
+                         </plugin>
+                         <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-clean-plugin</artifactId>
+                               <version>3.0.0</version>
+                               <executions>
+                                 <execution>
+                                       <id>clean-generated-files</id>
+                                       <phase>generate-sources</phase>
+                                       <goals>
+                                         <goal>clean</goal>
+                                       </goals>
+                                       <configuration>
+                                         <filesets>
+                                               <fileset>
+                                                 <directory>${project.build.directory}/generated-sources</directory>
+                                               </fileset>
+                                         </filesets>
+                                       </configuration>
+                                 </execution>
+                               </executions>
+                         </plugin>
                </plugins>
                <resources>
                        <resource>
diff --git a/apiroute/apiroute-service/src/main/resources/swagger.json b/apiroute/apiroute-service/src/main/resources/swagger.json
new file mode 100644 (file)
index 0000000..7c189b1
--- /dev/null
@@ -0,0 +1,1173 @@
+{\r
+  "swagger" : "2.0",\r
+  "info" : {\r
+    "description" : "MicroService Bus rest API",\r
+    "version" : "1.0.0",\r
+    "title" : "MicroService Bus rest API",\r
+    "license" : {\r
+      "name" : "https://wiki.onap.org/display/DW/Apache+2.0+License"\r
+    }\r
+  },\r
+  "host" : "127.0.0.1:80",\r
+  "basePath" : "/api/microservices/v1",\r
+  "tags" : [ {\r
+    "name" : "ApiRoute"\r
+  }, {\r
+    "name" : "CustomRoute"\r
+  }, {\r
+    "name" : "iuiRoute"\r
+  } ],\r
+  "schemes" : [ "http", "https" ],\r
+  "paths" : {\r
+    "/apiRoute" : {\r
+      "get" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "get all ApiRoute ",\r
+        "description" : "",\r
+        "operationId" : "getApiRoutes",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "type" : "array",\r
+              "items" : {\r
+                "$ref" : "#/definitions/ApiRouteInfo"\r
+              }\r
+            }\r
+          },\r
+          "500" : {\r
+            "description" : "get ApiRouteInfo List  fail"\r
+          }\r
+        }\r
+      },\r
+      "post" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "add one ApiRoute ",\r
+        "description" : "",\r
+        "operationId" : "addApiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "in" : "body",\r
+          "name" : "body",\r
+          "description" : "ApiRoute Instance Info",\r
+          "required" : true,\r
+          "schema" : {\r
+            "$ref" : "#/definitions/ApiRouteInfo"\r
+          }\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/ApiRouteInfo"\r
+            }\r
+          },\r
+          "400" : {\r
+            "description" : "Unprocessable ApiRouteInfo JSON REQUEST"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable ApiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "add ApiRouteInfo fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/apiRoute/apiDocs" : {\r
+      "get" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "get all Local apiDoc ",\r
+        "description" : "",\r
+        "operationId" : "getApiDocs",\r
+        "produces" : [ "application/json" ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "type" : "array",\r
+              "items" : {\r
+                "type" : "string"\r
+              }\r
+            }\r
+          },\r
+          "500" : {\r
+            "description" : "get apiDoc List  fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/apiRoute/discoverInfo" : {\r
+      "get" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "get discover Info ",\r
+        "description" : "",\r
+        "operationId" : "getServiceDiscoverInfo",\r
+        "produces" : [ "application/json" ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/DiscoverInfo"\r
+            }\r
+          },\r
+          "500" : {\r
+            "description" : "get discover Info fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/apiRoute/export" : {\r
+      "get" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "export all route service Info by json-file",\r
+        "description" : "",\r
+        "operationId" : "exportService",\r
+        "produces" : [ "text/plain" ],\r
+        "parameters" : [ {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "type" : "string"\r
+            }\r
+          },\r
+          "406" : {\r
+            "description" : " not Acceptable client-side"\r
+          },\r
+          "500" : {\r
+            "description" : "export fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/apiRoute/{serviceName}/version/{version}" : {\r
+      "get" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "get one ApiRoute ",\r
+        "description" : "",\r
+        "operationId" : "getApiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "ApiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "version",\r
+          "in" : "path",\r
+          "description" : "ApiRoute version,if the version is empty, please enter \"null\"",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "ApiRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "ApiRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/ApiRouteInfo"\r
+            }\r
+          },\r
+          "404" : {\r
+            "description" : "ApiRouteInfo not found"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable ApiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "get ApiRouteInfo fail"\r
+          }\r
+        }\r
+      },\r
+      "put" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "update one ApiRoute by serviceName and version",\r
+        "description" : "",\r
+        "operationId" : "updateApiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "ApiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "version",\r
+          "in" : "path",\r
+          "description" : "ApiRoute version,if the version is empty, please enter \"null\"",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "in" : "body",\r
+          "name" : "body",\r
+          "description" : "ApiRoute Instance Info",\r
+          "required" : true,\r
+          "schema" : {\r
+            "$ref" : "#/definitions/ApiRouteInfo"\r
+          }\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/ApiRouteInfo"\r
+            }\r
+          },\r
+          "400" : {\r
+            "description" : "Unprocessable ApiRouteInfo JSON REQUEST"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable ApiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "update ApiRouteInfo fail"\r
+          }\r
+        }\r
+      },\r
+      "delete" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "delete one ApiRoute by serviceName and version",\r
+        "description" : "",\r
+        "operationId" : "deleteApiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "ApiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "version",\r
+          "in" : "path",\r
+          "description" : "ApiRoute version,if the version is empty, please enter \"null\"",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "ApiRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "ApiRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "204" : {\r
+            "description" : "delete ApiRouteInfo succeed "\r
+          },\r
+          "404" : {\r
+            "description" : "ApiRouteInfo not found"\r
+          },\r
+          "500" : {\r
+            "description" : "delete ApiRouteInfo fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/apiRoute/{serviceName}/version/{version}/status/{status}" : {\r
+      "put" : {\r
+        "tags" : [ "ApiRoute" ],\r
+        "summary" : "update one ApiRoute  status by serviceName and version",\r
+        "description" : "",\r
+        "operationId" : "updateApiRouteStatus",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "ApiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "version",\r
+          "in" : "path",\r
+          "description" : "ApiRoute version,if the version is empty, please enter \"null\"",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "status",\r
+          "in" : "path",\r
+          "description" : "ApiRoute status,1?abled  0?disabled",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "ApiRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "ApiRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/ApiRouteInfo"\r
+            }\r
+          },\r
+          "404" : {\r
+            "description" : "ApiRouteInfo not found"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable ApiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "update status fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/customRoute/all" : {\r
+      "get" : {\r
+        "tags" : [ "CustomRoute" ],\r
+        "summary" : "get all CustomRoute ",\r
+        "description" : "",\r
+        "operationId" : "getCustomRoutes",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "type" : "array",\r
+              "items" : {\r
+                "$ref" : "#/definitions/CustomRouteInfo"\r
+              }\r
+            }\r
+          },\r
+          "500" : {\r
+            "description" : "get CustomRouteInfo List  fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/customRoute/instance" : {\r
+      "get" : {\r
+        "tags" : [ "CustomRoute" ],\r
+        "summary" : "get one CustomRoute ",\r
+        "description" : "",\r
+        "operationId" : "getCustomRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "query",\r
+          "description" : "CustomRoute serviceName",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "CustomRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "CustomRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/CustomRouteInfo"\r
+            }\r
+          },\r
+          "404" : {\r
+            "description" : "CustomRoute not found"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable CustomRoute Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "get CustomRoute fail"\r
+          }\r
+        }\r
+      },\r
+      "post" : {\r
+        "tags" : [ "CustomRoute" ],\r
+        "summary" : "add one CustomRoute ",\r
+        "description" : "",\r
+        "operationId" : "addCustomRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "in" : "body",\r
+          "name" : "body",\r
+          "description" : "CustomRoute Instance Info",\r
+          "required" : true,\r
+          "schema" : {\r
+            "$ref" : "#/definitions/CustomRouteInfo"\r
+          }\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/CustomRouteInfo"\r
+            }\r
+          },\r
+          "400" : {\r
+            "description" : "Unprocessable CustomRouteInfo JSON REQUEST"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable CustomRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "add CustomRouteInfo fail"\r
+          }\r
+        }\r
+      },\r
+      "put" : {\r
+        "tags" : [ "CustomRoute" ],\r
+        "summary" : "update one CustomRoute by serviceName",\r
+        "description" : "",\r
+        "operationId" : "updateCustomRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "query",\r
+          "description" : "CustomRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "in" : "body",\r
+          "name" : "body",\r
+          "description" : "CustomRoute Instance Info",\r
+          "required" : true,\r
+          "schema" : {\r
+            "$ref" : "#/definitions/CustomRouteInfo"\r
+          }\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/CustomRouteInfo"\r
+            }\r
+          },\r
+          "400" : {\r
+            "description" : "Unprocessable CustomRoute JSON REQUEST"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable CustomRoute Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "update CustomRoute fail"\r
+          }\r
+        }\r
+      },\r
+      "delete" : {\r
+        "tags" : [ "CustomRoute" ],\r
+        "summary" : "delete one CustomRoute by serviceName",\r
+        "description" : "",\r
+        "operationId" : "deleteCustomRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "query",\r
+          "description" : "CustomRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "CustomRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "CustomRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "204" : {\r
+            "description" : "delete customRoute succeed "\r
+          },\r
+          "404" : {\r
+            "description" : "customRoute not found"\r
+          },\r
+          "500" : {\r
+            "description" : "delete customRoute fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/customRoute/status" : {\r
+      "put" : {\r
+        "tags" : [ "CustomRoute" ],\r
+        "summary" : "update one CustomRoute  status by serviceName ",\r
+        "description" : "",\r
+        "operationId" : "updateCustomRouteStatus",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "query",\r
+          "description" : "CustomRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "CustomRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "status",\r
+          "in" : "query",\r
+          "description" : "CustomRoute status,1?abled  0?disabled",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "CustomRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/CustomRouteInfo"\r
+            }\r
+          },\r
+          "404" : {\r
+            "description" : "customRoute not found"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable customRoute Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "update status fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/iuiRoute" : {\r
+      "get" : {\r
+        "tags" : [ "iuiRoute" ],\r
+        "summary" : "get all iuiRoute ",\r
+        "description" : "",\r
+        "operationId" : "getIuiRoutes",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "type" : "array",\r
+              "items" : {\r
+                "$ref" : "#/definitions/IuiRouteInfo"\r
+              }\r
+            }\r
+          },\r
+          "500" : {\r
+            "description" : "get iuiRouteInfo List  fail"\r
+          }\r
+        }\r
+      },\r
+      "post" : {\r
+        "tags" : [ "iuiRoute" ],\r
+        "summary" : "add one iuiRoute ",\r
+        "description" : "",\r
+        "operationId" : "addIuiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "in" : "body",\r
+          "name" : "body",\r
+          "description" : "iuiRoute Instance Info",\r
+          "required" : true,\r
+          "schema" : {\r
+            "$ref" : "#/definitions/IuiRouteInfo"\r
+          }\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/IuiRouteInfo"\r
+            }\r
+          },\r
+          "400" : {\r
+            "description" : "Unprocessable iuiRouteInfo JSON REQUEST"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable iuiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "add iuiRouteInfo fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/iuiRoute/{serviceName}" : {\r
+      "get" : {\r
+        "tags" : [ "iuiRoute" ],\r
+        "summary" : "get one iuiRoute ",\r
+        "description" : "",\r
+        "operationId" : "getIuiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "iuiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "iuiRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "iuiRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "200" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/IuiRouteInfo"\r
+            }\r
+          },\r
+          "404" : {\r
+            "description" : "IuiRouteInfo not found"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable IuiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "get IuiRouteInfo fail"\r
+          }\r
+        }\r
+      },\r
+      "put" : {\r
+        "tags" : [ "iuiRoute" ],\r
+        "summary" : "update one iuiRoute by serviceName",\r
+        "description" : "",\r
+        "operationId" : "updateIuiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "iuiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "in" : "body",\r
+          "name" : "body",\r
+          "description" : "iuiRoute Instance Info",\r
+          "required" : true,\r
+          "schema" : {\r
+            "$ref" : "#/definitions/IuiRouteInfo"\r
+          }\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/IuiRouteInfo"\r
+            }\r
+          },\r
+          "400" : {\r
+            "description" : "Unprocessable IuiRouteInfo JSON REQUEST"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable IuiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "update IuiRouteInfo fail"\r
+          }\r
+        }\r
+      },\r
+      "delete" : {\r
+        "tags" : [ "iuiRoute" ],\r
+        "summary" : "delete one iuiRoute by serviceName",\r
+        "description" : "",\r
+        "operationId" : "deleteIuiRoute",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "iuiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "iuiRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "iuiRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "204" : {\r
+            "description" : "delete IuiRouteInfo succeed "\r
+          },\r
+          "404" : {\r
+            "description" : "IuiRouteInfo not found"\r
+          },\r
+          "500" : {\r
+            "description" : "delete IuiRouteInfo fail"\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "/iuiRoute/{serviceName}/status/{status}" : {\r
+      "put" : {\r
+        "tags" : [ "iuiRoute" ],\r
+        "summary" : "update one iuiRoute  status by serviceName ",\r
+        "description" : "",\r
+        "operationId" : "updateIuiRouteStatus",\r
+        "produces" : [ "application/json" ],\r
+        "parameters" : [ {\r
+          "name" : "serviceName",\r
+          "in" : "path",\r
+          "description" : "iuiRoute serviceName",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "host",\r
+          "in" : "query",\r
+          "description" : "iuiRoute host",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "status",\r
+          "in" : "path",\r
+          "description" : "iuiRoute status,1?abled  0?disabled",\r
+          "required" : true,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "publish_port",\r
+          "in" : "query",\r
+          "description" : "iuiRoute Publish port",\r
+          "required" : false,\r
+          "type" : "string"\r
+        }, {\r
+          "name" : "routeWay",\r
+          "in" : "query",\r
+          "description" : "Route Way",\r
+          "required" : false,\r
+          "type" : "string",\r
+          "default" : "ip"\r
+        } ],\r
+        "responses" : {\r
+          "201" : {\r
+            "description" : "successful operation",\r
+            "schema" : {\r
+              "$ref" : "#/definitions/IuiRouteInfo"\r
+            }\r
+          },\r
+          "404" : {\r
+            "description" : "IuiRouteInfo not found"\r
+          },\r
+          "422" : {\r
+            "description" : "Unprocessable IuiRouteInfo Entity "\r
+          },\r
+          "500" : {\r
+            "description" : "update IuiRouteInfo status fail"\r
+          }\r
+        }\r
+      }\r
+    }\r
+  },\r
+  "definitions" : {\r
+    "ApiRouteInfo" : {\r
+      "type" : "object",\r
+      "required" : [ "servers", "serviceName", "url", "version" ],\r
+      "properties" : {\r
+        "serviceName" : {\r
+          "type" : "string"\r
+        },\r
+        "url" : {\r
+          "type" : "string",\r
+          "example" : "/test",\r
+          "description" : "Target Service URL,start with /"\r
+        },\r
+        "control" : {\r
+          "type" : "string",\r
+          "example" : "0",\r
+          "description" : "[control Range] 0?default   1?readonly  2?hidden ",\r
+          "enum" : [ "0", "1", "2" ]\r
+        },\r
+        "status" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[status] 1?abled    0?disabled ",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "visualRange" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[visual Range]interSystem:0,inSystem:1",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "useOwnUpstream" : {\r
+          "type" : "string",\r
+          "example" : "0",\r
+          "description" : "[LB Policy]non_ip_hash:0,ip_hash:1",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "servers" : {\r
+          "type" : "array",\r
+          "items" : {\r
+            "$ref" : "#/definitions/RouteServer"\r
+          }\r
+        },\r
+        "host" : {\r
+          "type" : "string"\r
+        },\r
+        "namespace" : {\r
+          "type" : "string"\r
+        },\r
+        "publish_port" : {\r
+          "type" : "string"\r
+        },\r
+        "enable_ssl" : {\r
+          "type" : "boolean",\r
+          "default" : false\r
+        },\r
+        "consulServiceName" : {\r
+          "type" : "string"\r
+        },\r
+        "publishProtocol" : {\r
+          "type" : "string"\r
+        },\r
+        "version" : {\r
+          "type" : "string",\r
+          "example" : "v1"\r
+        },\r
+        "apiJson" : {\r
+          "type" : "string"\r
+        },\r
+        "apiJsonType" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[apiJson Type] 0?local file  1? remote file",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "metricsUrl" : {\r
+          "type" : "string"\r
+        }\r
+      }\r
+    },\r
+    "CustomRouteInfo" : {\r
+      "type" : "object",\r
+      "required" : [ "servers", "serviceName", "url" ],\r
+      "properties" : {\r
+        "serviceName" : {\r
+          "type" : "string"\r
+        },\r
+        "url" : {\r
+          "type" : "string",\r
+          "example" : "/test",\r
+          "description" : "Target Service URL,start with /"\r
+        },\r
+        "control" : {\r
+          "type" : "string",\r
+          "example" : "0",\r
+          "description" : "[control Range] 0?default   1?readonly  2?hidden ",\r
+          "enum" : [ "0", "1", "2" ]\r
+        },\r
+        "status" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[status] 1?abled    0?disabled ",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "visualRange" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[visual Range]interSystem:0,inSystem:1",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "useOwnUpstream" : {\r
+          "type" : "string",\r
+          "example" : "0",\r
+          "description" : "[LB Policy]non_ip_hash:0,ip_hash:1",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "servers" : {\r
+          "type" : "array",\r
+          "items" : {\r
+            "$ref" : "#/definitions/RouteServer"\r
+          }\r
+        },\r
+        "host" : {\r
+          "type" : "string"\r
+        },\r
+        "namespace" : {\r
+          "type" : "string"\r
+        },\r
+        "publish_port" : {\r
+          "type" : "string"\r
+        },\r
+        "enable_ssl" : {\r
+          "type" : "boolean",\r
+          "default" : false\r
+        },\r
+        "consulServiceName" : {\r
+          "type" : "string"\r
+        },\r
+        "publishProtocol" : {\r
+          "type" : "string"\r
+        }\r
+      }\r
+    },\r
+    "DiscoverInfo" : {\r
+      "type" : "object",\r
+      "properties" : {\r
+        "ip" : {\r
+          "type" : "string"\r
+        },\r
+        "port" : {\r
+          "type" : "integer",\r
+          "format" : "int32"\r
+        },\r
+        "enabled" : {\r
+          "type" : "boolean",\r
+          "default" : false\r
+        }\r
+      }\r
+    },\r
+    "IuiRouteInfo" : {\r
+      "type" : "object",\r
+      "required" : [ "servers", "serviceName", "url" ],\r
+      "properties" : {\r
+        "serviceName" : {\r
+          "type" : "string"\r
+        },\r
+        "url" : {\r
+          "type" : "string",\r
+          "example" : "/test",\r
+          "description" : "Target Service URL,start with /"\r
+        },\r
+        "control" : {\r
+          "type" : "string",\r
+          "example" : "0",\r
+          "description" : "[control Range] 0?default   1?readonly  2?hidden ",\r
+          "enum" : [ "0", "1", "2" ]\r
+        },\r
+        "status" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[status] 1?abled    0?disabled ",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "visualRange" : {\r
+          "type" : "string",\r
+          "example" : "1",\r
+          "description" : "[visual Range]interSystem:0,inSystem:1",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "useOwnUpstream" : {\r
+          "type" : "string",\r
+          "example" : "0",\r
+          "description" : "[LB Policy]non_ip_hash:0,ip_hash:1",\r
+          "enum" : [ "0", "1" ]\r
+        },\r
+        "servers" : {\r
+          "type" : "array",\r
+          "items" : {\r
+            "$ref" : "#/definitions/RouteServer"\r
+          }\r
+        },\r
+        "host" : {\r
+          "type" : "string"\r
+        },\r
+        "namespace" : {\r
+          "type" : "string"\r
+        },\r
+        "publish_port" : {\r
+          "type" : "string"\r
+        },\r
+        "enable_ssl" : {\r
+          "type" : "boolean",\r
+          "default" : false\r
+        },\r
+        "consulServiceName" : {\r
+          "type" : "string"\r
+        },\r
+        "publishProtocol" : {\r
+          "type" : "string"\r
+        }\r
+      }\r
+    },\r
+    "RouteServer" : {\r
+      "type" : "object",\r
+      "required" : [ "ip", "port" ],\r
+      "properties" : {\r
+        "ip" : {\r
+          "type" : "string"\r
+        },\r
+        "port" : {\r
+          "type" : "string"\r
+        },\r
+        "weight" : {\r
+          "type" : "integer",\r
+          "format" : "int32"\r
+        }\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file