diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2017-10-17 16:24:44 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2017-10-17 16:24:52 +0800 |
commit | 2369e627ad6d0bede70edd5e3e5cb6f293a6768e (patch) | |
tree | 8525e489d4aa58c04016ac41f0eb4c2ccb183777 | |
parent | e60d5af03add391ead1689acce390bc44cc13e66 (diff) |
Fix rest request failed.
Change-Id: I7c56b9ec89c6e88a3d2c02d8390c62d704e78352
Issue-id: USECASEUI-36
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
8 files changed, 38 insertions, 38 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/UsecaseuiServerApplication.java b/server/src/main/java/org/onap/usecaseui/server/UsecaseuiServerApplication.java index 3bdbeb9a..a45a7ec9 100644 --- a/server/src/main/java/org/onap/usecaseui/server/UsecaseuiServerApplication.java +++ b/server/src/main/java/org/onap/usecaseui/server/UsecaseuiServerApplication.java @@ -42,32 +42,32 @@ public class UsecaseuiServerApplication { public static void main(String[] args) { SpringApplication.run(UsecaseuiServerApplication.class, args); - String msbUrl = RestfulServices.getMsbAddress(); - if (msbUrl.contains(":")) { - String[] ipAndPort = msbUrl.split(":"); - MSBServiceClient msbClient = new MSBServiceClient(ipAndPort[0], Integer.parseInt(ipAndPort[1])); - - MicroServiceInfo msinfo = new MicroServiceInfo(); - msinfo.setServiceName("usecase-ui-server"); - msinfo.setVersion("v1"); - msinfo.setUrl("/api/usecaseui/server/v1"); - msinfo.setProtocol("REST"); - msinfo.setVisualRange("0|1"); - - try { - Set<Node> nodes = new HashSet<>(); - Node node1 = new Node(); - node1.setIp(InetAddress.getLocalHost().getHostAddress()); - node1.setPort("8082"); - nodes.add(node1); - msinfo.setNodes(nodes); - msbClient.registerMicroServiceInfo(msinfo, false); - } catch (UnknownHostException e) { - e.printStackTrace(); - } catch (RouteException e) { - e.printStackTrace(); - } - } +// String msbUrl = RestfulServices.getMsbAddress(); +// if (msbUrl.contains(":")) { +// String[] ipAndPort = msbUrl.split(":"); +// MSBServiceClient msbClient = new MSBServiceClient(ipAndPort[0], Integer.parseInt(ipAndPort[1])); +// +// MicroServiceInfo msinfo = new MicroServiceInfo(); +// msinfo.setServiceName("usecase-ui-server"); +// msinfo.setVersion("v1"); +// msinfo.setUrl("/api/usecaseui/server/v1"); +// msinfo.setProtocol("REST"); +// msinfo.setVisualRange("0|1"); +// +// try { +// Set<Node> nodes = new HashSet<>(); +// Node node1 = new Node(); +// node1.setIp(InetAddress.getLocalHost().getHostAddress()); +// node1.setPort("8082"); +// nodes.add(node1); +// msinfo.setNodes(nodes); +// msbClient.registerMicroServiceInfo(msinfo, false); +// } catch (UnknownHostException e) { +// e.printStackTrace(); +// } catch (RouteException e) { +// e.printStackTrace(); +// } +// } } } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java index f7716feb..eb46596c 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/aai/AAIService.java @@ -35,7 +35,7 @@ public interface AAIService { "Accept: application/json" }) // @GET("/api/aai-business/v11/customers") - @GET("/aai/v11/business/customers") + @GET("/aai-business/v11/customers") Call<List<AAICustomer>> listCustomer(); @Headers({ @@ -45,7 +45,7 @@ public interface AAIService { "Accept: application/json" }) // @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") - @GET("/aai/v11/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") + @GET("/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") Call<List<ServiceInstance>> listServiceInstances(@Path("global-customer-id") String customerId, @Path("service-type") String serviceType); @Headers({ @@ -55,7 +55,7 @@ public interface AAIService { "Accept: application/json" }) // @GET("/cloud-infrastructure/cloud-regions") - @GET("/aai/v11/cloud-infrastructure/cloud-regions") + @GET("/aai-cloudInfrastructure/v11/cloud-regions") Call<List<VimInfo>> listVimInfo(); @Headers({ @@ -65,6 +65,6 @@ public interface AAIService { "Accept: application/json" }) // @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions") - @GET("/aai/v11/business/customers/customer/{global-customer-id}/service-subscriptions") + @GET("/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions") Call<List<AAIServiceSubscription>> listServiceSubscriptions(@Path("global-customer-id") String customerId); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java index 14acc027..f4dd388e 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/so/SOService.java @@ -23,12 +23,12 @@ import retrofit2.http.*; public interface SOService { - @POST("/so/e2eServiceInstances/v2") + @POST("/so-e2eServiceInstances/v2") Call<ServiceOperation> instantiateService(@Body RequestBody body); - @GET("/so/e2eServiceInstances/v2/{serviceId}/operations/{operationId}") + @GET("/so-e2eServiceInstances/v2/{serviceId}/operations/{operationId}") Call<OperationProgressInformation> queryOperationProgress(@Path("serviceId") String serviceId, @Path("operationId") String operationId); - @DELETE("/so/e2eServiceInstances/v2/{serviceId}") + @DELETE("/so-e2eServiceInstances/v2/{serviceId}") Call<ServiceOperation> terminateService(@Path("serviceId") String serviceId); } diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java index 84fc0505..9ece03e6 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultCustomerService.java @@ -39,7 +39,7 @@ public class DefaultCustomerService implements CustomerService { private AAIService aaiService; public DefaultCustomerService() { - this(RestfulServices.create("https://aai.api.simpledemo.openecomp.org:8443", AAIService.class)); + this(RestfulServices.create(AAIService.class)); } public DefaultCustomerService(AAIService aaiService) { diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java index 4a406839..9650cf69 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultPackageDistributionService.java @@ -46,7 +46,7 @@ public class DefaultPackageDistributionService implements PackageDistributionSer private VfcService vfcService; public DefaultPackageDistributionService() { - this(create("https://sdc.api.simpledemo.openecomp.org:8443", SDCCatalogService.class), create(VfcService.class)); + this(create(SDCCatalogService.class), create(VfcService.class)); } public DefaultPackageDistributionService(SDCCatalogService sdcCatalogService, VfcService vfcService) { diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java index 99064719..540a0dad 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java @@ -38,7 +38,7 @@ public class DefaultServiceInstanceService implements ServiceInstanceService { private AAIService aaiService; public DefaultServiceInstanceService() { - this(RestfulServices.create("https://aai.api.simpledemo.openecomp.org:8443", AAIService.class)); + this(RestfulServices.create(AAIService.class)); } public DefaultServiceInstanceService(AAIService aaiService) { diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateService.java index 80e16b56..c2644f82 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceTemplateService.java @@ -56,7 +56,7 @@ public class DefaultServiceTemplateService implements ServiceTemplateService { private AAIService aaiService; public DefaultServiceTemplateService() { - this(RestfulServices.create("https://sdc.api.simpledemo.openecomp.org:8443", SDCCatalogService.class), RestfulServices.create("https://aai.api.simpledemo.openecomp.org:8443", AAIService.class)); + this(RestfulServices.create(SDCCatalogService.class), RestfulServices.create(AAIService.class)); } public DefaultServiceTemplateService(SDCCatalogService sdcCatalog, AAIService aaiService) { diff --git a/server/src/main/java/org/onap/usecaseui/server/util/RestfulServices.java b/server/src/main/java/org/onap/usecaseui/server/util/RestfulServices.java index 4aa7c33d..d2295da5 100644 --- a/server/src/main/java/org/onap/usecaseui/server/util/RestfulServices.java +++ b/server/src/main/java/org/onap/usecaseui/server/util/RestfulServices.java @@ -37,7 +37,7 @@ public class RestfulServices { public static <T> T create(Class<T> clazz) { String msbUrl = getMsbAddress(); Retrofit retrofit = new Retrofit.Builder() - .baseUrl("http://" + msbUrl) + .baseUrl("http://" + msbUrl+"/api") .addConverterFactory(JacksonConverterFactory.create()) .build(); return retrofit.create(clazz); |