aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-catalog-db-adapter/src/main/java
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2019-05-15 14:19:49 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-05-15 14:19:58 -0400
commite4687eeb77d9fddf14935894026aec0b1c9e3ac9 (patch)
tree47c85cd95c71d36a404da6c83fbbb5d11fb0fb2c /adapters/mso-catalog-db-adapter/src/main/java
parentf9c309fb9e789225ccd6b02ec9ab4777bbd4021c (diff)
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) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/main/java')
-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
2 files changed, 14 insertions, 10 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)) {