2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2018 IBM.
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.adapters.catalogdb.rest;
27 import java.util.ArrayList;
28 import java.util.List;
29 import javax.ws.rs.GET;
30 import javax.ws.rs.Path;
31 import javax.ws.rs.PathParam;
32 import javax.ws.rs.Produces;
33 import javax.ws.rs.QueryParam;
34 import javax.ws.rs.core.GenericEntity;
35 import javax.ws.rs.core.HttpHeaders;
36 import javax.ws.rs.core.MediaType;
37 import javax.ws.rs.core.Response;
38 import org.apache.http.HttpStatus;
39 import org.onap.so.adapters.catalogdb.catalogrest.CatalogQuery;
40 import org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryException;
41 import org.onap.so.adapters.catalogdb.catalogrest.CatalogQueryExceptionCategory;
42 import org.onap.so.adapters.catalogdb.catalogrest.QueryAllottedResourceCustomization;
43 import org.onap.so.adapters.catalogdb.catalogrest.QueryResourceRecipe;
44 import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceCsar;
45 import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceMacroHolder;
46 import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceNetworks;
47 import org.onap.so.adapters.catalogdb.catalogrest.QueryServiceVnfs;
48 import org.onap.so.adapters.catalogdb.catalogrest.QueryVfModule;
49 import org.onap.so.db.catalog.beans.AllottedResource;
50 import org.onap.so.db.catalog.beans.AllottedResourceCustomization;
51 import org.onap.so.db.catalog.beans.NetworkResource;
52 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
53 import org.onap.so.db.catalog.beans.Recipe;
54 import org.onap.so.db.catalog.beans.Service;
55 import org.onap.so.db.catalog.beans.ToscaCsar;
56 import org.onap.so.db.catalog.beans.VfModule;
57 import org.onap.so.db.catalog.beans.VfModuleCustomization;
58 import org.onap.so.db.catalog.beans.VnfResource;
59 import org.onap.so.db.catalog.beans.VnfResourceCustomization;
60 import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository;
61 import org.onap.so.db.catalog.data.repository.AllottedResourceRepository;
62 import org.onap.so.db.catalog.data.repository.ArRecipeRepository;
63 import org.onap.so.db.catalog.data.repository.NetworkRecipeRepository;
64 import org.onap.so.db.catalog.data.repository.NetworkResourceCustomizationRepository;
65 import org.onap.so.db.catalog.data.repository.NetworkResourceRepository;
66 import org.onap.so.db.catalog.data.repository.ServiceRepository;
67 import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
68 import org.onap.so.db.catalog.data.repository.VFModuleRepository;
69 import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository;
70 import org.onap.so.db.catalog.data.repository.VnfRecipeRepository;
71 import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
72 import org.onap.so.db.catalog.rest.beans.ServiceMacroHolder;
73 import org.slf4j.Logger;
74 import org.slf4j.LoggerFactory;
75 import org.springframework.beans.factory.annotation.Autowired;
76 import org.springframework.stereotype.Component;
77 import org.springframework.transaction.annotation.Transactional;
80 @Path("/{version: v[0-9]+}")
82 public class CatalogDbAdapterRest {
83 protected static Logger logger = LoggerFactory.getLogger(CatalogDbAdapterRest.class);
84 private static final boolean IS_ARRAY = true;
85 private static final String NETWORK_SERVICE = "network service";
88 private VnfCustomizationRepository vnfCustomizationRepo;
91 private ServiceRepository serviceRepo;
94 private NetworkResourceCustomizationRepository networkCustomizationRepo;
97 private NetworkResourceRepository networkResourceRepo;
100 private AllottedResourceCustomizationRepository allottedCustomizationRepo;
103 private ToscaCsarRepository toscaCsarRepo;
106 private VFModuleRepository vfModuleRepo;
109 private VnfRecipeRepository vnfRecipeRepo;
112 private NetworkRecipeRepository networkRecipeRepo;
115 private ArRecipeRepository arRecipeRepo;
118 private VnfResourceRepository vnfResourceRepo;
121 private AllottedResourceRepository arResourceRepo;
123 private static final String NO_MATCHING_PARAMETERS = "no matching parameters";
125 public Response respond(String version, int respStatus, boolean isArray, CatalogQuery qryResp) {
126 return Response.status(respStatus).entity(qryResp.toJsonString(version, isArray))
127 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
131 @Path("vnfResources/{vnfModelCustomizationUuid}")
132 @Transactional(readOnly = true)
133 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
134 public Response serviceVnfs(@PathParam("version") String version,
135 @PathParam("vnfModelCustomizationUuid") String vnfUuid) {
136 return serviceVnfsImpl(version, !IS_ARRAY, vnfUuid, null, null, null, null);
141 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
142 @Transactional(readOnly = true)
143 public Response serviceVnfs(@PathParam("version") String version,
144 @QueryParam("vnfModelCustomizationUuid") String vnfUuid, @QueryParam("serviceModelUuid") String smUuid,
145 @QueryParam("serviceModelInvariantUuid") String smiUuid, @QueryParam("serviceModelVersion") String smVer,
146 @QueryParam("serviceModelName") String smName) {
147 return serviceVnfsImpl(version, IS_ARRAY, vnfUuid, smUuid, smiUuid, smVer, smName);
150 public Response serviceVnfsImpl(String version, boolean isArray, String vnfUuid, String serviceModelUUID,
151 String smiUuid, String smVer, String smName) {
152 QueryServiceVnfs qryResp = null;
153 int respStatus = HttpStatus.SC_OK;
154 List<VnfResourceCustomization> ret = new ArrayList<>();
155 Service service = null;
157 if (vnfUuid != null && !"".equals(vnfUuid))
158 ret = vnfCustomizationRepo.findByModelCustomizationUUID(vnfUuid);
159 else if (serviceModelUUID != null && !"".equals(serviceModelUUID))
160 service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(serviceModelUUID);
161 else if (smiUuid != null && !"".equals(smiUuid))
162 if (smVer != null && !"".equals(smVer))
163 service = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(smVer, smiUuid);
165 service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(smiUuid);
166 else if (smName != null && !"".equals(smName)) {
167 if (smVer != null && !"".equals(smVer))
168 service = serviceRepo.findByModelNameAndModelVersion(smName, smVer);
170 service = serviceRepo.findFirstByModelNameOrderByModelVersionDesc(smName);
172 throw (new Exception(NO_MATCHING_PARAMETERS));
175 if (service == null && ret.isEmpty()) {
176 respStatus = HttpStatus.SC_NOT_FOUND;
177 qryResp = new QueryServiceVnfs();
178 } else if (service == null && !ret.isEmpty()) {
179 qryResp = new QueryServiceVnfs(ret);
180 } else if (service != null) {
181 qryResp = new QueryServiceVnfs(service.getVnfCustomizations());
183 logger.debug("serviceVnfs qryResp= {}", qryResp);
184 return respond(version, respStatus, isArray, qryResp);
185 } catch (Exception e) {
186 logger.error("Exception - queryServiceVnfs", e);
187 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
188 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
189 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
190 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
195 @Path("networkResources/{networkModelCustomizationUuid}")
196 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
197 @Transactional(readOnly = true)
198 public Response serviceNetworks(@PathParam("version") String version,
199 @PathParam("networkModelCustomizationUuid") String nUuid) {
200 return serviceNetworksImpl(version, !IS_ARRAY, nUuid, null, null, null, null);
204 @Path("serviceNetworks")
205 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
206 @Transactional(readOnly = true)
207 public Response serviceNetworks(@PathParam("version") String version,
208 @QueryParam("networkModelCustomizationUuid") String networkModelCustomizationUuid,
209 @QueryParam("networkType") String networkType, @QueryParam("networkModelName") String networkModelName,
210 @QueryParam("serviceModelUuid") String serviceModelUuid,
211 @QueryParam("serviceModelInvariantUuid") String serviceModelInvariantUuid,
212 @QueryParam("serviceModelVersion") String serviceModelVersion,
213 @QueryParam("networkModelVersion") String networkModelVersion) {
214 if (networkModelName != null && !"".equals(networkModelName)) {
215 networkType = networkModelName;
217 return serviceNetworksImpl(version, IS_ARRAY, networkModelCustomizationUuid, networkType, serviceModelUuid,
218 serviceModelInvariantUuid, serviceModelVersion);
221 public Response serviceNetworksImpl(String version, boolean isArray, String networkModelCustomizationUuid,
222 String networkType, String serviceModelUuid, String serviceModelInvariantUuid, String serviceModelVersion) {
223 QueryServiceNetworks qryResp;
224 int respStatus = HttpStatus.SC_OK;
226 List<NetworkResourceCustomization> ret = new ArrayList<>();
227 Service service = null;
230 if (networkModelCustomizationUuid != null && !"".equals(networkModelCustomizationUuid)) {
231 uuid = networkModelCustomizationUuid;
232 ret = networkCustomizationRepo.findByModelCustomizationUUID(networkModelCustomizationUuid);
233 } else if (networkType != null && !"".equals(networkType)) {
235 NetworkResource networkResources =
236 networkResourceRepo.findFirstByModelNameOrderByModelVersionDesc(networkType);
237 if (networkResources != null)
238 ret = networkResources.getNetworkResourceCustomization();
239 } else if (serviceModelInvariantUuid != null && !"".equals(serviceModelInvariantUuid)) {
240 uuid = serviceModelInvariantUuid;
241 if (serviceModelVersion != null && !"".equals(serviceModelVersion)) {
242 service = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(serviceModelVersion, uuid);
244 service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid);
246 } else if (serviceModelUuid != null && !"".equals(serviceModelUuid)) {
247 uuid = serviceModelUuid;
248 service = serviceRepo.findOneByModelUUID(serviceModelUuid);
250 throw (new Exception(NO_MATCHING_PARAMETERS));
254 ret = service.getNetworkCustomizations();
256 if (ret == null || ret.isEmpty()) {
257 logger.debug("serviceNetworks not found");
258 respStatus = HttpStatus.SC_NOT_FOUND;
259 qryResp = new QueryServiceNetworks();
261 qryResp = new QueryServiceNetworks(ret);
262 logger.debug("serviceNetworks found qryResp= {}", qryResp);
264 return respond(version, respStatus, isArray, qryResp);
265 } catch (Exception e) {
266 logger.error("Exception - queryServiceNetworks", e);
267 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
268 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
269 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
270 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
275 @Path("serviceResources")
276 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
277 @Transactional(readOnly = true)
278 public Response serviceResources(@PathParam("version") String version,
279 @QueryParam("serviceModelUuid") String modelUUID,
280 @QueryParam("serviceModelInvariantUuid") String modelInvariantUUID,
281 @QueryParam("serviceModelVersion") String modelVersion) {
283 QueryServiceMacroHolder qryResp;
284 int respStatus = HttpStatus.SC_OK;
286 ServiceMacroHolder ret = new ServiceMacroHolder();
289 if (modelUUID != null && !"".equals(modelUUID)) {
291 logger.debug("Query serviceMacroHolder getAllResourcesByServiceModelUuid serviceModelUuid: {}", uuid);
292 Service serv = serviceRepo.findOneByModelUUID(uuid);
295 ret.setNetworkResourceCustomizations(new ArrayList(serv.getNetworkCustomizations()));
296 ret.setVnfResourceCustomizations(new ArrayList(serv.getVnfCustomizations()));
297 ret.setAllottedResourceCustomizations(new ArrayList(serv.getAllottedCustomizations()));
299 ret.setService(serv);
300 } else if (modelInvariantUUID != null && !"".equals(modelInvariantUUID)) {
301 uuid = modelInvariantUUID;
302 if (modelVersion != null && !"".equals(modelVersion)) {
304 "Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelInvariantUuid: {} serviceModelVersion: {}",
306 Service serv = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(modelVersion, uuid);
308 ret.setService(serv);
311 "Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelUuid: {}",
313 Service serv = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid);
314 ret.setService(serv);
317 throw (new Exception(NO_MATCHING_PARAMETERS));
320 if (ret.getService() == null) {
321 logger.debug("serviceMacroHolder not found");
322 respStatus = HttpStatus.SC_NOT_FOUND;
323 qryResp = new QueryServiceMacroHolder();
325 qryResp = new QueryServiceMacroHolder(ret);
326 logger.debug("serviceMacroHolder qryResp= {}", qryResp);
328 return respond(version, respStatus, IS_ARRAY, qryResp);
329 } catch (Exception e) {
330 logger.error("Exception - queryServiceMacroHolder", e);
331 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
332 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
333 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
334 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
340 @Path("allottedResources/{arModelCustomizationUuid}")
341 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
342 @Transactional(readOnly = true)
343 public Response serviceAllottedResources(@PathParam("version") String version,
344 @PathParam("arModelCustomizationUuid") String aUuid) {
345 return serviceAllottedResourcesImpl(version, !IS_ARRAY, aUuid, null, null, null);
349 @Path("serviceAllottedResources")
350 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
351 @Transactional(readOnly = true)
352 public Response serviceAllottedResources(@PathParam("version") String version,
353 @QueryParam("serviceModelUuid") String smUuid, @QueryParam("serviceModelInvariantUuid") String smiUuid,
354 @QueryParam("serviceModelVersion") String smVer, @QueryParam("arModelCustomizationUuid") String aUuid) {
355 return serviceAllottedResourcesImpl(version, IS_ARRAY, aUuid, smUuid, smiUuid, smVer);
358 public Response serviceAllottedResourcesImpl(String version, boolean isArray, String aUuid, String smUuid,
359 String serviceModelInvariantUuid, String smVer) {
360 QueryAllottedResourceCustomization qryResp;
361 int respStatus = HttpStatus.SC_OK;
363 List<AllottedResourceCustomization> ret = new ArrayList<>();
364 Service service = null;
366 if (smUuid != null && !"".equals(smUuid)) {
368 service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(uuid);
369 } else if (serviceModelInvariantUuid != null && !"".equals(serviceModelInvariantUuid)) {
370 uuid = serviceModelInvariantUuid;
371 if (smVer != null && !"".equals(smVer)) {
372 service = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(smVer, uuid);
374 service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid);
376 } else if (aUuid != null && !"".equals(aUuid)) {
378 ret = allottedCustomizationRepo.findByModelCustomizationUUID(uuid);
380 throw (new Exception(NO_MATCHING_PARAMETERS));
384 ret = service.getAllottedCustomizations();
386 if (ret == null || ret.isEmpty()) {
387 logger.debug("AllottedResourceCustomization not found");
388 respStatus = HttpStatus.SC_NOT_FOUND;
389 qryResp = new QueryAllottedResourceCustomization();
391 qryResp = new QueryAllottedResourceCustomization(ret);
392 logger.debug("AllottedResourceCustomization qryResp= {}", qryResp);
394 return respond(version, respStatus, isArray, qryResp);
395 } catch (Exception e) {
396 logger.error("Exception - queryAllottedResourceCustomization", e);
397 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
398 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
399 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
400 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
406 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
407 @Transactional(readOnly = true)
408 public Response vfModules(@QueryParam("vfModuleModelName") String vfModuleModelName) {
409 QueryVfModule qryResp;
410 int respStatus = HttpStatus.SC_OK;
411 List<VfModuleCustomization> ret = null;
413 if (vfModuleModelName != null && !"".equals(vfModuleModelName)) {
414 VfModule vfModule = vfModuleRepo.findFirstByModelNameOrderByModelVersionDesc(vfModuleModelName);
415 if (vfModule != null)
416 ret = vfModule.getVfModuleCustomization();
418 throw (new Exception(NO_MATCHING_PARAMETERS));
421 if (ret == null || ret.isEmpty()) {
422 logger.debug("vfModules not found");
423 respStatus = HttpStatus.SC_NOT_FOUND;
424 qryResp = new QueryVfModule();
426 qryResp = new QueryVfModule(ret);
427 if (logger.isDebugEnabled())
428 logger.debug("vfModules tojsonstring is: {}", qryResp.JSON2(false, false));
430 return Response.status(respStatus).entity(qryResp.JSON2(false, false))
431 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
432 } catch (Exception e) {
433 logger.error("Exception during query VfModules by vfModuleModuleName: ", e);
434 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
435 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
436 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
437 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
442 * Get the tosca csar info from catalog <br>
444 * @param smUuid service model uuid
445 * @return the tosca csar information of the serivce.
446 * @since ONAP Beijing Release
449 @Path("serviceToscaCsar")
450 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
451 public Response serviceToscaCsar(@QueryParam("serviceModelUuid") String smUuid) {
452 int respStatus = HttpStatus.SC_OK;
455 if (smUuid != null && !"".equals(smUuid)) {
456 logger.debug("Query Csar by service model uuid: {}", smUuid);
458 Service service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(smUuid);
460 if (service != null) {
461 ToscaCsar toscaCsar = service.getCsar();
462 if (toscaCsar != null) {
463 QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
464 entity = serviceCsar.JSON2(false, false);
466 respStatus = HttpStatus.SC_NOT_FOUND;
469 respStatus = HttpStatus.SC_NOT_FOUND;
473 throw (new Exception("Incoming parameter is null or blank"));
475 return Response.status(respStatus).entity(entity)
476 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
477 } catch (Exception e) {
478 logger.error("Exception during query csar by service model uuid: ", e);
479 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
480 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
481 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
482 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
487 * Get the resource recipe info from catalog <br>
489 * @param rmUuid resource model uuid
490 * @return the recipe information of the resource.
491 * @since ONAP Beijing Release
494 @Path("resourceRecipe")
495 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
496 public Response resourceRecipe(@QueryParam("resourceModelUuid") String rmUuid,
497 @QueryParam("action") String action) {
498 int respStatus = HttpStatus.SC_OK;
501 if (rmUuid != null && !"".equals(rmUuid)) {
502 logger.debug("Query recipe by resource model uuid: {}", rmUuid);
503 // check vnf and network and ar, the resource could be any resource.
504 Recipe recipe = null;
506 VnfResource vnf = vnfResourceRepo.findResourceByModelUUID(rmUuid);
508 recipe = vnfRecipeRepo.findFirstVnfRecipeByNfRoleAndActionAndVersionStr(vnf.getModelName(), action,
509 vnf.getModelVersion());
511 // for network service fetch the default recipe
512 if (recipe == null && vnf.getSubCategory().equalsIgnoreCase(NETWORK_SERVICE)) {
513 recipe = vnfRecipeRepo.findFirstVnfRecipeByNfRoleAndAction("NS_DEFAULT", action);
518 if (null == recipe) {
519 NetworkResource nResource = networkResourceRepo.findResourceByModelUUID(rmUuid);
521 if (nResource != null) {
522 recipe = networkRecipeRepo.findFirstByModelNameAndActionAndVersionStr(nResource.getModelName(),
523 action, nResource.getModelVersion());
525 // for network fetch the default recipe
526 if (recipe == null) {
527 recipe = networkRecipeRepo.findFirstByModelNameAndAction("SDNC_DEFAULT", action);
532 if (null == recipe) {
533 AllottedResource arResource = arResourceRepo.findResourceByModelUUID(rmUuid);
534 if (arResource != null) {
535 recipe = arRecipeRepo.findByModelNameAndActionAndVersion(arResource.getModelName(), action,
536 arResource.getModelVersion());
539 if (recipe != null) {
540 QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe);
541 entity = resourceRecipe.JSON2(false, false);
543 respStatus = HttpStatus.SC_NOT_FOUND;
546 throw new Exception("Incoming parameter is null or blank");
548 return Response.status(respStatus).entity(entity)
549 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
550 } catch (Exception e) {
551 logger.error("Exception during query recipe by resource model uuid: ", e);
552 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
553 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
554 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
555 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();