Add Generic Restart DG to use AAI named query

Added new version 3.0.0 of Generic_Restart that uses an AAI named query to
retrieve vnf information including ESR-System information
Updated DG installation and Mapping to use the new DG

Issue-ID: APPC-185
Change-Id: Iac15474d5753e58d47c6cabe432136d640447eb4
Signed-off-by: RY303T <RY303T@att.com>
diff --git a/platform-logic/appc/src/main/json/APPC_method_Generic_Restart_3.0.0.json b/platform-logic/appc/src/main/json/APPC_method_Generic_Restart_3.0.0.json
new file mode 100644
index 0000000..b9932a7
--- /dev/null
+++ b/platform-logic/appc/src/main/json/APPC_method_Generic_Restart_3.0.0.json
@@ -0,0 +1 @@
+[{"id":"d1d52f5e.f5ec38","type":"method","name":"Generic_Restart","xml":"<method rpc='Generic_Restart' mode='sync'>\n","comments":"","outputs":1,"x":163.33335876464844,"y":83.33333587646484,"z":"d549bab4.32b5b8","wires":[["598bfeb.ee8a9"]]},{"id":"2dd5fa72.b50c0a","type":"service-logic","name":"APPC 3.0.0","module":"APPC","version":"3.0.0","comments":"","xml":"<service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='3.0.0'>","outputs":1,"x":263.47615814208984,"y":38.61904239654541,"z":"d549bab4.32b5b8","wires":[["d1d52f5e.f5ec38"]]},{"id":"298f09aa.536796","type":"dgstart","name":"DGSTART","outputs":1,"x":112.61902618408203,"y":38.61905288696289,"z":"d549bab4.32b5b8","wires":[["2dd5fa72.b50c0a"]]},{"id":"635b3d20.44f968","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":554.333309173584,"y":523.9048252105713,"z":"d549bab4.32b5b8","wires":[["4877e58b.ec3e5"]]},{"id":"93a231b3.fddc","type":"block","name":"block : atomic","xml":"<block atomic='true'>\n","atomic":"true","comments":"","outputs":1,"x":131.76213836669922,"y":827.7141990661621,"z":"d549bab4.32b5b8","wires":[["61c8c61f.988e6c","9be866d3.e8ba88"]]},{"id":"61c8c61f.988e6c","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n","comments":"","x":327.33349609375,"y":1029.7142333984375,"z":"d549bab4.32b5b8","wires":[]},{"id":"ecf8420b.d2137","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":553.047534942627,"y":469.61900329589843,"z":"d549bab4.32b5b8","wires":[["1be2cec9.7984fd"]]},{"id":"98bb5b14.8493b8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n","comments":"","x":886.3333015441894,"y":508.3333168029785,"z":"d549bab4.32b5b8","wires":[]},{"id":"3c4e1344.2bab4c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1819.6905517578125,"y":1266.90478515625,"z":"d549bab4.32b5b8","wires":[["b7e6ad42.af9cd"]]},{"id":"6e324207.059a4c","type":"comment","name":"Fetch all VMs and VNFCs from AA&I for given VNF_ID","info":"","comments":"","x":560.1904220581055,"y":419.904746055603,"z":"d549bab4.32b5b8","wires":[]},{"id":"41e67c42.414d7","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1817.9760131835937,"y":1102.1905517578125,"z":"d549bab4.32b5b8","wires":[["c3e0f701.23a408"]]},{"id":"b7e6ad42.af9cd","type":"switchNode","name":"switch","xml":"<switch test='`$RESTART_STATUS`'>\n","comments":"","outputs":1,"x":2001.6905517578125,"y":1267.90478515625,"z":"d549bab4.32b5b8","wires":[["46981672.1024f8","6aa758eb.2d7ff","b015f846.9f0158"]]},{"id":"b015f846.9f0158","type":"success","name":"outcome_SUCCESS","xml":"<outcome value='SUCCESS'>\n","comments":"","outputs":1,"x":2189.119140625,"y":1486.3333740234375,"z":"d549bab4.32b5b8","wires":[["44cc20f.73d6b2"]]},{"id":"46981672.1024f8","type":"other","name":"outcome_CONTEXT_NOT_FOUND","xml":"<outcome value='CONTEXT_NOT_FOUND'>\n","comments":"","outputs":1,"x":2256.5482177734375,"y":1375.761962890625,"z":"d549bab4.32b5b8","wires":[["6a602ab3.cdfae4"]]},{"id":"6aa758eb.2d7ff","type":"other","name":"outcome_ERROR","xml":"<outcome value='ERROR'>\n","comments":"","outputs":1,"x":2201.6904296875,"y":1269.3333740234375,"z":"d549bab4.32b5b8","wires":[["df4ef003.c2cd9"]]},{"id":"92c44e47.28ad6","type":"execute","name":"execute_Restart","xml":"<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='restartServer'>\n<parameter name=\"org.openecomp.appc.provider.name\" value=\"OpenStack\"/>\n<parameter name=\"org.openecomp.appc.instance.url\" value=\"`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`\" />\n<parameter name=\"org.openecomp.appc.identity.url\" value=\"`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`\" />\n\n","comments":"","outputs":1,"x":1633.9763793945312,"y":1103.1905517578125,"z":"d549bab4.32b5b8","wires":[["3c4e1344.2bab4c","41e67c42.414d7"]]},{"id":"4877e58b.ec3e5","type":"switchNode","name":"switch: vnfInfo","xml":"<switch test='`$vnfInfo`'>\n","comments":"","outputs":1,"x":141.1428451538086,"y":610.3809852600098,"z":"d549bab4.32b5b8","wires":[["e1ff163b.5ff02","96f5bb03.c66ac8"]]},{"id":"bfab8c2f.8588c","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"output.status.message\" value=\"Failure in retrieving VNF Hierachy\" />","comments":"","x":702.9762878417969,"y":658.7619457244873,"z":"d549bab4.32b5b8","wires":[]},{"id":"1be2cec9.7984fd","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":705.9047355651855,"y":470.47619819641113,"z":"d549bab4.32b5b8","wires":[["77c00a25.824a2","98bb5b14.8493b8"]]},{"id":"77c00a25.824a2","type":"execute","name":"execute","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Exception in running AAI Named Query\" />\n\n","comments":"","outputs":1,"x":875.0476188659668,"y":471.7619094848633,"z":"d549bab4.32b5b8","wires":[["40cae6fb.f9ec1c"]]},{"id":"40cae6fb.f9ec1c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1017.6189765930176,"y":472.0475769042969,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"efd02e0e.cbb8d","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":533.0714340209961,"y":611.3810157775879,"z":"d549bab4.32b5b8","wires":[["bfab8c2f.8588c","d1af3a22.36d078"]]},{"id":"d1af3a22.36d078","type":"execute","name":"execute","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Failure in retrieving VNF Hierachy\" />","comments":"","outputs":1,"x":688.8331413269043,"y":610.7619476318359,"z":"d549bab4.32b5b8","wires":[["98c697de.25dc38"]]},{"id":"98c697de.25dc38","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":840.1189727783203,"y":611.6190910339355,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"c3e0f701.23a408","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":2028.5472869873047,"y":1101.904842376709,"z":"d549bab4.32b5b8","wires":[["f5519b8e.0473e8","ee44a266.5b656"]]},{"id":"f5519b8e.0473e8","type":"execute","name":"Report_Failure_in_Restart","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"`'Failure in restart for:' + $VNF.VM[$i].URL`\" />","comments":"","outputs":1,"x":2271.119140625,"y":1102.619140625,"z":"d549bab4.32b5b8","wires":[["e2d82b0c.ef1e08"]]},{"id":"e2d82b0c.ef1e08","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":2521.11865234375,"y":1102.619140625,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"6a602ab3.cdfae4","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":2501.1190185546875,"y":1375.90478515625,"z":"d549bab4.32b5b8","wires":[["da08309a.ea4da","96bc42f9.1ee06"]]},{"id":"da08309a.ea4da","type":"execute","name":"Report_Context_not_found","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"`'Stop : Context not found:' + $VNF.VM[$i].URL`\" />","comments":"","outputs":1,"x":2776.2618408203125,"y":1376.90478515625,"z":"d549bab4.32b5b8","wires":[["7509e683.ec0f3c"]]},{"id":"7509e683.ec0f3c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":3172.12060546875,"y":1377.4761962890625,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"df4ef003.c2cd9","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":2495.11962890625,"y":1269.3333740234375,"z":"d549bab4.32b5b8","wires":[["6442c295.a7306c","96bc42f9.1ee06"]]},{"id":"6442c295.a7306c","type":"execute","name":"Report_Error_occoured_while_restarting_the_server","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`\" />","comments":"","outputs":1,"x":2858.5477294921875,"y":1270.1904296875,"z":"d549bab4.32b5b8","wires":[["b76ffaa3.2d7ed8"]]},{"id":"b76ffaa3.2d7ed8","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":3171.11962890625,"y":1269.3333740234375,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"8fdcd6cc.534c2","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":403.7618865966797,"y":283.6507959365845,"z":"d549bab4.32b5b8","wires":[["799e98b5.fa05e8"]]},{"id":"598bfeb.ee8a9","type":"execute","name":"execute: flatAndAddToContext","xml":"<execute plugin='org.openecomp.appc.dg.common.JsonDgUtil' method='flatAndAddToContext' >\n<parameter name=\"payload\" value=\"`$input.payload`\" />","comments":"","outputs":1,"x":185.61901092529297,"y":135.904803276062,"z":"d549bab4.32b5b8","wires":[["8fdcd6cc.534c2","19ffb42b.f07ee8","2a62fd0e.5f3ba2"]]},{"id":"49614b11.f4b31","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"output.status.message\" value=\"Failure in flattening payload Json\" />","comments":"","x":740.9047698974609,"y":171.71442031860351,"z":"d549bab4.32b5b8","wires":[]},{"id":"92fb64df.fcc518","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":544.8571395874023,"y":137.47640705108642,"z":"d549bab4.32b5b8","wires":[["49614b11.f4b31","88737a14.cf8d48"]]},{"id":"88737a14.cf8d48","type":"execute","name":"Report_Error_Flattening_Payload_Json","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Failure in flattening payload Json\" />","comments":"","outputs":1,"x":826.0476455688476,"y":137.42875480651855,"z":"d549bab4.32b5b8","wires":[["c061fe0e.f59e6"]]},{"id":"c061fe0e.f59e6","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1053.1905899047851,"y":137.85729789733887,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"19ffb42b.f07ee8","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":405.33327865600586,"y":137.000093460083,"z":"d549bab4.32b5b8","wires":[["92fb64df.fcc518"]]},{"id":"e9743383.535c7","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"output.status.message\" value=\"Failure in loading Json flattening plugin\" />","comments":"","x":742.9048004150391,"y":254.8572483062744,"z":"d549bab4.32b5b8","wires":[]},{"id":"1a9448d.31a4777","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":556.0000991821289,"y":219.19064331054687,"z":"d549bab4.32b5b8","wires":[["e9743383.535c7","b4858f51.352808"]]},{"id":"b4858f51.352808","type":"execute","name":"Report_Error_Loading_Json_Flattening_Plugin","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Failure in loading Json flattening plugin\" />","comments":"","outputs":1,"x":847.7619094848633,"y":219.42876625061035,"z":"d549bab4.32b5b8","wires":[["ce019b05.ad1f08"]]},{"id":"ce019b05.ad1f08","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1101.619155883789,"y":219.428786277771,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"2a62fd0e.5f3ba2","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":407.47620391845703,"y":219.14293670654297,"z":"d549bab4.32b5b8","wires":[["1a9448d.31a4777"]]},{"id":"44cc20f.73d6b2","type":"execute","name":"Report_Success_in_Restart","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' >\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"`'Restart event executed successfully for ' + $VNF.VM[$i].URL`\" />\n","comments":"","outputs":1,"x":2485.023681640625,"y":1488.0001220703125,"z":"d549bab4.32b5b8","wires":[["d3fa3e29.7d084","e3581d6.55a3f2"]]},{"id":"d3fa3e29.7d084","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":2743.0233154296875,"y":1540,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"e3581d6.55a3f2","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2743.0233154296875,"y":1488,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"d81e5575.2f2398","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":121.61904525756836,"y":420.19044494628906,"z":"d549bab4.32b5b8","wires":[["6d15d5b3.0574b8","46582f8f.d70f38"]]},{"id":"6d15d5b3.0574b8","type":"get-resource","name":"AAI_Named_Query","xml":"<get-resource plugin=\"org.openecomp.sdnc.sli.aai.AAIService\" resource=\"named-query\" key=\"named-query-uuid = '037eb932-edac-48f5-9782-c19c0aa5a031' AND prefix='namedQueryData' \" local-only=\"false\" pfx=\"vnfInfo\" >\n","comments":"","outputs":1,"x":325.7617950439453,"y":470.1904821395874,"z":"d549bab4.32b5b8","wires":[["ecf8420b.d2137","635b3d20.44f968"]]},{"id":"46582f8f.d70f38","type":"set","name":"set","xml":"<set>\n<parameter name='namedQueryData.instance-filters.instance-filter[0].generic-vnf.vnf-id' value='`$input.action-identifiers.vnf-id`' />\n<parameter name='namedQueryData.instance-filters.instance-filter_length' value='`1`' />","comments":"","x":289.1904754638672,"y":419.904727935791,"z":"d549bab4.32b5b8","wires":[]},{"id":"799e98b5.fa05e8","type":"switchNode","name":"switch: input.action-identifiers.vnf-id","xml":"<switch test='$input.action-identifiers.vnf-id'>\n","comments":"","outputs":1,"x":206.61904907226562,"y":363.0476264953613,"z":"d549bab4.32b5b8","wires":[["4e30b42.2b1f18c","d81e5575.2f2398"]]},{"id":"4e30b42.2b1f18c","type":"outcome","name":"NULL","xml":"<outcome value=''>","outputs":1,"x":466.2618713378906,"y":362.547571182251,"z":"d549bab4.32b5b8","wires":[["ddf38ac7.882608"]]},{"id":"ddf38ac7.882608","type":"returnFailure","name":"return failure","xml":"<return status=\"failure\">\n\t<parameter name=\"error-message\" value=\"input.action-identifiers.vnf-id is null\" />\n","comments":"","x":635.3214645385742,"y":362.65874099731445,"z":"d549bab4.32b5b8","wires":[]},{"id":"9be866d3.e8ba88","type":"for","name":"for: vserver","xml":"<for index='vserverIndex' start='0' end='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-length' >\n","comments":"","outputs":1,"x":321.1904296875,"y":828.6665649414062,"z":"d549bab4.32b5b8","wires":[["5f09946f.5a5e48"]]},{"id":"e1ff163b.5ff02","type":"switchNode","name":"switch: vnf-id equal vnf-id","xml":"<switch test='`$vnfInfo.inventory-response-item[0].generic-vnf.vnf-id == $input.action-identifiers.vnf-id`'>\n","comments":"","outputs":1,"x":146.85711669921875,"y":680.6666870117187,"z":"d549bab4.32b5b8","wires":[["93a231b3.fddc","315277e1.a4ddec"]]},{"id":"d013757d.38c45","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"output.status.message\" value=\"Failure in loading Json flattening plugin\" />","comments":"","x":705.0476379394531,"y":750.4762992858887,"z":"d549bab4.32b5b8","wires":[]},{"id":"ac705b17.5790b8","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":535.1427841186523,"y":703.0953693389893,"z":"d549bab4.32b5b8","wires":[["d013757d.38c45","5125200e.11b3c8"]]},{"id":"5125200e.11b3c8","type":"execute","name":"execute","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"apiVer\" value=\"1.01\"/>\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Failure matching vnf-id to VNF Hierachy\" />","comments":"","outputs":1,"x":690.9044914245605,"y":702.4763011932373,"z":"d549bab4.32b5b8","wires":[["6e9bc98e.733594"]]},{"id":"6e9bc98e.733594","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":830.5236282348633,"y":701.6667943000793,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"ee44a266.5b656","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n","comments":"","x":2286.91015625,"y":1185.3334045410156,"z":"d549bab4.32b5b8","wires":[]},{"id":"b72b9adb.4be92","type":"comment","name":"This should probably just log and continue other restarts","info":"","comments":"","x":2398.6904296875,"y":1141.3334045410156,"z":"d549bab4.32b5b8","wires":[]},{"id":"96bc42f9.1ee06","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n","comments":"","x":2754.1502685546875,"y":1321.3333740234375,"z":"d549bab4.32b5b8","wires":[]},{"id":"5f09946f.5a5e48","type":"switchNode","name":"switch: vserver-selflink","xml":"<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink'>\n","comments":"","outputs":1,"x":527.1904296875,"y":829.3333129882812,"z":"d549bab4.32b5b8","wires":[["9764f8f6.3a62c","7dabbd34.55547"]]},{"id":"d5a580fe.99ad5","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"output.status.message\" value=\"Failure in retrieving vserver-selflink from VNF Hierachy\" />","comments":"","x":1062.0476112365722,"y":877.4762887954712,"z":"d549bab4.32b5b8","wires":[]},{"id":"94a57b9e.b3bf6","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":892.1427574157715,"y":830.0953588485718,"z":"d549bab4.32b5b8","wires":[["d5a580fe.99ad5","af842a57.2d2cd8"]]},{"id":"af842a57.2d2cd8","type":"execute","name":"execute","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Failure in retrieving vserver-selflink from VNF Hierachy\" />","comments":"","outputs":1,"x":1047.904541015625,"y":829.4762573242187,"z":"d549bab4.32b5b8","wires":[["d460e98f.426388"]]},{"id":"d460e98f.426388","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1199.1902961730957,"y":830.3334341049194,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"9764f8f6.3a62c","type":"switchNode","name":"switch: identity-url","xml":"<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url'>\n","comments":"","outputs":1,"x":759.1904182434082,"y":929.333324432373,"z":"d549bab4.32b5b8","wires":[["2b88680c.5de5d4","379ba4e2.32580c"]]},{"id":"ad5c3a2b.bfa448","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"output.status.message\" value=\"Failure in retrieving identity-url from VNF Hierachy\" />","comments":"","x":1322.0475540161132,"y":977.4762668609619,"z":"d549bab4.32b5b8","wires":[]},{"id":"d1f5cffd.8f938","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":1152.1427001953125,"y":930.0953369140625,"z":"d549bab4.32b5b8","wires":[["ad5c3a2b.bfa448","a89c53c6.9f8a58"]]},{"id":"a89c53c6.9f8a58","type":"execute","name":"execute","xml":"<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >\n<parameter name=\"eventId\" value=\"`$input.action-identifiers.vnf-id`\" />\n<parameter name=\"output.status.message\" value=\"Failure in retrieving identity-url from VNF Hierachy\" />","comments":"","outputs":1,"x":1307.9044075012207,"y":929.4762687683105,"z":"d549bab4.32b5b8","wires":[["c40b7402.3c2c"]]},{"id":"c40b7402.3c2c","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1454.190185546875,"y":929.3334350585937,"z":"d549bab4.32b5b8","wires":[[]]},{"id":"2b88680c.5de5d4","type":"switchNode","name":"switch: vm-id present","xml":"<switch test='$vm-id'>\n","comments":"","outputs":1,"x":1017,"y":1042.5,"z":"d549bab4.32b5b8","wires":[["74cd73c8.cadb0c","b093dc74.3cbc8"]]},{"id":"74cd73c8.cadb0c","type":"outcome","name":"NULL","xml":"<outcome value=''>","outputs":1,"x":1208,"y":1102.9000244140625,"z":"d549bab4.32b5b8","wires":[["92c44e47.28ad6"]]},{"id":"b093dc74.3cbc8","type":"switchNode","name":"switch: vserver-selflink equal vnf-id","xml":"<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink == $vm-id'>\n","comments":"","outputs":1,"x":1260,"y":1042.9000244140625,"z":"d549bab4.32b5b8","wires":[["3ac59b18.0bb3d8"]]},{"id":"96f5bb03.c66ac8","type":"outcome","name":"NULL","xml":"<outcome value=''>","outputs":1,"x":354,"y":610.5999755859375,"z":"d549bab4.32b5b8","wires":[["efd02e0e.cbb8d"]]},{"id":"315277e1.a4ddec","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":354,"y":700,"z":"d549bab4.32b5b8","wires":[["ac705b17.5790b8"]]},{"id":"7dabbd34.55547","type":"outcome","name":"NULL","xml":"<outcome value=''>","outputs":1,"x":718.0000228881836,"y":830.0000066757202,"z":"d549bab4.32b5b8","wires":[["94a57b9e.b3bf6"]]},{"id":"379ba4e2.32580c","type":"outcome","name":"NULL","xml":"<outcome value=''>","outputs":1,"x":969.9999656677246,"y":929.9999847412109,"z":"d549bab4.32b5b8","wires":[["d1f5cffd.8f938"]]},{"id":"3ac59b18.0bb3d8","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":1465.1430053710937,"y":1043,"z":"d549bab4.32b5b8","wires":[["92c44e47.28ad6"]]}]
\ No newline at end of file
diff --git a/platform-logic/appc/src/main/resources/graph.versions b/platform-logic/appc/src/main/resources/graph.versions
index e4e91e6..c3e8fd3 100644
--- a/platform-logic/appc/src/main/resources/graph.versions
+++ b/platform-logic/appc/src/main/resources/graph.versions
@@ -2,4 +2,5 @@
 APPC ansible-adapter-1.0 2.0.1 sync
 APPC chef 3.0.0 sync
 APPC Generic_Restart 2.0.1 sync
+APPC Generic_Restart 3.0.0 sync
 Appc-API legacy_operation 2.0.0.0 sync
diff --git a/platform-logic/appc/src/main/xml/APPC_method_Generic_Restart_3.0.0.xml b/platform-logic/appc/src/main/xml/APPC_method_Generic_Restart_3.0.0.xml
new file mode 100644
index 0000000..9efe3ae
--- /dev/null
+++ b/platform-logic/appc/src/main/xml/APPC_method_Generic_Restart_3.0.0.xml
@@ -0,0 +1,142 @@
+<!--
+  ============LICENSE_START=======================================================
+  APPC
+  ================================================================================
+  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+  ================================================================================
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+-->
+<service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='3.0.0'><method rpc='Generic_Restart' mode='sync'>
+<execute plugin='org.openecomp.appc.dg.common.JsonDgUtil' method='flatAndAddToContext' >
+<parameter name="payload" value="`$input.payload`" /><outcome value='failure'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Failure in flattening payload Json" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+<parameter name="output.status.message" value="Failure in flattening payload Json" /></return></block></outcome><outcome value='not-found'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Failure in loading Json flattening plugin" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+<parameter name="output.status.message" value="Failure in loading Json flattening plugin" /></return></block></outcome><outcome value='success'>
+<switch test='$input.action-identifiers.vnf-id'>
+<outcome value=''><return status="failure">
+    <parameter name="error-message" value="input.action-identifiers.vnf-id is null" />
+</return></outcome><block>
+<set>
+<parameter name='namedQueryData.instance-filters.instance-filter[0].generic-vnf.vnf-id' value='`$input.action-identifiers.vnf-id`' />
+<parameter name='namedQueryData.instance-filters.instance-filter_length' value='`1`' /></set><get-resource plugin="org.openecomp.sdnc.sli.aai.AAIService" resource="named-query" key="named-query-uuid = '037eb932-edac-48f5-9782-c19c0aa5a031' AND prefix='namedQueryData' " local-only="false" pfx="vnfInfo" >
+<outcome value='failure'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Exception in running AAI Named Query" />
+
+<outcome value='success'>
+</outcome></execute><return status='failure'>
+</return></block></outcome><outcome value='success'>
+<switch test='`$vnfInfo`'>
+<outcome value=''><block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Failure in retrieving VNF Hierachy" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+<parameter name="output.status.message" value="Failure in retrieving VNF Hierachy" /></return></block></outcome><switch test='`$vnfInfo.inventory-response-item[0].generic-vnf.vnf-id == $input.action-identifiers.vnf-id`'>
+<outcome value='false'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Failure matching vnf-id to VNF Hierachy" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+<parameter name="output.status.message" value="Failure in loading Json flattening plugin" /></return></block></outcome><block atomic='true'>
+<for index='vserverIndex' start='0' end='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-length' >
+<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink'>
+<outcome value=''><block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Failure in retrieving vserver-selflink from VNF Hierachy" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+<parameter name="output.status.message" value="Failure in retrieving vserver-selflink from VNF Hierachy" /></return></block></outcome><switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url'>
+<outcome value=''><block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="Failure in retrieving identity-url from VNF Hierachy" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+<parameter name="output.status.message" value="Failure in retrieving identity-url from VNF Hierachy" /></return></block></outcome><switch test='$vm-id'>
+<switch test='vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink == $vm-id'>
+<outcome value='true'>
+<execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='restartServer'>
+<parameter name="org.openecomp.appc.provider.name" value="OpenStack"/>
+<parameter name="org.openecomp.appc.instance.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`" />
+<parameter name="org.openecomp.appc.identity.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`" />
+
+<outcome value='failure'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Failure in restart for:' + $VNF.VM[$i].URL`" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+</return></block></outcome><outcome value='success'>
+<switch test='`$RESTART_STATUS`'>
+<outcome value='ERROR'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+</return></block></outcome><outcome value='CONTEXT_NOT_FOUND'>
+<block atomic='true'><return status='failure'>
+</return><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Stop : Context not found:' + $VNF.VM[$i].URL`" /><outcome value='success'>
+</outcome></execute></block></outcome><outcome value='SUCCESS'>
+<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' >
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Restart event executed successfully for ' + $VNF.VM[$i].URL`" />
+<outcome value='failure'>
+</outcome><outcome value='success'>
+</outcome></execute></outcome></switch></outcome></execute></outcome></switch><outcome value=''><execute plugin='org.openecomp.appc.adapter.iaas.ProviderAdapter' method='restartServer'>
+<parameter name="org.openecomp.appc.provider.name" value="OpenStack"/>
+<parameter name="org.openecomp.appc.instance.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].vserver.vserver-selflink`" />
+<parameter name="org.openecomp.appc.identity.url" value="`$vnfInfo.inventory-response-item[0].inventory-response-items.inventory-response-item[$vserverIndex].inventory-response-items.inventory-response-item[0].inventory-response-items.inventory-response-item[0].cloud-region.identity-url`" />
+
+<outcome value='failure'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Failure in restart for:' + $VNF.VM[$i].URL`" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+</return></block></outcome><outcome value='success'>
+<switch test='`$RESTART_STATUS`'>
+<outcome value='ERROR'>
+<block atomic='true'><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Stop : Error occoured while restarting the server:' + $VNF.VM[$i].URL`" /><outcome value='success'>
+</outcome></execute><return status='failure'>
+</return></block></outcome><outcome value='CONTEXT_NOT_FOUND'>
+<block atomic='true'><return status='failure'>
+</return><execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='report' >
+<parameter name="apiVer" value="1.01"/>
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Stop : Context not found:' + $VNF.VM[$i].URL`" /><outcome value='success'>
+</outcome></execute></block></outcome><outcome value='SUCCESS'>
+<execute plugin='org.openecomp.appc.dg.common.DCAEReporterPlugin' method='reportSuccess' >
+<parameter name="eventId" value="`$input.action-identifiers.vnf-id`" />
+<parameter name="output.status.message" value="`'Restart event executed successfully for ' + $VNF.VM[$i].URL`" />
+<outcome value='failure'>
+</outcome><outcome value='success'>
+</outcome></execute></outcome></switch></outcome></execute></outcome></switch></switch></switch></for><return status='success'>
+</return></block></switch></switch></outcome></get-resource></block></switch></outcome></execute></method></service-logic>
diff --git a/platform-logic/installer/src/main/resources/VNF_DG_MAPPING.sql b/platform-logic/installer/src/main/resources/VNF_DG_MAPPING.sql
index c978bbc..c54e06a 100644
--- a/platform-logic/installer/src/main/resources/VNF_DG_MAPPING.sql
+++ b/platform-logic/installer/src/main/resources/VNF_DG_MAPPING.sql
@@ -44,7 +44,7 @@
 
 LOCK TABLES `VNF_DG_MAPPING` WRITE;
 /*!40000 ALTER TABLE `VNF_DG_MAPPING` DISABLE KEYS */;
-INSERT INTO `VNF_DG_MAPPING` VALUES ('Restart','2.01','','','legacy_operation','2.0.0','APPC'), ('Restart','2.00','','','Restart_VNF','2.0.1','APPC');
+INSERT INTO `VNF_DG_MAPPING` VALUES ('Restart','2.01','','','Generic_Restart','3.0.0','APPC'), ('Restart','2.00','','','Generic_Restart','3.0.0','APPC');
 
 /*!40000 ALTER TABLE `VNF_DG_MAPPING` ENABLE KEYS */;
 UNLOCK TABLES;