From e4687eeb77d9fddf14935894026aec0b1c9e3ac9 Mon Sep 17 00:00:00 2001 From: "Smokowski, Steven" Date: Wed, 15 May 2019 14:19:49 -0400 Subject: store openstack request status in requestdb Openstack request status now stored in request db Change-Id: Ida8f4f613d406c2b834ab190e01d5aaf2f16dd3d Issue-ID: SO-1867 Signed-off-by: Benjamin, Max (mb388a) --- .../so/adapters/catalogdb/JerseyConfiguration.java | 5 ++--- .../so/adapters/catalogdb/rest/ServiceRestImpl.java | 19 ++++++++++++------- .../src/main/resources/db/migration/R__MacroData.sql | 5 ++++- 3 files changed, 18 insertions(+), 11 deletions(-) (limited to 'adapters/mso-catalog-db-adapter') diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java index 0e526e59fb..79aad1ad1a 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java @@ -44,10 +44,9 @@ public class JerseyConfiguration extends ResourceConfig { register(ServiceRestImpl.class); BeanConfig beanConfig = new BeanConfig(); beanConfig.setVersion("1.0.2"); - beanConfig.setSchemes(new String[] {"http"}); - beanConfig.setHost("localhost:8080"); + beanConfig.setSchemes(new String[] {"https"}); beanConfig.setBasePath("/ecomp/mso/catalog"); - beanConfig.setResourcePackage("org.onap.so.adapters.catalogdb"); + beanConfig.setResourcePackage("org.onap.so.adapters.catalogdb.rest"); beanConfig.setPrettyPrint(true); beanConfig.setScan(true); } diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java index 1ca8998396..520de4d38c 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java @@ -28,16 +28,18 @@ import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.onap.so.db.catalog.data.repository.ServiceRepository; import org.onap.so.rest.catalog.beans.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import com.google.common.base.Strings; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; -@Path("/v1/") +@Api(value = "/v1/services", tags = "model") +@Path("/v1/services") @Component public class ServiceRestImpl { @@ -48,7 +50,7 @@ public class ServiceRestImpl { private ServiceMapper serviceMapper; @GET - @Path("/services/{modelUUID}") + @Path("/{modelUUID}") @Produces({MediaType.APPLICATION_JSON}) @Transactional(readOnly = true) public Service findService(@PathParam("modelUUID") String modelUUID, @QueryParam("depth") int depth) { @@ -57,12 +59,15 @@ public class ServiceRestImpl { } @GET - @Path("/services") - @ApiOperation(value = "Find Service Models", response = Service.class, responseContainer = "List") + @ApiOperation(value = "Find Service Models", response = Service.class, responseContainer = "List", + notes = "If no query parameters are sent an empty list will be returned") @Produces({MediaType.APPLICATION_JSON}) @Transactional(readOnly = true) - public List queryServices(@QueryParam("modelName") String modelName, - @QueryParam("distributionStatus") String distributionStatus, @QueryParam("depth") int depth) { + public List queryServices( + @ApiParam(value = "modelName", required = false) @QueryParam("modelName") String modelName, + @ApiParam(value = "distributionStatus", + required = false) @QueryParam("distributionStatus") String distributionStatus, + @ApiParam(value = "depth", required = false) @QueryParam("depth") int depth) { List services = new ArrayList<>(); List serviceFromDB = new ArrayList<>(); if (!Strings.isNullOrEmpty(modelName) && !Strings.isNullOrEmpty(distributionStatus)) { diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index 238c4cf467..0f46e91311 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -776,4 +776,7 @@ UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY) VALUES ('GenericVnfHealthCheckBB', '*', '*', '*', "*" , 'Retry'), -('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry'); \ No newline at end of file +('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry'); + + +UPDATE rainy_day_handler_macro SET reg_ex_error_message = '*' WHERE reg_ex_error_message IS null; \ No newline at end of file -- cgit 1.2.3-korg