summaryrefslogtreecommitdiffstats
path: root/apiroute/apiroute-service/src/main/java/org/openo/msb/resources
diff options
context:
space:
mode:
Diffstat (limited to 'apiroute/apiroute-service/src/main/java/org/openo/msb/resources')
-rw-r--r--apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ApiRouteResource.java233
-rw-r--r--apiroute/apiroute-service/src/main/java/org/openo/msb/resources/CustomRouteResource.java152
-rw-r--r--apiroute/apiroute-service/src/main/java/org/openo/msb/resources/IuiRouteResource.java155
-rw-r--r--apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MetricsResource.java49
-rw-r--r--apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MicroServiceResource.java247
-rw-r--r--apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ServiceAccessResource.java65
6 files changed, 0 insertions, 901 deletions
diff --git a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ApiRouteResource.java b/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ApiRouteResource.java
deleted file mode 100644
index cd86047..0000000
--- a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ApiRouteResource.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/**
-* Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.openo.msb.resources;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-import java.net.URI;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.http.HttpStatus;
-import org.openo.msb.api.ApiRouteInfo;
-import org.openo.msb.api.DiscoverInfo;
-import org.openo.msb.wrapper.ApiRouteServiceWrapper;
-import org.openo.msb.wrapper.CustomRouteServiceWrapper;
-import org.openo.msb.wrapper.IuiRouteServiceWrapper;
-import org.openo.msb.wrapper.util.JacksonJsonUtil;
-import org.openo.msb.wrapper.util.RouteUtil;
-
-import com.codahale.metrics.annotation.Timed;
-
-@Path("/apiRoute")
-@Api(tags = { "ApiRoute" })
-@Produces(MediaType.APPLICATION_JSON)
-public class ApiRouteResource {
-
- @Context
- UriInfo uriInfo; // actual uri info
-
- @GET
- @Path("/")
- @ApiOperation(value = "get all ApiRoute ", code = HttpStatus.SC_OK,response = ApiRouteInfo.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get ApiRouteInfo List fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public ApiRouteInfo[] getApiRoutes() {
- return ApiRouteServiceWrapper.getInstance().getAllApiRouteInstances();
- }
-
- @POST
- @Path("/")
- @ApiOperation(value = "add one ApiRoute ", code = HttpStatus.SC_CREATED,response = ApiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable ApiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "add ApiRouteInfo fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable ApiRouteInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response addApiRoute(
- @ApiParam(value = "ApiRoute Instance Info", required = true) ApiRouteInfo apiRouteInfo) {
- ApiRouteInfo new_apiRouteInfo = ApiRouteServiceWrapper.getInstance().saveApiRouteInstance(apiRouteInfo,"");
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/" + new_apiRouteInfo.getServiceName()+"/version/"+new_apiRouteInfo.getVersion()).build();
- return Response.created(returnURI).entity(new_apiRouteInfo).build();
-
- }
-
- @GET
- @Path("/{serviceName}/version/{version}")
- @ApiOperation(value = "get one ApiRoute ",code = HttpStatus.SC_OK, response = ApiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "ApiRouteInfo not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable ApiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get ApiRouteInfo fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public ApiRouteInfo getApiRoute(
- @ApiParam(value = "ApiRoute serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "ApiRoute version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version) {
-
- return ApiRouteServiceWrapper.getInstance().getApiRouteInstance(serviceName,version);
-
- }
-
- @PUT
- @Path("/{serviceName}/version/{version}")
- @ApiOperation(value = "update one ApiRoute by serviceName and version", code = HttpStatus.SC_CREATED,response = ApiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable ApiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update ApiRouteInfo fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable ApiRouteInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateApiRoute(
- @ApiParam(value = "ApiRoute serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "ApiRoute version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "ApiRoute Instance Info", required = true) ApiRouteInfo apiRouteInfo) {
-
- ApiRouteInfo new_apiRouteInfo = ApiRouteServiceWrapper.getInstance().updateApiRouteInstance(serviceName,version,apiRouteInfo,"");
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/" + new_apiRouteInfo.getServiceName()+"/version/"+new_apiRouteInfo.getVersion()).build();
- return Response.created(returnURI).entity(new_apiRouteInfo).build();
-
- }
-
-
-
- @DELETE
- @Path("/{serviceName}/version/{version}")
- @ApiOperation(value = "delete one ApiRoute by serviceName and version", code = HttpStatus.SC_NO_CONTENT)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NO_CONTENT, message = "delete ApiRouteInfo succeed "),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "ApiRouteInfo not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "delete ApiRouteInfo fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public void deleteApiRoute(
- @ApiParam(value = "ApiRoute serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "ApiRoute version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version) {
-
-
- ApiRouteServiceWrapper.getInstance().deleteApiRoute(serviceName, version,"*","");
-
- }
-
-
- @GET
- @Path("/apiDocs")
- @ApiOperation(value = "get all Local apiDoc ", code = HttpStatus.SC_OK, response = String.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get apiDoc List fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public String[] getApiDocs() {
-
- String[] apiDocs = ApiRouteServiceWrapper.getInstance().getAllApiDocs();
- return apiDocs;
-
- }
-
- @GET
- @Path("/apiGatewayPort")
- @ApiOperation(value = "get apiGateway Port ", code = HttpStatus.SC_OK, response = String.class)
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get apiGateway Port fail", response = String.class)})
- @Produces(MediaType.TEXT_PLAIN)
- @Timed
- public String getApiGatewayPort() {
-
- return ApiRouteServiceWrapper.getInstance().getApiGatewayPort();
-
- }
-
- @GET
- @Path("/discoverInfo")
- @ApiOperation(value = "get discover Info ", code = HttpStatus.SC_OK,response = DiscoverInfo.class)
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get discover Info fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public DiscoverInfo getServiceDiscoverInfo() {
-
- return ApiRouteServiceWrapper.getInstance().getServiceDiscoverInfo();
- }
-
- @PUT
- @Path("/{serviceName}/version/{version}/status/{status}")
- @ApiOperation(value = "update one ApiRoute status by serviceName and version", code = HttpStatus.SC_CREATED,response = ApiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable ApiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "ApiRouteInfo not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update status fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateApiRouteStatus(
- @ApiParam(value = "ApiRoute serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "ApiRoute version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "ApiRoute status,1:abled 0:disabled", required = true) @PathParam("status") String status) {
-
- ApiRouteInfo new_apiRouteInfo = ApiRouteServiceWrapper.getInstance().updateApiRouteStatus(serviceName,version,status);
- return Response.created(uriInfo.getAbsolutePathBuilder().build()).entity(new_apiRouteInfo).build();
-
- }
-
- @GET
- @Path("/export")
- @ApiOperation(value = "export all route service Info by json-file", code = HttpStatus.SC_OK,response = String.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "export fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_NOT_ACCEPTABLE, message = " not Acceptable client-side", response = String.class)})
- @Produces(MediaType.TEXT_PLAIN)
- public Response exportService() throws Exception {
-
-
- Object[] apirouteArray= ApiRouteServiceWrapper.getInstance().getAllApiRouteInstances();
- Object[] iuirouteArray= IuiRouteServiceWrapper.getInstance().getAllIuiRouteInstances();
- Object[] customrouteArray= CustomRouteServiceWrapper.getInstance().getAllCustomRouteInstances();
-
- Object[] temprouteArray =RouteUtil.concat(apirouteArray, iuirouteArray);
- Object[] allrouteArray=RouteUtil.concat(temprouteArray, customrouteArray);
-
-
- String allrouteJson=JacksonJsonUtil.beanToJson(allrouteArray);
-
- ResponseBuilder response = Response.ok(allrouteJson);
- response.header("Content-Disposition",
- "attachment; filename=\"RouteService.json\"");
- return response.build();
-
-
- }
-
-
-
-}
diff --git a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/CustomRouteResource.java b/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/CustomRouteResource.java
deleted file mode 100644
index 89cdf5f..0000000
--- a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/CustomRouteResource.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
-* Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.openo.msb.resources;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-import java.net.URI;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.http.HttpStatus;
-import org.openo.msb.api.CustomRouteInfo;
-import org.openo.msb.wrapper.CustomRouteServiceWrapper;
-
-import com.codahale.metrics.annotation.Timed;
-
-@Path("/customRoute")
-@Api(tags = { "CustomRoute" })
-@Produces(MediaType.APPLICATION_JSON)
-public class CustomRouteResource {
-
- @Context
- UriInfo uriInfo; // actual uri info
-
- @GET
- @Path("/all")
- @ApiOperation(value = "get all CustomRoute ", code = HttpStatus.SC_OK,response = CustomRouteInfo.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get CustomRouteInfo List fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public CustomRouteInfo[] getCustomRoutes() {
- return CustomRouteServiceWrapper.getInstance().getAllCustomRouteInstances();
- }
-
- @POST
- @Path("/instance")
- @ApiOperation(value = "add one CustomRoute ", code = HttpStatus.SC_CREATED,response = CustomRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable CustomRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "add CustomRouteInfo fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable CustomRouteInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response addCustomRoute(
- @ApiParam(value = "CustomRoute Instance Info", required = true) CustomRouteInfo customRouteInfo) {
- CustomRouteInfo new_customRouteInfo = CustomRouteServiceWrapper.getInstance().saveCustomRouteInstance(customRouteInfo,"");
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/instance?serviceName=" + new_customRouteInfo.getServiceName()).build();
- return Response.created(returnURI).entity(new_customRouteInfo).build();
-
- }
-
- @GET
- @Path("/instance")
- @ApiOperation(value = "get one CustomRoute ",code = HttpStatus.SC_OK, response = CustomRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "CustomRoute not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable CustomRoute Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get CustomRoute fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public CustomRouteInfo getCustomRoute(
- @ApiParam(value = "CustomRoute serviceName", required = false) @QueryParam("serviceName") String serviceName) {
-
-
- return CustomRouteServiceWrapper.getInstance().getCustomRouteInstance(serviceName);
-
- }
-
- @PUT
- @Path("/instance")
- @ApiOperation(value = "update one CustomRoute by serviceName", code = HttpStatus.SC_CREATED,response = CustomRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable CustomRoute Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update CustomRoute fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable CustomRoute JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateCustomRoute(
- @ApiParam(value = "CustomRoute serviceName", required = true) @QueryParam("serviceName") String serviceName,
- @ApiParam(value = "CustomRoute Instance Info", required = true) CustomRouteInfo customRoute) {
-
- CustomRouteInfo new_customRouteInfo= CustomRouteServiceWrapper.getInstance().updateCustomRouteInstance(serviceName,customRoute,"");
-
- return Response.created(uriInfo.getAbsolutePathBuilder().build()).entity(new_customRouteInfo).build();
-
- }
-
- @DELETE
- @Path("/instance")
- @ApiOperation(value = "delete one CustomRoute by serviceName", code = HttpStatus.SC_NO_CONTENT)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NO_CONTENT, message = "delete customRoute succeed "),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "customRoute not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "delete customRoute fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public void deleteCustomRoute(
- @ApiParam(value = "CustomRoute serviceName", required = true) @QueryParam("serviceName") String serviceName) {
-
- CustomRouteServiceWrapper.getInstance().deleteCustomRoute(serviceName,"*","");
-
- }
-
- @PUT
- @Path("/status")
- @ApiOperation(value = "update one CustomRoute status by serviceName ",code = HttpStatus.SC_CREATED, response = CustomRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable customRoute Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "customRoute not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update status fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateCustomRouteStatus(
- @ApiParam(value = "CustomRoute serviceName", required = true) @QueryParam("serviceName") String serviceName,
- @ApiParam(value = "CustomRoute status,1:abled 0:disabled", required = true) @QueryParam("status") String status) {
-
- CustomRouteInfo new_customRouteInfo = CustomRouteServiceWrapper.getInstance().updateCustomRouteStatus(serviceName,status);
- return Response.created(uriInfo.getAbsolutePathBuilder().build()).entity(new_customRouteInfo).build();
-
-
- }
-
-}
diff --git a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/IuiRouteResource.java b/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/IuiRouteResource.java
deleted file mode 100644
index b852fa9..0000000
--- a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/IuiRouteResource.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
-* Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.openo.msb.resources;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-import java.net.URI;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.http.HttpStatus;
-import org.openo.msb.api.IuiRouteInfo;
-import org.openo.msb.wrapper.IuiRouteServiceWrapper;
-
-import com.codahale.metrics.annotation.Timed;
-
-@Path("/iuiRoute")
-@Api(tags = { "iuiRoute" })
-@Produces(MediaType.APPLICATION_JSON)
-public class IuiRouteResource {
-
- @Context
- UriInfo uriInfo; // actual uri info
-
- @GET
- @Path("/")
- @ApiOperation(value = "get all iuiRoute ", code = HttpStatus.SC_OK,response = IuiRouteInfo.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get iuiRouteInfo List fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public IuiRouteInfo[] getIuiRoutes() {
- return IuiRouteServiceWrapper.getInstance().getAllIuiRouteInstances();
- }
-
- @POST
- @Path("/")
- @ApiOperation(value = "add one iuiRoute ", code = HttpStatus.SC_CREATED,response = IuiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable iuiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "add iuiRouteInfo fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable iuiRouteInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response addIuiRoute(
- @ApiParam(value = "iuiRoute Instance Info", required = true) IuiRouteInfo iuiRouteInfo) {
- IuiRouteInfo new_iuiRouteInfo = IuiRouteServiceWrapper.getInstance().saveIuiRouteInstance(iuiRouteInfo);
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/" + new_iuiRouteInfo.getServiceName()).build();
- return Response.created(returnURI).entity(new_iuiRouteInfo).build();
-
- }
-
- @GET
- @Path("/{serviceName}")
- @ApiOperation(value = "get one iuiRoute ",code = HttpStatus.SC_OK, response = IuiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "IuiRouteInfo not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable IuiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get IuiRouteInfo fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public IuiRouteInfo getIuiRoute(
- @ApiParam(value = "iuiRoute serviceName", required = true) @PathParam("serviceName") String serviceName) {
-
- return IuiRouteServiceWrapper.getInstance().getIuiRouteInstance(serviceName);
-
- }
-
- @PUT
- @Path("/{serviceName}")
- @ApiOperation(value = "update one iuiRoute by serviceName", code = HttpStatus.SC_CREATED,response = IuiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable IuiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update IuiRouteInfo fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable IuiRouteInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateIuiRoute(
- @ApiParam(value = "iuiRoute serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "iuiRoute Instance Info", required = true) IuiRouteInfo iuiRouteInfo) {
-
- IuiRouteInfo new_iuiRouteInfo = IuiRouteServiceWrapper.getInstance().updateIuiRouteInstance(serviceName,iuiRouteInfo);
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/" + serviceName).build();
- return Response.created(returnURI).entity(new_iuiRouteInfo).build();
- }
-
- @DELETE
- @Path("/{serviceName}")
- @ApiOperation(value = "delete one iuiRoute by serviceName", code = HttpStatus.SC_NO_CONTENT)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NO_CONTENT, message = "delete IuiRouteInfo succeed "),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "IuiRouteInfo not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "delete IuiRouteInfo fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public void deleteIuiRoute(
- @ApiParam(value = "iuiRoute serviceName", required = true) @PathParam("serviceName") String serviceName) {
-
- IuiRouteServiceWrapper.getInstance().deleteIuiRoute(serviceName,"*");
-
- }
-
- @PUT
- @Path("/{serviceName}/status/{status}")
- @ApiOperation(value = "update one iuiRoute status by serviceName ",code = HttpStatus.SC_CREATED, response = IuiRouteInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable IuiRouteInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "IuiRouteInfo not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update IuiRouteInfo status fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateIuiRouteStatus(
- @ApiParam(value = "iuiRoute serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "iuiRoute status,1:abled 0:disabled", required = true) @PathParam("status") String status) {
-
- IuiRouteInfo new_iuiRouteInfo = IuiRouteServiceWrapper.getInstance().updateIuiRouteStatus(serviceName,status);
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/" + serviceName).build();
- return Response.created(returnURI).entity(new_iuiRouteInfo).build();
-
- }
-
-}
diff --git a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MetricsResource.java b/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MetricsResource.java
deleted file mode 100644
index d15799b..0000000
--- a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MetricsResource.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
-* Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.openo.msb.resources;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.openo.msb.api.MetricsInfo;
-import org.openo.msb.wrapper.MetricsServiceWrapper;
-
-import com.codahale.metrics.annotation.Timed;
-
-@Path("/metrics")
-@Api(tags = { "metrics" })
-@Produces(MediaType.APPLICATION_JSON)
-public class MetricsResource {
-
-
- @GET
- @Path("/")
- @ApiOperation(value = "get Metrics Info ", response = MetricsInfo.class)
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public MetricsInfo getMetricsInfo() {
- return MetricsServiceWrapper.getMetricsInfo();
- }
-
-
-}
diff --git a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MicroServiceResource.java b/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MicroServiceResource.java
deleted file mode 100644
index 5ea80ae..0000000
--- a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/MicroServiceResource.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
-* Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.openo.msb.resources;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-import java.net.URI;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpStatus;
-import org.openo.msb.api.MicroServiceFullInfo;
-import org.openo.msb.api.MicroServiceInfo;
-import org.openo.msb.wrapper.MicroServiceWrapper;
-import org.openo.msb.wrapper.util.MicroServiceUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.codahale.metrics.annotation.Timed;
-
-@Path("/services")
-@Api(tags = {"MSB-Service Resource"})
-@Produces(MediaType.APPLICATION_JSON)
-public class MicroServiceResource {
-
- @Context
- UriInfo uriInfo; // actual uri info
-
-
- private static final Logger LOGGER = LoggerFactory.getLogger(MicroServiceResource.class);
-
- @GET
- @Path("/")
- @ApiOperation(value = "get all microservices ", code = HttpStatus.SC_OK, response = MicroServiceFullInfo.class, responseContainer = "List")
- @ApiResponses(value = {@ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get microservice List fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public MicroServiceFullInfo[] getMicroService() {
- return MicroServiceWrapper.getInstance().getAllMicroServiceInstances();
- }
-
- @POST
- @Path("/")
- @ApiOperation(value = "add one microservice ", code = HttpStatus.SC_CREATED, response = MicroServiceFullInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "add microservice fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable MicroServiceInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response addMicroService(
- @ApiParam(value = "MicroServiceInfo Instance Info", required = true) MicroServiceInfo microServiceInfo,
- @Context HttpServletRequest request,
- @ApiParam(value = "createOrUpdate", required = false) @QueryParam("createOrUpdate") @DefaultValue("true") boolean createOrUpdate,
- @ApiParam(value = "port", required = false) @QueryParam("port") @DefaultValue("") String port) {
-
- String ip=MicroServiceUtil.getRealIp(request);
-
- MicroServiceFullInfo microServiceFullInfo =
- MicroServiceWrapper.getInstance().saveMicroServiceInstance(microServiceInfo,
- createOrUpdate,ip,port);
- URI returnURI =
- uriInfo.getAbsolutePathBuilder()
- .path("/" + microServiceInfo.getServiceName() + "/version/"
- + microServiceInfo.getVersion()).build();
- return Response.created(returnURI).entity(microServiceFullInfo).build();
- }
-
-
-
- @GET
- @Path("/{serviceName}/version/{version}")
- @ApiOperation(value = "get one microservice ", code = HttpStatus.SC_OK, response = MicroServiceFullInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "microservice not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "get microservice fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public MicroServiceFullInfo getMicroService(
- @ApiParam(value = "microservice serviceName") @PathParam("serviceName") String serviceName,
- @ApiParam(value = "microservice version,if the version is empty, please enter \"null\"") @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "port", required = false) @QueryParam("port") @DefaultValue("") String port) {
-
-
- return MicroServiceWrapper.getInstance().getMicroServiceInstance(serviceName, version,port);
-
-
- }
-
- @PUT
- @Path("/{serviceName}/version/{version}")
- @ApiOperation(value = "update one microservice by serviceName and version", code = HttpStatus.SC_CREATED, response = MicroServiceFullInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update microservice fail", response = String.class),
- @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Unprocessable MicroServiceInfo JSON REQUEST", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateMicroService(
- @ApiParam(value = "microservice serviceName") @PathParam("serviceName") String serviceName,
- @ApiParam(value = "microservice version,if the version is empty, please enter \"null\"") @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "microservice Instance Info", required = true) MicroServiceInfo microServiceInfo) {
-
- MicroServiceFullInfo microServiceFullInfo = MicroServiceWrapper.getInstance().updateMicroServiceInstance(serviceName, version,
- microServiceInfo);
- return Response.created(uriInfo.getAbsolutePathBuilder().build()).entity(microServiceFullInfo).build();
-
- }
-
- @PUT
- @Path("/{serviceName}/version/{version}/nodes/{ip}/{port}")
- @ApiOperation(value = "update single node by serviceName and version and node", code = HttpStatus.SC_CREATED, response = MicroServiceFullInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "microservice not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update node fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateNode(
- @ApiParam(value = "microservice serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "microservice version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "ip") @PathParam("ip") String ip,
- @ApiParam(value = "port") @PathParam("port") String port,
- @ApiParam(value = "ttl") @QueryParam("ttl") int ttl) {
-
- MicroServiceFullInfo microServiceFullInfo = MicroServiceWrapper.getInstance().updateMicroServiceNode(serviceName, version, ip,port, ttl);
-
- return Response.created(uriInfo.getAbsolutePathBuilder().build()).entity(microServiceFullInfo).build();
-
- }
-
-
-
- @DELETE
- @Path("/{serviceName}/version/{version}/nodes/{ip}/{port}")
- @ApiOperation(value = "delete single node by serviceName and version and node", code = HttpStatus.SC_NO_CONTENT)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NO_CONTENT, message = "delete node succeed "),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "node not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "delete node fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public void deleteNode(
- @ApiParam(value = "microservice serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "microservice version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "ip") @PathParam("ip") String ip,
- @ApiParam(value = "port") @PathParam("port") String port) {
-
- MicroServiceWrapper.getInstance().deleteMicroServiceInstance(serviceName, version, ip,port);
-
- }
-
-
- @DELETE
- @Path("/{serviceName}/version/{version}")
- @ApiOperation(value = "delete one full microservice by serviceName and version", code = HttpStatus.SC_NO_CONTENT)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_NO_CONTENT, message = "delete microservice succeed "),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "microservice not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "delete microservice fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public void deleteMicroService(
- @ApiParam(value = "microservice serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "microservice version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "port", required = false) @QueryParam("port") @DefaultValue("") String port) {
-
-
- MicroServiceWrapper.getInstance().deleteMicroService(serviceName, version,port);
-
- }
-
- @PUT
- @Path("/{serviceName}/version/{version}/status/{status}")
- @ApiOperation(value = "update microservice status by serviceName and version", code = HttpStatus.SC_CREATED, response = MicroServiceFullInfo.class)
- @ApiResponses(value = {
- @ApiResponse(code = HttpStatus.SC_UNSUPPORTED_MEDIA_TYPE, message = "Unprocessable MicroServiceInfo Entity ", response = String.class),
- @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "microservice not found", response = String.class),
- @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "update status fail", response = String.class)})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public Response updateServiceStatus(
- @ApiParam(value = "microservice serviceName", required = true) @PathParam("serviceName") String serviceName,
- @ApiParam(value = "microservice version,if the version is empty, please enter \"null\"", required = false) @PathParam("version") @DefaultValue("") String version,
- @ApiParam(value = "status,1:abled 0:disabled") @PathParam("status") String status) {
-
- MicroServiceFullInfo microServiceFullInfo = MicroServiceWrapper.getInstance().updateMicroServiceStatus(serviceName, version,status);
-
- return Response.created(uriInfo.getAbsolutePathBuilder().build()).entity(microServiceFullInfo).build();
-
- }
-
-// @PUT
-// @Path("/ttl")
-// @ApiOperation(value = "test json date iso8601 ", code = 200, response = String.class)
-// @Produces(MediaType.APPLICATION_JSON)
-// @Timed
-// public String testIso8601(
-// @ApiParam(value = "microservice Instance Info", required = true) MicroServiceFullInfo microServiceInfo) {
-// Set<NodeInfo> nodes=microServiceInfo.getNodes();
-// String rtn="rtn:";
-// for(NodeInfo node:nodes){
-// Date date=node.getExpiration();
-// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
-// String datettl=sdf.format(date);
-// rtn+=datettl;
-// }
-//
-//
-// return rtn;
-// }
-}
diff --git a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ServiceAccessResource.java b/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ServiceAccessResource.java
deleted file mode 100644
index 6a2d741..0000000
--- a/apiroute/apiroute-service/src/main/java/org/openo/msb/resources/ServiceAccessResource.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
-* Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-package org.openo.msb.resources;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-import java.util.List;
-
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.openo.msb.api.ServiceAccessInfo;
-import org.openo.msb.wrapper.ServiceAccessWrapper;
-
-import com.codahale.metrics.annotation.Timed;
-
-
-@Path("/serviceaccess")
-@Api(tags = {"ServiceAccess"})
-@Produces(MediaType.APPLICATION_JSON)
-public class ServiceAccessResource {
-
- @GET
- @Path("/{serviceName}")
- @ApiOperation(value = "get the msb access address of the service ", response = ServiceAccessInfo.class)
- @ApiResponses(value = {@ApiResponse(code = 500, message = "get access address error ")})
- @Produces(MediaType.APPLICATION_JSON)
- @Timed
- public List<ServiceAccessInfo> getApiRoute(
- @ApiParam(value = "serviceName") @PathParam("serviceName") String serviceName,
- @ApiParam(value = "service type", allowableValues = "api,iui,custom,p2p") @QueryParam("type") String serviceType,
- @ApiParam(value = "version") @QueryParam("version") @DefaultValue("") String version,
- @ApiParam(hidden = true) @HeaderParam("Host") String host) {
-
- host=host.split(":")[0];
-
- return ServiceAccessWrapper.getInstance().getApiRouteAccessAddr(serviceType, serviceName,
- version, host);
-
- }
-}