From 79c821a5739100457cb85c57d3089db567bb7ab4 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Wed, 7 Mar 2018 15:22:36 +0800 Subject: Support get resource recipe groovy common method Support get resource recipe groovy common method Change-Id: Iec7efcf162465cdef4be9093697a5b094a3020bb Issue-ID: SO-452 Signed-off-by: c00149107 --- .../mso/bpmn/common/scripts/CatalogDbUtils.groovy | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bpmn') diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy index dd6e56acc7..921e0ee00d 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy @@ -1203,4 +1203,25 @@ class CatalogDbUtils { } } + + /** + * get resource recipe by resource model uuid and action + */ + public JSONObject getResourceRecipe(Execution execution, String resourceModelUuid, String action) { + String endPoint = "/resourceRecipe?resourceModelUuid=" + UriUtils.encode(resourceModelUuid, "UTF-8")+ "&action=" + UriUtils.encode(action, "UTF-8") + JSONObject responseJson = null + try { + msoLogger.debug("ENDPOINT: " + endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) + + if (catalogDbResponse != null) { + responseJson = new JSONObject(catalogDbResponse) + } + } + catch (Exception e) { + utils.log("ERROR", "Exception in Querying Catalog DB: " + e.message) + } + + return responseJson + } } \ No newline at end of file -- cgit 1.2.3-korg