X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fportalapp%2Fportal%2Fcontroller%2FMicroserviceController.java;h=42a62b5f686d4a3c9931646cd0c11cfc7d373716;hb=b58317907044b0cd72f1cdd8582800dc2c764b40;hp=bc21dd98b0aa5782905f9c68881e5c3184e0a5f3;hpb=c67680ada04c96a1753c037d67080c65628d32ca;p=portal.git diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java index bc21dd98..42a62b5f 100644 --- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java +++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java @@ -33,6 +33,7 @@ import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum; import org.openecomp.portalapp.portal.logging.aop.EPAuditLog; import org.openecomp.portalapp.portal.service.ConsulHealthService; import org.openecomp.portalapp.portal.service.MicroserviceService; +import org.openecomp.portalapp.portal.utils.EcompPortalUtils; import org.openecomp.portalsdk.core.util.SystemProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; @@ -54,8 +55,6 @@ import org.springframework.web.client.RestTemplate; @EPAuditLog public class MicroserviceController extends EPRestrictedBaseController { - private static final String HTTPS = "https://"; - String whatService = "widgets-service"; RestTemplate template = new RestTemplate(); @@ -64,7 +63,7 @@ public class MicroserviceController extends EPRestrictedBaseController { @Autowired private MicroserviceService microserviceService; - + @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST) public PortalRestResponse createMicroservice(HttpServletRequest request, HttpServletResponse response, @RequestBody MicroserviceData newServiceData) throws Exception { @@ -114,7 +113,7 @@ public class MicroserviceController extends EPRestrictedBaseController { }; // If this service is assoicated with widgets, cannnot be deleted ResponseEntity> ans = (ResponseEntity>) template.exchange( - HTTPS + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port")) + EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port")) + "/widget/microservices/widgetCatalog/service/" + serviceId, HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef); List widgets = ans.getBody();