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();
+// }
+// }
}
}
"Accept: application/json"
})
// @GET("/api/aai-business/v11/customers")
- @GET("/aai/v11/business/customers")
+ @GET("/aai-business/v11/customers")
Call<List<AAICustomer>> listCustomer();
@Headers({
"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({
"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({
"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);
}
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);
}
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) {
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) {
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) {
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) {
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);