summaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-05-15 21:02:51 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-15 21:02:51 +0000
commitff8b9a8873dcfca47696c43e36795e9635590b7a (patch)
tree869925954a5ef67f1f45092e7797fdc97cf69fc1 /adapters/mso-catalog-db-adapter/src
parent6a4c6a980a5998c996e3ebecd340eb438bba5bc8 (diff)
parente4687eeb77d9fddf14935894026aec0b1c9e3ac9 (diff)
Merge "store openstack request status in requestdb"
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src')
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/JerseyConfiguration.java5
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/ServiceRestImpl.java19
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql5
3 files changed, 18 insertions, 11 deletions
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<Service> queryServices(@QueryParam("modelName") String modelName,
- @QueryParam("distributionStatus") String distributionStatus, @QueryParam("depth") int depth) {
+ public List<Service> 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<Service> services = new ArrayList<>();
List<org.onap.so.db.catalog.beans.Service> 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