diff options
Diffstat (limited to 'src/main')
-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()) { |