diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2017-10-17 13:40:40 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2017-10-17 13:40:47 +0800 |
commit | e60d5af03add391ead1689acce390bc44cc13e66 (patch) | |
tree | 143b0de663289fc04adeb89155d0adf1849db46c | |
parent | 100674aa613c38a2567ff0becb0e4679e1d5c757 (diff) |
change rest url for lab env.
Change-Id: I665efef1d899f8e66ef854ee0d5bf425d4c351fe
Issue-id: USECASEUI-36
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
8 files changed, 32 insertions, 16 deletions
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 ff5ffc7f..f7716feb 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 @@ -31,32 +31,40 @@ public interface AAIService { @Headers({ "X-TransactionId: 7777", "X-FromAppId: uui", - "Authorization: QUFJOkFBSQ==" + "Authorization: QUFJOkFBSQ==", + "Accept: application/json" }) - @GET("/api/aai-business/v11/customers") +// @GET("/api/aai-business/v11/customers") + @GET("/aai/v11/business/customers") Call<List<AAICustomer>> listCustomer(); @Headers({ "X-TransactionId: 7777", "X-FromAppId: uui", - "Authorization: QUFJOkFBSQ==" + "Authorization: QUFJOkFBSQ==", + "Accept: application/json" }) - @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances") +// @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") Call<List<ServiceInstance>> listServiceInstances(@Path("global-customer-id") String customerId, @Path("service-type") String serviceType); @Headers({ "X-TransactionId: 7777", "X-FromAppId: uui", - "Authorization: QUFJOkFBSQ==" + "Authorization: QUFJOkFBSQ==", + "Accept: application/json" }) - @GET("/cloud-infrastructure/cloud-regions") +// @GET("/cloud-infrastructure/cloud-regions") + @GET("/aai/v11/cloud-infrastructure/cloud-regions") Call<List<VimInfo>> listVimInfo(); @Headers({ "X-TransactionId: 7777", "X-FromAppId: uui", - "Authorization: QUFJOkFBSQ==" + "Authorization: QUFJOkFBSQ==", + "Accept: application/json" }) - @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions") +// @GET("/api/aai-business/v11/customers/customer/{global-customer-id}/service-subscriptions") + @GET("/aai/v11/business/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/sdc/consts/SDCConsts.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/consts/SDCConsts.java index 76914e4a..e68b9f9e 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/consts/SDCConsts.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/sdc/consts/SDCConsts.java @@ -17,7 +17,7 @@ package org.onap.usecaseui.server.service.lcm.domain.sdc.consts; public class SDCConsts { - public static final String CATEGORY_E2E_SERVICE = "e2e"; + public static final String CATEGORY_E2E_SERVICE = "E2E%20Service"; public static final String CATEGORY_NS = "ns"; public static final String DISTRIBUTION_STATUS_DISTRIBUTED = "DISTRIBUTED"; public static final String RESOURCETYPE_VF = "VF"; diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java index 9c7aa2b5..f7620742 100644 --- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java +++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/domain/vfc/VfcService.java @@ -27,12 +27,12 @@ import retrofit2.http.Path; public interface VfcService { - @POST("/nspackages") + @POST("/api/catalog/v1/nspackages") Call<DistributionResult> distributeNsPackage(@Body Csar csar); - @POST("/vnfpackages") + @POST("/api/catalog/v1/vnfpackages") Call<Job> distributeVnfPackage(@Body Csar csar); - @GET("/jobs/{jobId}") + @GET("/api/nslcm/v1/jobs/{jobId}") Call<JobStatus> getJobStatus(@Path("jobId") String jobId); } 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 9ece03e6..84fc0505 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(AAIService.class)); + this(RestfulServices.create("https://aai.api.simpledemo.openecomp.org:8443", 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 9650cf69..4a406839 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(SDCCatalogService.class), create(VfcService.class)); + this(create("https://sdc.api.simpledemo.openecomp.org:8443", 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 540a0dad..99064719 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(AAIService.class)); + this(RestfulServices.create("https://aai.api.simpledemo.openecomp.org:8443", 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 c2644f82..80e16b56 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(SDCCatalogService.class), RestfulServices.create(AAIService.class)); + this(RestfulServices.create("https://sdc.api.simpledemo.openecomp.org:8443", SDCCatalogService.class), RestfulServices.create("https://aai.api.simpledemo.openecomp.org:8443", 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 83ba466c..4aa7c33d 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 @@ -26,6 +26,14 @@ import java.io.IOException; public class RestfulServices { + public static <T> T create(String baseUrl, Class<T> clazz) { + Retrofit retrofit = new Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(JacksonConverterFactory.create()) + .build(); + return retrofit.create(clazz); + } + public static <T> T create(Class<T> clazz) { String msbUrl = getMsbAddress(); Retrofit retrofit = new Retrofit.Builder() |