diff options
author | Steve Smokowski <ss835w@att.com> | 2019-05-15 21:02:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-05-15 21:02:51 +0000 |
commit | ff8b9a8873dcfca47696c43e36795e9635590b7a (patch) | |
tree | 869925954a5ef67f1f45092e7797fdc97cf69fc1 /adapters/mso-catalog-db-adapter/src/main/java | |
parent | 6a4c6a980a5998c996e3ebecd340eb438bba5bc8 (diff) | |
parent | e4687eeb77d9fddf14935894026aec0b1c9e3ac9 (diff) |
Merge "store openstack request status in requestdb"
Diffstat (limited to 'adapters/mso-catalog-db-adapter/src/main/java')
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)) { |