summaryrefslogtreecommitdiffstats
path: root/lcm/provider/src/main
diff options
context:
space:
mode:
authorEnbo Wang <wangenbo@huawei.com>2019-12-04 21:14:48 +0800
committerEnbo Wang <wangenbo@huawei.com>2019-12-04 21:14:48 +0800
commit1ee69b1f0a3fde8d77393f541b12ff6daee11600 (patch)
treee621b1abd37834b8791a504ff99b7ab689610165 /lcm/provider/src/main
parent32dab99f3a01cedb20b6af8b85343c61fbd7a6fb (diff)
Add LCM APIs for DownloadNeSw and ActivateNeSw actions
Add two LCM APIs of DownloadNeSw and ActivateNeSw for PNF Software Upgrade. Change-Id: I5a8f143c2d7d54fd96772eeb1d31b2d2e8bfb523 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang <wangenbo@huawei.com>
Diffstat (limited to 'lcm/provider/src/main')
-rw-r--r--lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java
index 0074dfc65..6fd494360 100644
--- a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java
+++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java
@@ -761,6 +761,54 @@ public class LcmProvider implements AutoCloseable, LCMService {
}
@Override
+ public ListenableFuture<RpcResult<DownloadNeSwOutput>> downloadNeSw(DownloadNeSwInput input) {
+ DownloadNeSwInputBuilder iBuilder = new DownloadNeSwInputBuilder(input);
+ DownloadNeSwOutputBuilder oBuilder = new DownloadNeSwOutputBuilder();
+
+ try {
+ CommonLcmFields retval = callDG("download-ne-sw", iBuilder.build());
+ oBuilder.setStatus(retval.getStatusBuilder().build());
+ oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build());
+ if (retval.getPayload() != null) {
+ oBuilder.setPayload(retval.getPayload());
+ }
+ } catch (LcmRpcInvocationException e) {
+ LOG.debug(exceptionMessage, e);
+ oBuilder.setCommonHeader(e.getCommonHeader());
+ oBuilder.setStatus(e.getStatus());
+ }
+
+ RpcResult<DownloadNeSwOutput> rpcResult =
+ RpcResultBuilder.<DownloadNeSwOutput> status(true).withResult(oBuilder.build()).build();
+ // return error
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ @Override
+ public ListenableFuture<RpcResult<ActivateNeSwOutput>> activateNeSw(ActivateNeSwInput input) {
+ ActivateNeSwInputBuilder iBuilder = new ActivateNeSwInputBuilder(input);
+ ActivateNeSwOutputBuilder oBuilder = new ActivateNeSwOutputBuilder();
+
+ try {
+ CommonLcmFields retval = callDG("activate-ne-sw", iBuilder.build());
+ oBuilder.setStatus(retval.getStatusBuilder().build());
+ oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build());
+ if (retval.getPayload() != null) {
+ oBuilder.setPayload(retval.getPayload());
+ }
+ } catch (LcmRpcInvocationException e) {
+ LOG.debug(exceptionMessage, e);
+ oBuilder.setCommonHeader(e.getCommonHeader());
+ oBuilder.setStatus(e.getStatus());
+ }
+
+ RpcResult<ActivateNeSwOutput> rpcResult =
+ RpcResultBuilder.<ActivateNeSwOutput> status(true).withResult(oBuilder.build()).build();
+ // return error
+ return Futures.immediateFuture(rpcResult);
+ }
+
+ @Override
public ListenableFuture<RpcResult<StopOutput>> stop(StopInput input) {
StopInputBuilder iBuilder = new StopInputBuilder(input);
StopOutputBuilder oBuilder = new StopOutputBuilder();