Dublin release DG 22/79822/1
authorCheung, Pat (kc1472) <kc1472@att.com>
Wed, 6 Mar 2019 22:10:00 +0000 (22:10 +0000)
committerCheung, Pat (kc1472) <kc1472@att.com>
Wed, 6 Mar 2019 22:10:00 +0000 (22:10 +0000)
DGs to support pnf-topology-operation with deactivate svc-action

Change-Id: I3261d704e6d42173c841f56fe1d18dddb00ed43e
Issue-ID: SDNC-643
Signed-off-by: Cheung, Pat (kc1472) <kc1472@att.com>
Former-commit-id: 6f77209f79bc69c5335ef32c04365722ec9bb415

platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.json [new file with mode: 0644]
platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml [new file with mode: 0644]

diff --git a/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.json b/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.json
new file mode 100644 (file)
index 0000000..f02e15d
--- /dev/null
@@ -0,0 +1,408 @@
+[\r
+    {\r
+        "id": "8506af40.5640e",\r
+        "type": "dgstart",\r
+        "name": "DGSTART",\r
+        "outputs": 1,\r
+        "x": 182.5,\r
+        "y": 152.4136562347412,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "8720000f.3622"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "8720000f.3622",\r
+        "type": "service-logic",\r
+        "name": "GENERIC-RESOURCE-API ${project.version}",\r
+        "module": "GENERIC-RESOURCE-API",\r
+        "version": "${project.version}",\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": 296.78570556640625,\r
+        "y": 192.6517677307129,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "35837ff.2b64c8"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "35837ff.2b64c8",\r
+        "type": "method",\r
+        "name": "method pnf-topology-operation-deactivate",\r
+        "xml": "<method rpc='pnf-topology-operation-deactivate' mode='sync'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 282.92862701416016,\r
+        "y": 232.4136562347412,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "5faec448.e83a7c"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "988f9bfd.746e88",\r
+        "type": "comment",\r
+        "name": "pnf-topology-operation-deactivate",\r
+        "info": "",\r
+        "comments": "",\r
+        "x": 576.844856262207,\r
+        "y": 100,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "f4c58140.97edc",\r
+        "type": "switchNode",\r
+        "name": "switch request-action",\r
+        "xml": "<switch test='`$pnf-topology-operation-input.request-information.request-action`'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 586.023811340332,\r
+        "y": 331.2707939147949,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "726a3e0d.32be6",\r
+                "1cb14b3d.d899b5"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "726a3e0d.32be6",\r
+        "type": "outcome",\r
+        "name": "DeletePnfInstance",\r
+        "xml": "<outcome value='DeletePnfInstance'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 812.7380867004395,\r
+        "y": 306.74701023101807,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "a3bbd2.65d8743"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "1cb14b3d.d899b5",\r
+        "type": "other",\r
+        "name": "other",\r
+        "xml": "<outcome value='Other'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 776.7380523681641,\r
+        "y": 352.4613380432129,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "4344bfcd.bedc2"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "a3bbd2.65d8743",\r
+        "type": "block",\r
+        "name": "block",\r
+        "xml": "<block>\n",\r
+        "atomic": "false",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 999.59521484375,\r
+        "y": 306.7470397949219,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            []\r
+        ]\r
+    },\r
+    {\r
+        "id": "4344bfcd.bedc2",\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=\"If svc-action is 'deactivate' then request-action must be 'DeletePnfInstance'\" />\n",\r
+        "comments": "",\r
+        "x": 1016.7380599975586,\r
+        "y": 352.46129608154297,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "5faec448.e83a7c",\r
+        "type": "block",\r
+        "name": "block : atomic",\r
+        "xml": "<block atomic=\"true\">",\r
+        "atomic": "true",\r
+        "outputs": 1,\r
+        "x": 259.16666412353516,\r
+        "y": 454.0803279876709,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "f4c58140.97edc",\r
+                "12e91417.a114bc",\r
+                "de22c438.12dd88",\r
+                "8ecfe532.9e7b28",\r
+                "abfda14e.5c5ef",\r
+                "33eac0f7.3cb6e",\r
+                "3a413756.ae65c8",\r
+                "391576a4.28d9fa"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "12e91417.a114bc",\r
+        "type": "switchNode",\r
+        "name": "switch pnf_length",\r
+        "xml": "<switch test='`$service-data.pnfs.pnf_length`'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 572.4999847412109,\r
+        "y": 400.74701976776123,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "65a7dfe.70d192"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "65a7dfe.70d192",\r
+        "type": "other",\r
+        "name": "NULL",\r
+        "xml": "<outcome value=''>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 759.1666641235352,\r
+        "y": 400.0803174972534,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "72a5bc7.446c444"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "72a5bc7.446c444",\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=\"404\" />\n    <parameter name=\"error-message\" value=\"There are no PNFs in MD-SAL\" />\n",\r
+        "comments": "",\r
+        "x": 940.8332901000977,\r
+        "y": 400.0803174972534,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "de22c438.12dd88",\r
+        "type": "for",\r
+        "name": "for each pnf",\r
+        "xml": "<for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 554.1666641235352,\r
+        "y": 449.08033752441406,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "20aebd62.e37282"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "20aebd62.e37282",\r
+        "type": "switchNode",\r
+        "name": "switch this pnf-id == input pnf-id",\r
+        "xml": "<switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 809.1667518615723,\r
+        "y": 447.7470054626465,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "ea9be52a.cc9c48"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "ea9be52a.cc9c48",\r
+        "type": "outcomeTrue",\r
+        "name": "true",\r
+        "xml": "<outcome value='true'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 1047.5000381469727,\r
+        "y": 446.7469835281372,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "f14f1154.64ba2"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "f14f1154.64ba2",\r
+        "type": "set",\r
+        "name": "set pnf-index",\r
+        "xml": "<set>\n<parameter name='pnf-index' value='`$idx`' />\n",\r
+        "comments": "",\r
+        "x": 1215.8332328796387,\r
+        "y": 446.7470054626465,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "8ecfe532.9e7b28",\r
+        "type": "switchNode",\r
+        "name": "switch pnf-index",\r
+        "xml": "<switch test='`$pnf-index`'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 565.8333206176758,\r
+        "y": 495.74700689315796,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "9637a20a.14e2a"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "9637a20a.14e2a",\r
+        "type": "other",\r
+        "name": "NULL",\r
+        "xml": "<outcome value=''>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 747.4999465942383,\r
+        "y": 495.08033752441406,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "f6ea119e.d9b2b"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "f6ea119e.d9b2b",\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=\"404\" />\n    <parameter name=\"error-message\" value=\"'Could not find PNF with pnf-id = ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'\" />\n",\r
+        "comments": "",\r
+        "x": 914.166633605957,\r
+        "y": 494.74696350097656,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "abfda14e.5c5ef",\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": 559.1666488647461,\r
+        "y": 715.7469959259033,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "33eac0f7.3cb6e",\r
+        "type": "set",\r
+        "name": "set pnf-level-oper-status to PendingDelete",\r
+        "xml": "<set>\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='PendingDelete' />\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />\n",\r
+        "comments": "",\r
+        "x": 646.646728515625,\r
+        "y": 671.4174251556396,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "3a413756.ae65c8",\r
+        "type": "set",\r
+        "name": "copy input data",\r
+        "xml": "<set>\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.' value='$pnf-topology-operation-input.sdnc-request-header.' />\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.' value='$pnf-topology-operation-input.request-information.' />\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.' value='$pnf-topology-operation-input.service-information.' />\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.' value='$pnf-topology-operation-input.pnf-details.' />\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.' value='$pnf-topology-operation-input.pnf-request-input.' />\n\n",\r
+        "comments": "",\r
+        "x": 560.8332290649414,\r
+        "y": 629.0803050994873,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "e04691b0.11c04",\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=\"`'No pnf found in AAI with pnf-id =  ' + $service-data.pnfs.pnf[$pnf-index].pnf-id`\" />\n",\r
+        "comments": "",\r
+        "x": 1112.499942779541,\r
+        "y": 581.6666793823242,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "cbdddd32.ce5af",\r
+        "type": "failure",\r
+        "name": "failure",\r
+        "xml": "<outcome value='failure'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 943.5238418579102,\r
+        "y": 537.9524908065796,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "1f3441b2.bf159e"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "156cb32c.728abd",\r
+        "type": "not-found",\r
+        "name": "not-found",\r
+        "xml": "<outcome value='not-found'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 952.095272064209,\r
+        "y": 582.2382040023804,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "e04691b0.11c04"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "1f3441b2.bf159e",\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=\"Error updating pnf in AAI\" />\n",\r
+        "comments": "",\r
+        "x": 1115.1905364990234,\r
+        "y": 538.4288845062256,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "391576a4.28d9fa",\r
+        "type": "save",\r
+        "name": "update pnf orch-status to PendingDelete",\r
+        "xml": "<update plugin=\"org.onap.ccsdk.sli.adaptors.aai.AAIService\"\n   resource=\"pnf\"\n   key=\"pnf.pnf-id = $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id\"\n   force=\"true\" pfx=\"tmp.AnAI-data\">\n<parameter name=\"orchestration-status\" value=\"PendingDelete\" />\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 667.4999084472656,\r
+        "y": 557.6667184829712,\r
+        "z": "e258b0aa.62b08",\r
+        "wires": [\r
+            [\r
+                "cbdddd32.ce5af",\r
+                "156cb32c.728abd"\r
+            ]\r
+        ]\r
+    }\r
+]
\ No newline at end of file
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_pnf-topology-operation-deactivate.xml
new file mode 100644 (file)
index 0000000..5cb8438
--- /dev/null
@@ -0,0 +1,84 @@
+<service-logic\r
+    xmlns='http://www.onap.org/sdnc/svclogic'\r
+    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
+    <method rpc='pnf-topology-operation-deactivate' mode='sync'>\r
+        <block atomic="true">\r
+            <switch test='`$pnf-topology-operation-input.request-information.request-action`'>\r
+                <outcome value='DeletePnfInstance'>\r
+                    <block></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="If svc-action is 'deactivate' then request-action must be 'DeletePnfInstance'" />\r
+                    </return>\r
+                </outcome>\r
+            </switch>\r
+            <switch test='`$service-data.pnfs.pnf_length`'>\r
+                <outcome value=''>\r
+                    <return status='failure'>\r
+                        <parameter name='ack-final' value='Y'/>\r
+                        <parameter name="error-code" value="404" />\r
+                        <parameter name="error-message" value="There are no PNFs in MD-SAL" />\r
+                    </return>\r
+                </outcome>\r
+            </switch>\r
+            <for index='idx' start='0' end='`$service-data.pnfs.pnf_length`' >\r
+                <switch test='`$service-data.pnfs.pnf[$idx].pnf-id == $pnf-topology-operation-input.pnf-details.pnf-id`'>\r
+                    <outcome value='true'>\r
+                        <set>\r
+                            <parameter name='pnf-index' value='`$idx`' />\r
+                        </set>\r
+                    </outcome>\r
+                </switch>\r
+            </for>\r
+            <switch test='`$pnf-index`'>\r
+                <outcome value=''>\r
+                    <return status='failure'>\r
+                        <parameter name='ack-final' value='Y'/>\r
+                        <parameter name="error-code" value="404" />\r
+                        <parameter name="error-message" value="'Could not find PNF with pnf-id = ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'" />\r
+                    </return>\r
+                </outcome>\r
+            </switch>\r
+            <update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"\r
+   resource="pnf"\r
+   key="pnf.pnf-id = $service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-topology.pnf-topology-identifier-structure.pnf-id"\r
+   force="true" pfx="tmp.AnAI-data">\r
+                <parameter name="orchestration-status" value="PendingDelete" />\r
+                <outcome value='failure'>\r
+                    <return status='failure'>\r
+                        <parameter name='ack-final' value='Y'/>\r
+                        <parameter name="error-code" value="500" />\r
+                        <parameter name="error-message" value="Error updating pnf in AAI" />\r
+                    </return>\r
+                </outcome>\r
+                <outcome value='not-found'>\r
+                    <return status='failure'>\r
+                        <parameter name='ack-final' value='Y'/>\r
+                        <parameter name="error-code" value="500" />\r
+                        <parameter name="error-message" value="`'No pnf found in AAI with pnf-id =  ' + $service-data.pnfs.pnf[$pnf-index].pnf-id`" />\r
+                    </return>\r
+                </outcome>\r
+            </update>\r
+            <set>\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.sdnc-request-header.' value='$pnf-topology-operation-input.sdnc-request-header.' />\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.request-information.' value='$pnf-topology-operation-input.request-information.' />\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.service-information.' value='$pnf-topology-operation-input.service-information.' />\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-details.' value='$pnf-topology-operation-input.pnf-details.' />\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-request-input.' value='$pnf-topology-operation-input.pnf-request-input.' />\r
+            </set>\r
+            <set>\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='PendingDelete' />\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-rpc-action' value='`$pnf-topology-operation-input.sdnc-request-header.svc-action`' />\r
+                <parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.last-action' value='`$pnf-topology-operation-input.request-information.request-action`' />\r
+            </set>\r
+            <return status='success'>\r
+                <parameter name="ack-final-indicator" value="Y" />\r
+                <parameter name="error-code" value="200" />\r
+                <parameter name="error-message" value="`$error-message`" />\r
+            </return>\r
+        </block>\r
+    </method>\r
+</service-logic>
\ No newline at end of file