SDWAN vpn-site-resource DG- failure cases handled 30/86030/2
authorprakash.e <prakash.e@huawei.com>
Tue, 23 Apr 2019 09:01:15 +0000 (14:31 +0530)
committerDan Timoney <dtimoney@att.com>
Wed, 24 Apr 2019 18:08:45 +0000 (18:08 +0000)
To activate vnf-resource, order status should be Created.
Fixed by Adding validity check with order-status is Created.

Change-Id: I489ac4bad2af05d8b34922a70c49ed970e934370
Issue-ID: SDNC-659
Signed-off-by: Prakash.E <prakash.e@huawei.com>
Former-commit-id: 0872665a543775469b1c7cf851fef6728529e12f

platform-logic/generic-resource-api/src/main/json/sdwan/GENERIC-RESOURCE-API_vnf-topology-operation-vpn-site-resource-activate.json
platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_vnf-topology-operation-vpn-site-resource-activate.xml

index 244799a..c85d68f 100644 (file)
@@ -1,36 +1,36 @@
 [\r
     {\r
-        "id": "294747fd.2c2d98",\r
+        "id": "951a58ad.b622b8",\r
         "type": "method",\r
         "name": "method vnf-topology-operation-vpn-site-resource-activate",\r
         "xml": "<method rpc='vnf-topology-operation-vpn-site-resource-activate' mode='sync'>\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 211.5,\r
-        "y": 201.99997901916504,\r
-        "z": "79a5b197.5d84",\r
+        "x": 274.00390625,\r
+        "y": 217.9999771118164,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "4068c2f3.520fdc"\r
+                "9f312de.ebe59d"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "cff9203f.6e7f7",\r
+        "id": "ce93efc.702d31",\r
         "type": "dgstart",\r
         "name": "DGSTART",\r
         "outputs": 1,\r
-        "x": 89.0713882446289,\r
-        "y": 38,\r
-        "z": "79a5b197.5d84",\r
+        "x": 151.5752944946289,\r
+        "y": 53.99999809265137,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "78d3821a.ddc91c"\r
+                "6be0f3e4.bbd19c"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "78d3821a.ddc91c",\r
+        "id": "6be0f3e4.bbd19c",\r
         "type": "service-logic",\r
         "name": "GENERIC-RESOURCE-API ${project.version}",\r
         "module": "GENERIC-RESOURCE-API",\r
         "comments": "",\r
         "xml": "<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>",\r
         "outputs": 1,\r
-        "x": 188.35708618164062,\r
-        "y": 112.23810789268464,\r
-        "z": "79a5b197.5d84",\r
+        "x": 250.86099243164062,\r
+        "y": 128.238105985336,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "294747fd.2c2d98"\r
+                "951a58ad.b622b8"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "4068c2f3.520fdc",\r
+        "id": "9f312de.ebe59d",\r
         "type": "block",\r
         "name": "block : atomic",\r
         "xml": "<block atomic=\"true\">",\r
         "atomic": "true",\r
         "outputs": 1,\r
-        "x": 189.73804473876953,\r
-        "y": 373.66666814964265,\r
-        "z": "79a5b197.5d84",\r
+        "x": 252.24195098876953,\r
+        "y": 389.666666242294,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "3a6b0423.a0a0ac",\r
-                "d7b531c1.f5a86",\r
-                "29c1d8e.17e3128",\r
-                "206b62f4.ff1b8e",\r
-                "ac1ddf15.75241",\r
-                "fd35c3d4.a8e8a"\r
+                "94324bec.af0568",\r
+                "9e7bd407.d70c08",\r
+                "240a825d.6226de",\r
+                "c7c4dafb.a3de48",\r
+                "af4009d1.a698c8",\r
+                "db202f3e.dab93",\r
+                "5b908f22.f7f5a"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "3a6b0423.a0a0ac",\r
+        "id": "94324bec.af0568",\r
         "type": "set",\r
         "name": "set vnf-level-oper-status to Active",\r
         "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status' value='Active' />\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />",\r
         "comments": "",\r
-        "x": 598.8850250244141,\r
-        "y": 446.67056941986084,\r
-        "z": "79a5b197.5d84",\r
+        "x": 667.3889236450195,\r
+        "y": 576.6705493927002,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": []\r
     },\r
     {\r
-        "id": "d7b531c1.f5a86",\r
+        "id": "9e7bd407.d70c08",\r
         "type": "returnSuccess",\r
         "name": "return success",\r
         "xml": "<return status='success'>\n<parameter name=\"ack-final-indicator\" value=\"Y\" />\n<parameter name=\"error-code\" value=\"200\" />\n<parameter name=\"error-message\" value=\"`$error-message`\" />\n",\r
         "comments": "",\r
-        "x": 519.0717163085938,\r
-        "y": 572.5971069335938,\r
-        "z": "79a5b197.5d84",\r
+        "x": 587.5756149291992,\r
+        "y": 702.5970869064331,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": []\r
     },\r
     {\r
-        "id": "29c1d8e.17e3128",\r
+        "id": "240a825d.6226de",\r
         "type": "set",\r
         "name": "set vnf-index and vnf-object-path",\r
         "xml": "<set>\n<parameter name='vnfId' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' />\n<parameter name=\"vnf-object-path\" value=\"`'restconf/config/GENERIC-RESOURCE-API:services/service/'  + $vnf-topology-operation-input.service-information.service-instance-id  + '/service-data/vnfs/vnf/'  + $vnf-topology-operation-input.vnf-information.vnf-id  + '/vnf-data/'` \" />",\r
         "comments": "",\r
-        "x": 605.0716705322266,\r
-        "y": 394.5968236923218,\r
-        "z": "79a5b197.5d84",\r
+        "x": 673.575569152832,\r
+        "y": 524.5968036651611,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": []\r
     },\r
     {\r
-        "id": "206b62f4.ff1b8e",\r
+        "id": "c7c4dafb.a3de48",\r
         "type": "switchNode",\r
         "name": "switch service-data.vnfs.vnf_length",\r
         "xml": "<switch test='`$service-data.vnfs.vnf_length`'>\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 619.5000610351562,\r
-        "y": 263.00000545661896,\r
-        "z": "79a5b197.5d84",\r
+        "x": 682.0039672851562,\r
+        "y": 279.00000354927033,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "510e4a8b.ead204",\r
-                "c779a013.c610f",\r
-                "7ee910c1.660bf"\r
+                "f4d8522c.a4d9b",\r
+                "2bef8938.25fbd6",\r
+                "4701274a.571b48"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "7ee910c1.660bf",\r
+        "id": "4701274a.571b48",\r
         "type": "outcome",\r
         "name": "0",\r
         "xml": "<outcome value='0'>\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 878.4689559936523,\r
-        "y": 224.96876499336213,\r
-        "z": "79a5b197.5d84",\r
+        "x": 940.9728622436523,\r
+        "y": 240.9687630860135,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "a7558172.b2121"\r
+                "fd0fb6fb.9706b8"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "a7558172.b2121",\r
+        "id": "fd0fb6fb.9706b8",\r
         "type": "returnFailure",\r
         "name": "return failure",\r
         "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data\" />\n",\r
         "comments": "",\r
-        "x": 1033.2778434753418,\r
-        "y": 243.88903352897614,\r
-        "z": "79a5b197.5d84",\r
+        "x": 1095.7817497253418,\r
+        "y": 259.8890316216275,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": []\r
     },\r
     {\r
-        "id": "510e4a8b.ead204",\r
+        "id": "f4d8522c.a4d9b",\r
         "type": "other",\r
         "name": "Null",\r
         "xml": "<outcome value=''>\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 871.5000953674316,\r
-        "y": 264.00008651893586,\r
-        "z": "79a5b197.5d84",\r
+        "x": 934.0040016174316,\r
+        "y": 280.0000846115872,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "a7558172.b2121"\r
+                "fd0fb6fb.9706b8"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "c779a013.c610f",\r
+        "id": "2bef8938.25fbd6",\r
         "type": "other",\r
         "name": "other",\r
         "xml": "<outcome value='Other'>\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 864.5005035400391,\r
-        "y": 297.0000903336331,\r
-        "z": "79a5b197.5d84",\r
+        "x": 927.0044097900391,\r
+        "y": 313.0000884262845,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "6aaa180d.7575b8"\r
+                "f298ba1.2d54c48"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "6aaa180d.7575b8",\r
+        "id": "f298ba1.2d54c48",\r
         "type": "block",\r
         "name": "block : atomic",\r
         "xml": "<block atomic=\"true\">",\r
         "atomic": "true",\r
         "outputs": 1,\r
-        "x": 1011.7700462341309,\r
-        "y": 297.55473539512604,\r
-        "z": "79a5b197.5d84",\r
+        "x": 1074.2739524841309,\r
+        "y": 313.5547334877774,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "46580136.d7c0b"\r
+                "5f9416f7.4477e8"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "46580136.d7c0b",\r
+        "id": "5f9416f7.4477e8",\r
         "type": "for",\r
         "name": "for vidx..service-data.vnfs.vnf_length[]",\r
         "xml": "<for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' >\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 1257.7861633300781,\r
-        "y": 304.4286558357999,\r
-        "z": "79a5b197.5d84",\r
+        "x": 1320.2900695800781,\r
+        "y": 320.42865392845124,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "a66fcd87.a077a"\r
+                "d1140903.826428"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "a66fcd87.a077a",\r
+        "id": "d1140903.826428",\r
         "type": "block",\r
         "name": "block",\r
         "xml": "<block>\n",\r
         "atomic": "false",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 1477.1357955932617,\r
-        "y": 303.9687359062955,\r
-        "z": "79a5b197.5d84",\r
+        "x": 1539.6397018432617,\r
+        "y": 319.96873399894685,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "ba7c0ee7.d144d"\r
+                "634303dc.2373ac"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "ba7c0ee7.d144d",\r
+        "id": "634303dc.2373ac",\r
         "type": "switchNode",\r
         "name": "switch vnfid found",\r
         "xml": "<switch test=\"`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`\">\n\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 1631.2153930664062,\r
-        "y": 303.67881796043366,\r
-        "z": "79a5b197.5d84",\r
+        "x": 1693.7192993164062,\r
+        "y": 319.67881605308503,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "a9157f30.c0f4f"\r
+                "acd02e3d.622b7"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "a9157f30.c0f4f",\r
+        "id": "acd02e3d.622b7",\r
         "type": "outcomeTrue",\r
         "name": "true",\r
         "xml": "<outcome value='true'>\n",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 1807.1675148010254,\r
-        "y": 303.57150003593415,\r
-        "z": "79a5b197.5d84",\r
+        "x": 1869.6714210510254,\r
+        "y": 319.5714981285855,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             [\r
-                "e051341c.b94158"\r
+                "eb3ae849.6809a8"\r
             ]\r
         ]\r
     },\r
     {\r
-        "id": "e051341c.b94158",\r
+        "id": "eb3ae849.6809a8",\r
         "type": "set",\r
         "name": "set tmp.vidx and ctx.vnf-data",\r
         "xml": "<set>\n<parameter name='tmp.vidx' value='`$vidx`' />\n<parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' />\n",\r
         "comments": "",\r
-        "x": 2016.6998901367188,\r
-        "y": 305.3216001717374,\r
-        "z": "79a5b197.5d84",\r
+        "x": 2079.2037963867188,\r
+        "y": 321.32159826438874,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": []\r
     },\r
     {\r
-        "id": "ac1ddf15.75241",\r
+        "id": "af4009d1.a698c8",\r
         "type": "save",\r
         "name": "update AnAI - vnf-instance.orchestration-status",\r
         "xml": "<update plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\" \n\tresource=\"generic-vnf\"   \n\t\tkey=\"generic-vnf.vnf-id = $vnfId\" >\n<parameter name=\"orchestration-status\" value=\"Active\" />\n<parameter name=\"vnf-type\" value=\"some vnf-type\" />",\r
         "comments": "",\r
         "outputs": 1,\r
-        "x": 624.5000305175781,\r
-        "y": 513.0103950500488,\r
-        "z": "79a5b197.5d84",\r
+        "x": 693.0039291381836,\r
+        "y": 643.0103750228882,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": [\r
             []\r
         ]\r
     },\r
     {\r
-        "id": "fd35c3d4.a8e8a",\r
+        "id": "db202f3e.dab93",\r
         "type": "set",\r
         "name": "copy input data to service data",\r
-        "xml": "<set>\n<!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />",\r
+        "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />\n<parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />",\r
         "comments": "",\r
-        "x": 603.5001449584961,\r
-        "y": 344.010356426239,\r
-        "z": "79a5b197.5d84",\r
+        "x": 672.0040435791016,\r
+        "y": 474.01033639907837,\r
+        "z": "e44dd5e7.6a1128",\r
         "wires": []\r
+    },\r
+    {\r
+        "id": "5b908f22.f7f5a",\r
+        "type": "switchNode",\r
+        "name": "switch vnf-level-oper-status",\r
+        "xml": "<switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 658.75390625,\r
+        "y": 379.00390625,\r
+        "z": "e44dd5e7.6a1128",\r
+        "wires": [\r
+            [\r
+                "5ccb4fe0.99339",\r
+                "814ec70c.a8b9c8"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "5ccb4fe0.99339",\r
+        "type": "outcome",\r
+        "name": "outcome Created",\r
+        "xml": "<outcome value='Created'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 904.5872001647949,\r
+        "y": 380.1150040626526,\r
+        "z": "e44dd5e7.6a1128",\r
+        "wires": [\r
+            [\r
+                "e3b020d0.17a88"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "814ec70c.a8b9c8",\r
+        "type": "other",\r
+        "name": "other",\r
+        "xml": "<outcome value='Other'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 882.5872192382812,\r
+        "y": 430.1150155067444,\r
+        "z": "e44dd5e7.6a1128",\r
+        "wires": [\r
+            [\r
+                "50309b2.08dbf64"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "50309b2.08dbf64",\r
+        "type": "returnFailure",\r
+        "name": "return failure",\r
+        "xml": "<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`\" />",\r
+        "comments": "",\r
+        "x": 1042.086986541748,\r
+        "y": 433.11501455307007,\r
+        "z": "e44dd5e7.6a1128",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "e3b020d0.17a88",\r
+        "type": "block",\r
+        "name": "block : atomic",\r
+        "xml": "<block atomic=\"true\">",\r
+        "atomic": "true",\r
+        "outputs": 1,\r
+        "x": 1114.8935737609863,\r
+        "y": 391.44017934799194,\r
+        "z": "e44dd5e7.6a1128",\r
+        "wires": [\r
+            []\r
+        ]\r
     }\r
 ]
\ No newline at end of file
index 32fa9b2..86099f3 100644 (file)
                     </block>\r
                 </outcome>\r
             </switch>\r
+            <switch test='`$service-data.vnfs.vnf[$tmp.vidx].vnf-data.vnf-level-oper-status.order-status`'>\r
+                <outcome value='Created'>\r
+                    <block atomic="true"></block>\r
+                </outcome>\r
+                <outcome value='Other'>\r
+                    <return status='failure'>\r
+                        <parameter name='ack-final' value='Y'/>\r
+                        <parameter name="error-code" value="500" />\r
+                        <parameter name="error-message" value="`'VNF is not in appropriate state for activate. Current state is ' + $service-data.vnfs.vnf[$tmp.nidx].vnf-data.vnf-level-oper-status.order-status`" />\r
+                    </return>\r
+                </outcome>\r
+            </switch>\r
             <set>\r
-                <!--parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-id' value='`$vnf-topology-operation-input.vnf-information.vnf-id`' /-->\r
                 <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' />\r
                 <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' />\r
                 <parameter name='service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' />\r