aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-20 21:31:29 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-21 20:02:35 +0530
commit07625f56dc83a8bdffd128a242095e327923b51f (patch)
treecd15efd15c8a5985b971c384a541f1c5c4a0f6b2
parentfaa96aff9ec83d0690eff7088f8fa84654b2dfe5 (diff)
Add swagger-sdk support for MSB service (sdk)
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>
-rw-r--r--apiroute/apiroute-service/dependency-reduced-pom.xml116
-rw-r--r--apiroute/apiroute-service/pom.xml128
-rw-r--r--apiroute/apiroute-service/src/main/resources/swagger.json1173
3 files changed, 1416 insertions, 1 deletions
diff --git a/apiroute/apiroute-service/dependency-reduced-pom.xml b/apiroute/apiroute-service/dependency-reduced-pom.xml
index 4c53010..5189658 100644
--- a/apiroute/apiroute-service/dependency-reduced-pom.xml
+++ b/apiroute/apiroute-service/dependency-reduced-pom.xml
@@ -137,6 +137,122 @@
</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>
diff --git a/apiroute/apiroute-service/pom.xml b/apiroute/apiroute-service/pom.xml
index 3502768..d328521 100644
--- a/apiroute/apiroute-service/pom.xml
+++ b/apiroute/apiroute-service/pom.xml
@@ -111,7 +111,13 @@
<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>
@@ -237,6 +243,126 @@
</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
index 0000000..7c189b1
--- /dev/null
+++ b/apiroute/apiroute-service/src/main/resources/swagger.json
@@ -0,0 +1,1173 @@
+{
+ "swagger" : "2.0",
+ "info" : {
+ "description" : "MicroService Bus rest API",
+ "version" : "1.0.0",
+ "title" : "MicroService Bus rest API",
+ "license" : {
+ "name" : "https://wiki.onap.org/display/DW/Apache+2.0+License"
+ }
+ },
+ "host" : "127.0.0.1:80",
+ "basePath" : "/api/microservices/v1",
+ "tags" : [ {
+ "name" : "ApiRoute"
+ }, {
+ "name" : "CustomRoute"
+ }, {
+ "name" : "iuiRoute"
+ } ],
+ "schemes" : [ "http", "https" ],
+ "paths" : {
+ "/apiRoute" : {
+ "get" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "get all ApiRoute ",
+ "description" : "",
+ "operationId" : "getApiRoutes",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ }
+ },
+ "500" : {
+ "description" : "get ApiRouteInfo List fail"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "add one ApiRoute ",
+ "description" : "",
+ "operationId" : "addApiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "description" : "ApiRoute Instance Info",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ },
+ "400" : {
+ "description" : "Unprocessable ApiRouteInfo JSON REQUEST"
+ },
+ "422" : {
+ "description" : "Unprocessable ApiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "add ApiRouteInfo fail"
+ }
+ }
+ }
+ },
+ "/apiRoute/apiDocs" : {
+ "get" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "get all Local apiDoc ",
+ "description" : "",
+ "operationId" : "getApiDocs",
+ "produces" : [ "application/json" ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "type" : "string"
+ }
+ }
+ },
+ "500" : {
+ "description" : "get apiDoc List fail"
+ }
+ }
+ }
+ },
+ "/apiRoute/discoverInfo" : {
+ "get" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "get discover Info ",
+ "description" : "",
+ "operationId" : "getServiceDiscoverInfo",
+ "produces" : [ "application/json" ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/DiscoverInfo"
+ }
+ },
+ "500" : {
+ "description" : "get discover Info fail"
+ }
+ }
+ }
+ },
+ "/apiRoute/export" : {
+ "get" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "export all route service Info by json-file",
+ "description" : "",
+ "operationId" : "exportService",
+ "produces" : [ "text/plain" ],
+ "parameters" : [ {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "string"
+ }
+ },
+ "406" : {
+ "description" : " not Acceptable client-side"
+ },
+ "500" : {
+ "description" : "export fail"
+ }
+ }
+ }
+ },
+ "/apiRoute/{serviceName}/version/{version}" : {
+ "get" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "get one ApiRoute ",
+ "description" : "",
+ "operationId" : "getApiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "ApiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "path",
+ "description" : "ApiRoute version,if the version is empty, please enter \"null\"",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "ApiRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "ApiRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ },
+ "404" : {
+ "description" : "ApiRouteInfo not found"
+ },
+ "422" : {
+ "description" : "Unprocessable ApiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "get ApiRouteInfo fail"
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "update one ApiRoute by serviceName and version",
+ "description" : "",
+ "operationId" : "updateApiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "ApiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "path",
+ "description" : "ApiRoute version,if the version is empty, please enter \"null\"",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "description" : "ApiRoute Instance Info",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ },
+ "400" : {
+ "description" : "Unprocessable ApiRouteInfo JSON REQUEST"
+ },
+ "422" : {
+ "description" : "Unprocessable ApiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "update ApiRouteInfo fail"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "delete one ApiRoute by serviceName and version",
+ "description" : "",
+ "operationId" : "deleteApiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "ApiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "path",
+ "description" : "ApiRoute version,if the version is empty, please enter \"null\"",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "ApiRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "ApiRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "delete ApiRouteInfo succeed "
+ },
+ "404" : {
+ "description" : "ApiRouteInfo not found"
+ },
+ "500" : {
+ "description" : "delete ApiRouteInfo fail"
+ }
+ }
+ }
+ },
+ "/apiRoute/{serviceName}/version/{version}/status/{status}" : {
+ "put" : {
+ "tags" : [ "ApiRoute" ],
+ "summary" : "update one ApiRoute status by serviceName and version",
+ "description" : "",
+ "operationId" : "updateApiRouteStatus",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "ApiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "version",
+ "in" : "path",
+ "description" : "ApiRoute version,if the version is empty, please enter \"null\"",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "status",
+ "in" : "path",
+ "description" : "ApiRoute status,1?abled 0?disabled",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "ApiRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "ApiRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/ApiRouteInfo"
+ }
+ },
+ "404" : {
+ "description" : "ApiRouteInfo not found"
+ },
+ "422" : {
+ "description" : "Unprocessable ApiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "update status fail"
+ }
+ }
+ }
+ },
+ "/customRoute/all" : {
+ "get" : {
+ "tags" : [ "CustomRoute" ],
+ "summary" : "get all CustomRoute ",
+ "description" : "",
+ "operationId" : "getCustomRoutes",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ }
+ },
+ "500" : {
+ "description" : "get CustomRouteInfo List fail"
+ }
+ }
+ }
+ },
+ "/customRoute/instance" : {
+ "get" : {
+ "tags" : [ "CustomRoute" ],
+ "summary" : "get one CustomRoute ",
+ "description" : "",
+ "operationId" : "getCustomRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "query",
+ "description" : "CustomRoute serviceName",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "CustomRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "CustomRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ },
+ "404" : {
+ "description" : "CustomRoute not found"
+ },
+ "422" : {
+ "description" : "Unprocessable CustomRoute Entity "
+ },
+ "500" : {
+ "description" : "get CustomRoute fail"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "CustomRoute" ],
+ "summary" : "add one CustomRoute ",
+ "description" : "",
+ "operationId" : "addCustomRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "description" : "CustomRoute Instance Info",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ },
+ "400" : {
+ "description" : "Unprocessable CustomRouteInfo JSON REQUEST"
+ },
+ "422" : {
+ "description" : "Unprocessable CustomRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "add CustomRouteInfo fail"
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "CustomRoute" ],
+ "summary" : "update one CustomRoute by serviceName",
+ "description" : "",
+ "operationId" : "updateCustomRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "query",
+ "description" : "CustomRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "description" : "CustomRoute Instance Info",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ },
+ "400" : {
+ "description" : "Unprocessable CustomRoute JSON REQUEST"
+ },
+ "422" : {
+ "description" : "Unprocessable CustomRoute Entity "
+ },
+ "500" : {
+ "description" : "update CustomRoute fail"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "CustomRoute" ],
+ "summary" : "delete one CustomRoute by serviceName",
+ "description" : "",
+ "operationId" : "deleteCustomRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "query",
+ "description" : "CustomRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "CustomRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "CustomRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "delete customRoute succeed "
+ },
+ "404" : {
+ "description" : "customRoute not found"
+ },
+ "500" : {
+ "description" : "delete customRoute fail"
+ }
+ }
+ }
+ },
+ "/customRoute/status" : {
+ "put" : {
+ "tags" : [ "CustomRoute" ],
+ "summary" : "update one CustomRoute status by serviceName ",
+ "description" : "",
+ "operationId" : "updateCustomRouteStatus",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "query",
+ "description" : "CustomRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "CustomRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "status",
+ "in" : "query",
+ "description" : "CustomRoute status,1?abled 0?disabled",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "CustomRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/CustomRouteInfo"
+ }
+ },
+ "404" : {
+ "description" : "customRoute not found"
+ },
+ "422" : {
+ "description" : "Unprocessable customRoute Entity "
+ },
+ "500" : {
+ "description" : "update status fail"
+ }
+ }
+ }
+ },
+ "/iuiRoute" : {
+ "get" : {
+ "tags" : [ "iuiRoute" ],
+ "summary" : "get all iuiRoute ",
+ "description" : "",
+ "operationId" : "getIuiRoutes",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ }
+ },
+ "500" : {
+ "description" : "get iuiRouteInfo List fail"
+ }
+ }
+ },
+ "post" : {
+ "tags" : [ "iuiRoute" ],
+ "summary" : "add one iuiRoute ",
+ "description" : "",
+ "operationId" : "addIuiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "in" : "body",
+ "name" : "body",
+ "description" : "iuiRoute Instance Info",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ },
+ "400" : {
+ "description" : "Unprocessable iuiRouteInfo JSON REQUEST"
+ },
+ "422" : {
+ "description" : "Unprocessable iuiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "add iuiRouteInfo fail"
+ }
+ }
+ }
+ },
+ "/iuiRoute/{serviceName}" : {
+ "get" : {
+ "tags" : [ "iuiRoute" ],
+ "summary" : "get one iuiRoute ",
+ "description" : "",
+ "operationId" : "getIuiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "iuiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "iuiRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "iuiRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "200" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ },
+ "404" : {
+ "description" : "IuiRouteInfo not found"
+ },
+ "422" : {
+ "description" : "Unprocessable IuiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "get IuiRouteInfo fail"
+ }
+ }
+ },
+ "put" : {
+ "tags" : [ "iuiRoute" ],
+ "summary" : "update one iuiRoute by serviceName",
+ "description" : "",
+ "operationId" : "updateIuiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "iuiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "in" : "body",
+ "name" : "body",
+ "description" : "iuiRoute Instance Info",
+ "required" : true,
+ "schema" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ },
+ "400" : {
+ "description" : "Unprocessable IuiRouteInfo JSON REQUEST"
+ },
+ "422" : {
+ "description" : "Unprocessable IuiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "update IuiRouteInfo fail"
+ }
+ }
+ },
+ "delete" : {
+ "tags" : [ "iuiRoute" ],
+ "summary" : "delete one iuiRoute by serviceName",
+ "description" : "",
+ "operationId" : "deleteIuiRoute",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "iuiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "iuiRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "iuiRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "204" : {
+ "description" : "delete IuiRouteInfo succeed "
+ },
+ "404" : {
+ "description" : "IuiRouteInfo not found"
+ },
+ "500" : {
+ "description" : "delete IuiRouteInfo fail"
+ }
+ }
+ }
+ },
+ "/iuiRoute/{serviceName}/status/{status}" : {
+ "put" : {
+ "tags" : [ "iuiRoute" ],
+ "summary" : "update one iuiRoute status by serviceName ",
+ "description" : "",
+ "operationId" : "updateIuiRouteStatus",
+ "produces" : [ "application/json" ],
+ "parameters" : [ {
+ "name" : "serviceName",
+ "in" : "path",
+ "description" : "iuiRoute serviceName",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "host",
+ "in" : "query",
+ "description" : "iuiRoute host",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "status",
+ "in" : "path",
+ "description" : "iuiRoute status,1?abled 0?disabled",
+ "required" : true,
+ "type" : "string"
+ }, {
+ "name" : "publish_port",
+ "in" : "query",
+ "description" : "iuiRoute Publish port",
+ "required" : false,
+ "type" : "string"
+ }, {
+ "name" : "routeWay",
+ "in" : "query",
+ "description" : "Route Way",
+ "required" : false,
+ "type" : "string",
+ "default" : "ip"
+ } ],
+ "responses" : {
+ "201" : {
+ "description" : "successful operation",
+ "schema" : {
+ "$ref" : "#/definitions/IuiRouteInfo"
+ }
+ },
+ "404" : {
+ "description" : "IuiRouteInfo not found"
+ },
+ "422" : {
+ "description" : "Unprocessable IuiRouteInfo Entity "
+ },
+ "500" : {
+ "description" : "update IuiRouteInfo status fail"
+ }
+ }
+ }
+ }
+ },
+ "definitions" : {
+ "ApiRouteInfo" : {
+ "type" : "object",
+ "required" : [ "servers", "serviceName", "url", "version" ],
+ "properties" : {
+ "serviceName" : {
+ "type" : "string"
+ },
+ "url" : {
+ "type" : "string",
+ "example" : "/test",
+ "description" : "Target Service URL,start with /"
+ },
+ "control" : {
+ "type" : "string",
+ "example" : "0",
+ "description" : "[control Range] 0?default 1?readonly 2?hidden ",
+ "enum" : [ "0", "1", "2" ]
+ },
+ "status" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[status] 1?abled 0?disabled ",
+ "enum" : [ "0", "1" ]
+ },
+ "visualRange" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[visual Range]interSystem:0,inSystem:1",
+ "enum" : [ "0", "1" ]
+ },
+ "useOwnUpstream" : {
+ "type" : "string",
+ "example" : "0",
+ "description" : "[LB Policy]non_ip_hash:0,ip_hash:1",
+ "enum" : [ "0", "1" ]
+ },
+ "servers" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/RouteServer"
+ }
+ },
+ "host" : {
+ "type" : "string"
+ },
+ "namespace" : {
+ "type" : "string"
+ },
+ "publish_port" : {
+ "type" : "string"
+ },
+ "enable_ssl" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "consulServiceName" : {
+ "type" : "string"
+ },
+ "publishProtocol" : {
+ "type" : "string"
+ },
+ "version" : {
+ "type" : "string",
+ "example" : "v1"
+ },
+ "apiJson" : {
+ "type" : "string"
+ },
+ "apiJsonType" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[apiJson Type] 0?local file 1? remote file",
+ "enum" : [ "0", "1" ]
+ },
+ "metricsUrl" : {
+ "type" : "string"
+ }
+ }
+ },
+ "CustomRouteInfo" : {
+ "type" : "object",
+ "required" : [ "servers", "serviceName", "url" ],
+ "properties" : {
+ "serviceName" : {
+ "type" : "string"
+ },
+ "url" : {
+ "type" : "string",
+ "example" : "/test",
+ "description" : "Target Service URL,start with /"
+ },
+ "control" : {
+ "type" : "string",
+ "example" : "0",
+ "description" : "[control Range] 0?default 1?readonly 2?hidden ",
+ "enum" : [ "0", "1", "2" ]
+ },
+ "status" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[status] 1?abled 0?disabled ",
+ "enum" : [ "0", "1" ]
+ },
+ "visualRange" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[visual Range]interSystem:0,inSystem:1",
+ "enum" : [ "0", "1" ]
+ },
+ "useOwnUpstream" : {
+ "type" : "string",
+ "example" : "0",
+ "description" : "[LB Policy]non_ip_hash:0,ip_hash:1",
+ "enum" : [ "0", "1" ]
+ },
+ "servers" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/RouteServer"
+ }
+ },
+ "host" : {
+ "type" : "string"
+ },
+ "namespace" : {
+ "type" : "string"
+ },
+ "publish_port" : {
+ "type" : "string"
+ },
+ "enable_ssl" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "consulServiceName" : {
+ "type" : "string"
+ },
+ "publishProtocol" : {
+ "type" : "string"
+ }
+ }
+ },
+ "DiscoverInfo" : {
+ "type" : "object",
+ "properties" : {
+ "ip" : {
+ "type" : "string"
+ },
+ "port" : {
+ "type" : "integer",
+ "format" : "int32"
+ },
+ "enabled" : {
+ "type" : "boolean",
+ "default" : false
+ }
+ }
+ },
+ "IuiRouteInfo" : {
+ "type" : "object",
+ "required" : [ "servers", "serviceName", "url" ],
+ "properties" : {
+ "serviceName" : {
+ "type" : "string"
+ },
+ "url" : {
+ "type" : "string",
+ "example" : "/test",
+ "description" : "Target Service URL,start with /"
+ },
+ "control" : {
+ "type" : "string",
+ "example" : "0",
+ "description" : "[control Range] 0?default 1?readonly 2?hidden ",
+ "enum" : [ "0", "1", "2" ]
+ },
+ "status" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[status] 1?abled 0?disabled ",
+ "enum" : [ "0", "1" ]
+ },
+ "visualRange" : {
+ "type" : "string",
+ "example" : "1",
+ "description" : "[visual Range]interSystem:0,inSystem:1",
+ "enum" : [ "0", "1" ]
+ },
+ "useOwnUpstream" : {
+ "type" : "string",
+ "example" : "0",
+ "description" : "[LB Policy]non_ip_hash:0,ip_hash:1",
+ "enum" : [ "0", "1" ]
+ },
+ "servers" : {
+ "type" : "array",
+ "items" : {
+ "$ref" : "#/definitions/RouteServer"
+ }
+ },
+ "host" : {
+ "type" : "string"
+ },
+ "namespace" : {
+ "type" : "string"
+ },
+ "publish_port" : {
+ "type" : "string"
+ },
+ "enable_ssl" : {
+ "type" : "boolean",
+ "default" : false
+ },
+ "consulServiceName" : {
+ "type" : "string"
+ },
+ "publishProtocol" : {
+ "type" : "string"
+ }
+ }
+ },
+ "RouteServer" : {
+ "type" : "object",
+ "required" : [ "ip", "port" ],
+ "properties" : {
+ "ip" : {
+ "type" : "string"
+ },
+ "port" : {
+ "type" : "string"
+ },
+ "weight" : {
+ "type" : "integer",
+ "format" : "int32"
+ }
+ }
+ }
+ }
+} \ No newline at end of file