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) {
282 QueryServiceMacroHolder qryResp;
283 int respStatus = HttpStatus.SC_OK;
285 ServiceMacroHolder ret = new ServiceMacroHolder();
288 if (modelUUID != null && !"".equals(modelUUID)) {
290 logger.debug("Query serviceMacroHolder getAllResourcesByServiceModelUuid serviceModelUuid: {}", uuid);
291 Service serv = serviceRepo.findOneByModelUUID(uuid);
294 ret.setNetworkResourceCustomizations(new ArrayList(serv.getNetworkCustomizations()));
295 ret.setVnfResourceCustomizations(new ArrayList(serv.getVnfCustomizations()));
296 ret.setAllottedResourceCustomizations(new ArrayList(serv.getAllottedCustomizations()));
298 ret.setService(serv);
299 } else if (modelInvariantUUID != null && !"".equals(modelInvariantUUID)) {
300 uuid = modelInvariantUUID;
301 if (modelVersion != null && !"".equals(modelVersion)) {
303 "Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelInvariantUuid: {} serviceModelVersion: {}",
305 Service serv = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(modelVersion, uuid);
307 ret.setService(serv);
310 "Query serviceMacroHolder getAllResourcesByServiceModelInvariantUuid serviceModelUuid: {}",
312 Service serv = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid);
313 ret.setService(serv);
316 throw (new Exception(NO_MATCHING_PARAMETERS));
319 if (ret.getService() == null) {
320 logger.debug("serviceMacroHolder not found");
321 respStatus = HttpStatus.SC_NOT_FOUND;
322 qryResp = new QueryServiceMacroHolder();
324 qryResp = new QueryServiceMacroHolder(ret);
325 logger.debug("serviceMacroHolder qryResp= {}", qryResp);
327 return respond(version, respStatus, IS_ARRAY, qryResp);
328 } catch (Exception e) {
329 logger.error("Exception - queryServiceMacroHolder", e);
330 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
331 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
332 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
333 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
339 @Path("allottedResources/{arModelCustomizationUuid}")
340 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
341 @Transactional(readOnly = true)
342 public Response serviceAllottedResources(@PathParam("version") String version,
343 @PathParam("arModelCustomizationUuid") String aUuid) {
344 return serviceAllottedResourcesImpl(version, !IS_ARRAY, aUuid, null, null, null);
348 @Path("serviceAllottedResources")
349 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
350 @Transactional(readOnly = true)
351 public Response serviceAllottedResources(@PathParam("version") String version,
352 @QueryParam("serviceModelUuid") String smUuid, @QueryParam("serviceModelInvariantUuid") String smiUuid,
353 @QueryParam("serviceModelVersion") String smVer, @QueryParam("arModelCustomizationUuid") String aUuid) {
354 return serviceAllottedResourcesImpl(version, IS_ARRAY, aUuid, smUuid, smiUuid, smVer);
357 public Response serviceAllottedResourcesImpl(String version, boolean isArray, String aUuid, String smUuid,
358 String serviceModelInvariantUuid, String smVer) {
359 QueryAllottedResourceCustomization qryResp;
360 int respStatus = HttpStatus.SC_OK;
362 List<AllottedResourceCustomization> ret = new ArrayList<>();
363 Service service = null;
365 if (smUuid != null && !"".equals(smUuid)) {
367 service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(uuid);
368 } else if (serviceModelInvariantUuid != null && !"".equals(serviceModelInvariantUuid)) {
369 uuid = serviceModelInvariantUuid;
370 if (smVer != null && !"".equals(smVer)) {
371 service = serviceRepo.findFirstByModelVersionAndModelInvariantUUID(smVer, uuid);
373 service = serviceRepo.findFirstByModelInvariantUUIDOrderByModelVersionDesc(uuid);
375 } else if (aUuid != null && !"".equals(aUuid)) {
377 ret = allottedCustomizationRepo.findByModelCustomizationUUID(uuid);
379 throw (new Exception(NO_MATCHING_PARAMETERS));
383 ret = service.getAllottedCustomizations();
385 if (ret == null || ret.isEmpty()) {
386 logger.debug("AllottedResourceCustomization not found");
387 respStatus = HttpStatus.SC_NOT_FOUND;
388 qryResp = new QueryAllottedResourceCustomization();
390 qryResp = new QueryAllottedResourceCustomization(ret);
391 logger.debug("AllottedResourceCustomization qryResp= {}", qryResp);
393 return respond(version, respStatus, isArray, qryResp);
394 } catch (Exception e) {
395 logger.error("Exception - queryAllottedResourceCustomization", e);
396 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
397 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
398 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
399 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
405 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
406 @Transactional(readOnly = true)
407 public Response vfModules(@QueryParam("vfModuleModelName") String vfModuleModelName) {
408 QueryVfModule qryResp;
409 int respStatus = HttpStatus.SC_OK;
410 List<VfModuleCustomization> ret = null;
412 if (vfModuleModelName != null && !"".equals(vfModuleModelName)) {
413 VfModule vfModule = vfModuleRepo.findFirstByModelNameOrderByModelVersionDesc(vfModuleModelName);
414 if (vfModule != null)
415 ret = vfModule.getVfModuleCustomization();
417 throw (new Exception(NO_MATCHING_PARAMETERS));
420 if (ret == null || ret.isEmpty()) {
421 logger.debug("vfModules not found");
422 respStatus = HttpStatus.SC_NOT_FOUND;
423 qryResp = new QueryVfModule();
425 qryResp = new QueryVfModule(ret);
426 if (logger.isDebugEnabled())
427 logger.debug("vfModules tojsonstring is: {}", qryResp.JSON2(false, false));
429 return Response.status(respStatus).entity(qryResp.JSON2(false, false))
430 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
431 } catch (Exception e) {
432 logger.error("Exception during query VfModules by vfModuleModuleName: ", e);
433 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
434 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
435 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
436 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
441 * Get the tosca csar info from catalog <br>
443 * @param smUuid service model uuid
444 * @return the tosca csar information of the serivce.
445 * @since ONAP Beijing Release
448 @Path("serviceToscaCsar")
449 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
450 public Response serviceToscaCsar(@QueryParam("serviceModelUuid") String smUuid) {
451 int respStatus = HttpStatus.SC_OK;
454 if (smUuid != null && !"".equals(smUuid)) {
455 logger.debug("Query Csar by service model uuid: {}", smUuid);
457 Service service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(smUuid);
459 if (service != null) {
460 ToscaCsar toscaCsar = service.getCsar();
461 if (toscaCsar != null) {
462 QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
463 entity = serviceCsar.JSON2(false, false);
465 respStatus = HttpStatus.SC_NOT_FOUND;
468 respStatus = HttpStatus.SC_NOT_FOUND;
472 throw (new Exception("Incoming parameter is null or blank"));
474 return Response.status(respStatus).entity(entity)
475 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
476 } catch (Exception e) {
477 logger.error("Exception during query csar by service model uuid: ", e);
478 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
479 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
480 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
481 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();
486 * Get the resource recipe info from catalog <br>
488 * @param rmUuid resource model uuid
489 * @return the recipe information of the resource.
490 * @since ONAP Beijing Release
493 @Path("resourceRecipe")
494 @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
495 public Response resourceRecipe(@QueryParam("resourceModelUuid") String rmUuid,
496 @QueryParam("action") String action) {
497 int respStatus = HttpStatus.SC_OK;
500 if (rmUuid != null && !"".equals(rmUuid)) {
501 logger.debug("Query recipe by resource model uuid: {}", rmUuid);
502 // check vnf and network and ar, the resource could be any resource.
503 Recipe recipe = null;
505 VnfResource vnf = vnfResourceRepo.findResourceByModelUUID(rmUuid);
507 recipe = vnfRecipeRepo.findFirstVnfRecipeByNfRoleAndActionAndVersionStr(vnf.getModelName(), action,
508 vnf.getModelVersion());
510 // for network service fetch the default recipe
511 if (recipe == null && vnf.getSubCategory().equalsIgnoreCase(NETWORK_SERVICE)) {
512 recipe = vnfRecipeRepo.findFirstVnfRecipeByNfRoleAndAction("NS_DEFAULT", action);
517 if (null == recipe) {
518 NetworkResource nResource = networkResourceRepo.findResourceByModelUUID(rmUuid);
520 if (nResource != null) {
521 recipe = networkRecipeRepo.findFirstByModelNameAndActionAndVersionStr(nResource.getModelName(),
522 action, nResource.getModelVersion());
524 // for network fetch the default recipe
525 if (recipe == null) {
526 recipe = networkRecipeRepo.findFirstByModelNameAndAction("SDNC_DEFAULT", action);
531 if (null == recipe) {
532 AllottedResource arResource = arResourceRepo.findResourceByModelUUID(rmUuid);
533 if (arResource != null) {
534 recipe = arRecipeRepo.findByModelNameAndActionAndVersion(arResource.getModelName(), action,
535 arResource.getModelVersion());
538 if (recipe != null) {
539 QueryResourceRecipe resourceRecipe = new QueryResourceRecipe(recipe);
540 entity = resourceRecipe.JSON2(false, false);
542 respStatus = HttpStatus.SC_NOT_FOUND;
545 throw new Exception("Incoming parameter is null or blank");
547 return Response.status(respStatus).entity(entity)
548 .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON).build();
549 } catch (Exception e) {
550 logger.error("Exception during query recipe by resource model uuid: ", e);
551 CatalogQueryException excResp = new CatalogQueryException(e.getMessage(),
552 CatalogQueryExceptionCategory.INTERNAL, Boolean.FALSE, null);
553 return Response.status(HttpStatus.SC_INTERNAL_SERVER_ERROR)
554 .entity(new GenericEntity<CatalogQueryException>(excResp) {}).build();