From 259dc1ff083206ea3a8425c8e9f3c6988d20e524 Mon Sep 17 00:00:00 2001 From: Enbo Wang Date: Tue, 7 Jan 2020 16:32:30 +0800 Subject: [PATCH] Fix action names of DownloadNESw and ActivateNESw Change-Id: I2a7b5ca9554e52f219afe9248d39732c485ab037 Issue-ID: SDNC-856 Signed-off-by: Enbo Wang --- lcm/model/src/main/resources/lcm.20180329.json | 48 +++++++++++++--------- lcm/model/src/main/yang/lcm.yang | 12 +++--- .../org/onap/ccsdk/sli/northbound/LcmProvider.java | 24 +++++------ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 34 +++++++-------- ..._activate-ne-sw.xml => LCM_activate-n-e-sw.xml} | 2 +- ..._download-ne-sw.xml => LCM_download-n-e-sw.xml} | 2 +- .../src/test/resources/graphs/lcm/graph.versions | 4 +- 7 files changed, 68 insertions(+), 58 deletions(-) rename lcm/provider/src/test/resources/graphs/lcm/{LCM_activate-ne-sw.xml => LCM_activate-n-e-sw.xml} (96%) rename lcm/provider/src/test/resources/graphs/lcm/{LCM_download-ne-sw.xml => LCM_download-n-e-sw.xml} (96%) diff --git a/lcm/model/src/main/resources/lcm.20180329.json b/lcm/model/src/main/resources/lcm.20180329.json index 2e9eabe6..18512fc3 100644 --- a/lcm/model/src/main/resources/lcm.20180329.json +++ b/lcm/model/src/main/resources/lcm.20180329.json @@ -1253,7 +1253,7 @@ "operationId": "upgrade-software" } }, - "/operations/LCM:download-ne-sw": { + "/operations/LCM:download-n-e-sw": { "post": { "consumes": [ "application/json", @@ -1269,7 +1269,7 @@ "name": "body", "required": false, "schema": { - "$ref": "#/definitions/(download-ne-sw)input-TOP" + "$ref": "#/definitions/(download-n-e-sw)input-TOP" } } ], @@ -1277,15 +1277,15 @@ "200": { "description": "No response was specified", "schema": { - "$ref": "#/definitions/(download-ne-sw)output-TOP" + "$ref": "#/definitions/(download-n-e-sw)output-TOP" } } }, "description": "An operation to download NE software.", - "operationId": "download-ne-sw" + "operationId": "download-n-e-sw" } }, - "/operations/LCM:activate-ne-sw": { + "/operations/LCM:activate-n-e-sw": { "post": { "consumes": [ "application/json", @@ -1301,7 +1301,7 @@ "name": "body", "required": false, "schema": { - "$ref": "#/definitions/(activate-ne-sw)input-TOP" + "$ref": "#/definitions/(activate-n-e-sw)input-TOP" } } ], @@ -1309,12 +1309,12 @@ "200": { "description": "No response was specified", "schema": { - "$ref": "#/definitions/(activate-ne-sw)output-TOP" + "$ref": "#/definitions/(activate-n-e-sw)output-TOP" } } }, "description": "An operation to activate NE software.", - "operationId": "activate-ne-sw" + "operationId": "activate-n-e-sw" } } }, @@ -1627,6 +1627,10 @@ "vserver-id": { "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + }, + "pnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the PNF to which this action is to be applied." } }, "type": "object" @@ -4180,7 +4184,7 @@ }, "type": "object" }, - "(download-ne-sw)input": { + "(download-n-e-sw)input": { "properties": { "LCM:action": { "$ref": "#/definitions/Optional.empty" @@ -4209,18 +4213,18 @@ ], "type": "object" }, - "(download-ne-sw)input-TOP": { + "(download-n-e-sw)input-TOP": { "properties": { "LCM:input": { "items": { - "$ref": "#/definitions/(download-ne-sw)input" + "$ref": "#/definitions/(download-n-e-sw)input" }, "type": "object" } }, "type": "object" }, - "(download-ne-sw)output": { + "(download-n-e-sw)output": { "properties": { "LCM:common-header": { "description": "A common header for all APP-C requests", @@ -4245,18 +4249,18 @@ ], "type": "object" }, - "(download-ne-sw)output-TOP": { + "(download-n-e-sw)output-TOP": { "properties": { "LCM:output": { "items": { - "$ref": "#/definitions/(download-ne-sw)output" + "$ref": "#/definitions/(download-n-e-sw)output" }, "type": "object" } }, "type": "object" }, - "(activate-ne-sw)input": { + "(activate-n-e-sw)input": { "properties": { "LCM:action": { "$ref": "#/definitions/Optional.empty" @@ -4285,18 +4289,18 @@ ], "type": "object" }, - "(activate-ne-sw)input-TOP": { + "(activate-n-e-sw)input-TOP": { "properties": { "LCM:input": { "items": { - "$ref": "#/definitions/(activate-ne-sw)input" + "$ref": "#/definitions/(activate-n-e-sw)input" }, "type": "object" } }, "type": "object" }, - "(activate-ne-sw)output": { + "(activate-n-e-sw)output": { "properties": { "LCM:common-header": { "description": "A common header for all APP-C requests", @@ -4321,11 +4325,11 @@ ], "type": "object" }, - "(activate-ne-sw)output-TOP": { + "(activate-n-e-sw)output-TOP": { "properties": { "LCM:output": { "items": { - "$ref": "#/definitions/(activate-ne-sw)output" + "$ref": "#/definitions/(activate-n-e-sw)output" }, "type": "object" } @@ -4353,6 +4357,10 @@ "LCM:vserver-id": { "$ref": "#/definitions/Optional.empty", "description": "identifies a specific VM within the given service/vnf to which\\n this action is to be applied" + }, + "LCM:pnf-id": { + "$ref": "#/definitions/Optional.empty", + "description": "identifies the PNF to which this action is to be applied." } }, "type": "object" diff --git a/lcm/model/src/main/yang/lcm.yang b/lcm/model/src/main/yang/lcm.yang index 55af1159..d2ca5feb 100644 --- a/lcm/model/src/main/yang/lcm.yang +++ b/lcm/model/src/main/yang/lcm.yang @@ -114,8 +114,8 @@ module LCM { enum "DistributeTraffic"; enum "UpgradePreCheck"; enum "UpgradeSoftware"; - enum "DownloadNeSw"; - enum "ActivateNeSw"; + enum "DownloadNESw"; + enum "ActivateNESw"; enum "UpgradePostCheck"; enum "UpgradeBackup"; enum "UpgradeBackout"; @@ -600,9 +600,9 @@ module LCM { } /********************************************************************************** - * Define the downloadNeSw operation + * Define the downloadNESw operation **********************************************************************************/ - rpc download-ne-sw { + rpc download-n-e-sw { description "An operation to download NE software"; input { uses common-header; @@ -627,9 +627,9 @@ module LCM { } /********************************************************************************** - * Define the activateNeSw operation + * Define the activateNESw operation **********************************************************************************/ - rpc activate-ne-sw { + rpc activate-n-e-sw { description "An operation to activate NE software"; input { uses common-header; 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 6fd49436..100496e3 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,12 +761,12 @@ public class LcmProvider implements AutoCloseable, LCMService { } @Override - public ListenableFuture> downloadNeSw(DownloadNeSwInput input) { - DownloadNeSwInputBuilder iBuilder = new DownloadNeSwInputBuilder(input); - DownloadNeSwOutputBuilder oBuilder = new DownloadNeSwOutputBuilder(); + public ListenableFuture> downloadNESw(DownloadNESwInput input) { + DownloadNESwInputBuilder iBuilder = new DownloadNESwInputBuilder(input); + DownloadNESwOutputBuilder oBuilder = new DownloadNESwOutputBuilder(); try { - CommonLcmFields retval = callDG("download-ne-sw", iBuilder.build()); + CommonLcmFields retval = callDG("download-n-e-sw", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); if (retval.getPayload() != null) { @@ -778,19 +778,19 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(e.getStatus()); } - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); // return error return Futures.immediateFuture(rpcResult); } @Override - public ListenableFuture> activateNeSw(ActivateNeSwInput input) { - ActivateNeSwInputBuilder iBuilder = new ActivateNeSwInputBuilder(input); - ActivateNeSwOutputBuilder oBuilder = new ActivateNeSwOutputBuilder(); + public ListenableFuture> activateNESw(ActivateNESwInput input) { + ActivateNESwInputBuilder iBuilder = new ActivateNESwInputBuilder(input); + ActivateNESwOutputBuilder oBuilder = new ActivateNESwOutputBuilder(); try { - CommonLcmFields retval = callDG("activate-ne-sw", iBuilder.build()); + CommonLcmFields retval = callDG("activate-n-e-sw", iBuilder.build()); oBuilder.setStatus(retval.getStatusBuilder().build()); oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); if (retval.getPayload() != null) { @@ -802,8 +802,8 @@ public class LcmProvider implements AutoCloseable, LCMService { oBuilder.setStatus(e.getStatus()); } - RpcResult rpcResult = - RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); + RpcResult rpcResult = + RpcResultBuilder. status(true).withResult(oBuilder.build()).build(); // return error return Futures.immediateFuture(rpcResult); } diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index e0d8e577..a7e1e1f2 100644 --- a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -106,10 +106,10 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329. import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNeSwOutput; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNeSwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwOutput; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; @@ -1155,8 +1155,8 @@ public class TestLcmProvider { } @Test - public void testDownloadNeSw() { - DownloadNeSwInputBuilder builder = new DownloadNeSwInputBuilder(); + public void testDownloadNESw() { + DownloadNESwInputBuilder builder = new DownloadNESwInputBuilder(); CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); hdrBuilder.setApiVer("1"); @@ -1171,26 +1171,27 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); + aBuilder.setPnfId("456"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); - builder.setAction(Action.DownloadNeSw); + builder.setAction(Action.DownloadNESw); builder.setPayload(mock(Payload.class)); try { - DownloadNeSwOutput results = provider.downloadNeSw(builder.build()).get().getResult(); - LOG.info("DownloadNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + DownloadNESwOutput results = provider.downloadNESw(builder.build()).get().getResult(); + LOG.info("DownloadNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); assert(results.getStatus().getCode() == 400); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught exception", e); - fail("DownloadNeSw threw exception"); + fail("DownloadNESw threw exception"); } } @Test - public void testActivateNeSw() { - ActivateNeSwInputBuilder builder = new ActivateNeSwInputBuilder(); + public void testActivateNESw() { + ActivateNESwInputBuilder builder = new ActivateNESwInputBuilder(); CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); hdrBuilder.setApiVer("1"); @@ -1205,20 +1206,21 @@ public class TestLcmProvider { aBuilder.setVfModuleId("vf-module-1"); aBuilder.setVnfcName("my-vnfc"); aBuilder.setVnfId("123"); + aBuilder.setPnfId("456"); aBuilder.setVserverId("123"); builder.setActionIdentifiers(aBuilder.build()); - builder.setAction(Action.ActivateNeSw); + builder.setAction(Action.ActivateNESw); builder.setPayload(mock(Payload.class)); try { - ActivateNeSwOutput results = provider.activateNeSw(builder.build()).get().getResult(); - LOG.info("ActivateNeSw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + ActivateNESwOutput results = provider.activateNESw(builder.build()).get().getResult(); + LOG.info("ActivateNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); assert(results.getStatus().getCode() == 400); } catch (InterruptedException | ExecutionException e) { LOG.error("Caught exception", e); - fail("ActivateNeSw threw exception"); + fail("ActivateNESw threw exception"); } } diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml similarity index 96% rename from lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml rename to lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml index 99f74b6e..44343dd5 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-ne-sw.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml similarity index 96% rename from lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml rename to lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml index fd586cce..6bb0e765 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-ne-sw.xml +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml @@ -21,7 +21,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module='LCM' version='1.0.0'> - + diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions index 466be55b..420bcf61 100644 --- a/lcm/provider/src/test/resources/graphs/lcm/graph.versions +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -30,8 +30,8 @@ LCM resume-traffic 1.0.0 sync LCM distribute-traffic 1.0.0 sync LCM upgrade-pre-check 1.0.0 sync LCM upgrade-software 1.0.0 sync -LCM download-ne-sw 1.0.0 sync -LCM activate-ne-sw 1.0.0 sync +LCM download-n-e-sw 1.0.0 sync +LCM activate-n-e-sw 1.0.0 sync LCM upgrade-post-check 1.0.0 sync LCM upgrade-backup 1.0.0 sync LCM upgrade-backout 1.0.0 sync -- 2.16.6