diff options
author | waqas.ikram <waqas.ikram@est.tech> | 2020-09-09 09:41:54 +0100 |
---|---|---|
committer | waqas.ikram <waqas.ikram@est.tech> | 2020-09-09 10:04:06 +0100 |
commit | 1ac8b983b335076709b74d9f7d9768c188ee1891 (patch) | |
tree | a30ed33c7dc73002d6d0fca3fa8e4ce9cad322e7 /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java | |
parent | 36982a7db770806b0a3e12d07686b4e3a72a0871 (diff) |
Adding NS instantiation
Change-Id: I06a8e1c9bfeb82f5fc61604030ec62bd17193e90
Issue-ID: SO-2868
Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java')
3 files changed, 11 insertions, 11 deletions
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/EtsiSoNsLcmManagerUrlProvider.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/EtsiSoNsLcmManagerUrlProvider.java index baf11193cf..da1649de57 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/EtsiSoNsLcmManagerUrlProvider.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/EtsiSoNsLcmManagerUrlProvider.java @@ -36,7 +36,7 @@ public class EtsiSoNsLcmManagerUrlProvider { @Autowired public EtsiSoNsLcmManagerUrlProvider( - @Value("${etsi-so-ns-lcm-manager.endpoint}") final String etsiNsLcmManagerEndpoint) { + @Value("${so-etsi-nfvo-ns-lcm.endpoint:http://so-etsi-nfvo-ns-lcm.onap:9095}") final String etsiNsLcmManagerEndpoint) { this.etsiNsLcmManagerEndpoint = etsiNsLcmManagerEndpoint; } diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java index fb0a2503a2..87ec8420c6 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/NsLifecycleManagementController.java @@ -125,7 +125,10 @@ public class NsLifecycleManagementController { public ResponseEntity<?> instantiateNs(@PathVariable("nsInstanceId") final String nsInstanceId, @RequestBody final InstantiateNsRequest instantiateNsRequest) { logger.debug("Received instantiate NS request: {}\n with nsInstanceId: {}", instantiateNsRequest, nsInstanceId); - return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).body("Operation is not supported yet"); + final URI resourceUri = nsLifeCycleManager.instantiateNs(nsInstanceId, instantiateNsRequest); + logger.info("{} Ns Instantiation started successfully. Resource Operation Occurrence uri: {}", nsInstanceId, + resourceUri); + return ResponseEntity.accepted().location(resourceUri).build(); } /** diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/exceptions/NsLcmControllerExceptionHandler.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/exceptions/NsLcmControllerExceptionHandler.java index 8d9fdbe339..3db04fcfe8 100644 --- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/exceptions/NsLcmControllerExceptionHandler.java +++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/rest/exceptions/NsLcmControllerExceptionHandler.java @@ -41,21 +41,18 @@ public class NsLcmControllerExceptionHandler { .body(getInlineResponse400(nsRequestProcessingException)); } - private InlineResponse400 getInlineResponse400(final NsRequestProcessingException nsRequestProcessingException) { + @ExceptionHandler(Exception.class) + public ResponseEntity<InlineResponse400> handleNsRequestProcessingException(final Exception exception) { + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new InlineResponse400() + .status(HttpStatus.INTERNAL_SERVER_ERROR.value()).detail(exception.getMessage())); + } + private InlineResponse400 getInlineResponse400(final NsRequestProcessingException nsRequestProcessingException) { if (nsRequestProcessingException.getProblemDetails() != null) { return nsRequestProcessingException.getProblemDetails(); } - return new InlineResponse400().status(HttpStatus.INTERNAL_SERVER_ERROR.value()) .detail(nsRequestProcessingException.getMessage()); - - } - - @ExceptionHandler(Exception.class) - public ResponseEntity<InlineResponse400> handleNsRequestProcessingException(final Exception exception) { - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new InlineResponse400() - .status(HttpStatus.INTERNAL_SERVER_ERROR.value()).detail(exception.getMessage())); } } |