diff options
author | 2020-09-09 10:18:15 +0000 | |
---|---|---|
committer | 2020-09-09 10:32:31 +0000 | |
commit | c8cd23a64ef20436bac38923f6dc7f77e7b95c08 (patch) | |
tree | a00946c019dc3372e9e00d7ee2889f95e5d6049e /src/main/java/org | |
parent | e44331581196644015a40dcaa38a86ce0f84c76c (diff) |
Preparing the request payload (action = delete) for calling SO macro flow
code changes for delete action. Issue-ID: EXTAPI-448
Change-Id: I6bb9786660f6760c15008132e2c254e7f9b89654
Signed-off-by: sujitsatapathy <SS00626741@techmahindra.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java | 27 | ||||
-rw-r--r-- | src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java | 4 |
2 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java b/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java index 8e58c39..e0e4bb5 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/SoClient.java @@ -195,6 +195,33 @@ public class SoClient { } } + //Delete Macro + + public ResponseEntity<CreateMacroServiceInstanceResponse> callMacroDeleteServiceInstance(MSOPayload msoPayload, + String serviceId) { + + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Calling SO Macro DeleteServiceInstance with msoPayload : " + msoPayload.toString()); + } + + String url = deleteSoUrl + serviceId; + + try { + ResponseEntity<CreateMacroServiceInstanceResponse> response = restTemplate.exchange(url, HttpMethod.DELETE, + new HttpEntity<>(msoPayload, buildRequestHeader()), CreateMacroServiceInstanceResponse.class); + + logMacroResponsePost(url, response); + return response; + + } catch (BackendFunctionalException e) { + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); + return new ResponseEntity<>(e.getHttpStatus()); + } catch (ResourceAccessException e) { + LOGGER.error(ERROR_ON_CALLING + url + " ," + e); + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + } public ResponseEntity<CreateE2EServiceInstanceResponse> callE2EDeleteServiceInstance(String globalSubscriberId, String serviceType, String serviceInstanceId) { diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java index 4568b80..c356bdd 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java @@ -226,8 +226,8 @@ public class PostSoProcessor { response = soClient.callMacroCreateServiceInstance(msoMacroPayload); break; case DELETE: - // response = soClient.callDeleteServiceInstance(msoPayload, - // serviceOrderItem.getService().getId()); + response = soClient.callMacroDeleteServiceInstance(msoMacroPayload, + serviceOrderItem.getService().getId()); break; case MODIFY: if (StateType.INPROGRESS_MODIFY_ITEM_TO_CREATE == serviceOrderItem.getState()) { |