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

Change-Id: I3b018738e01e0d4da2ff05468ad79a34e090471b
Issue-ID: SDNC-641
Signed-off-by: Cheung, Pat (kc1472) <kc1472@att.com>
Former-commit-id: 3749fcfacf157cd172826e92f58f1cbcc4ee690a

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

diff --git a/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_pnf-topology-operation-activate.json b/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_pnf-topology-operation-activate.json
new file mode 100644 (file)
index 0000000..c2637b4
--- /dev/null
@@ -0,0 +1,408 @@
+[\r
+    {\r
+        "id": "c1cda377.e6968",\r
+        "type": "dgstart",\r
+        "name": "DGSTART",\r
+        "outputs": 1,\r
+        "x": 158.75,\r
+        "y": 92.5,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "58dce5c3.307dcc"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "58dce5c3.307dcc",\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": 272.3690414428711,\r
+        "y": 132.73811054229736,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "9667d3fe.1b151"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "9667d3fe.1b151",\r
+        "type": "method",\r
+        "name": "method pnf-topology-operation-activate",\r
+        "xml": "<method rpc='pnf-topology-operation-activate' mode='sync'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 250.1786346435547,\r
+        "y": 173.166654586792,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "af3e8af.a61e978"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "49fe6017.3a4b5",\r
+        "type": "comment",\r
+        "name": "pnf-topology-operation-activate",\r
+        "info": "",\r
+        "comments": "",\r
+        "x": 553.094856262207,\r
+        "y": 40.08634376525879,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "490a17e0.43a998",\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": 562.273811340332,\r
+        "y": 271.3571376800537,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "f5055a1f.74b9c8",\r
+                "707a8e66.03ca9"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "f5055a1f.74b9c8",\r
+        "type": "outcome",\r
+        "name": "CreatePnfInstance",\r
+        "xml": "<outcome value='CreatePnfInstance'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 780.6547737121582,\r
+        "y": 248.50002193450928,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "92dc7585.b94628"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "707a8e66.03ca9",\r
+        "type": "other",\r
+        "name": "other",\r
+        "xml": "<outcome value='Other'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 744.6547393798828,\r
+        "y": 294.2143497467041,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "e8067f7e.1e237"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "92dc7585.b94628",\r
+        "type": "block",\r
+        "name": "block",\r
+        "xml": "<block>\n",\r
+        "atomic": "false",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 967.5119018554688,\r
+        "y": 248.5000514984131,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            []\r
+        ]\r
+    },\r
+    {\r
+        "id": "e8067f7e.1e237",\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 'activate' then request-action must be 'CreatePnfInstance'\" />\n",\r
+        "comments": "",\r
+        "x": 984.6547470092773,\r
+        "y": 294.2143077850342,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "af3e8af.a61e978",\r
+        "type": "block",\r
+        "name": "block : atomic",\r
+        "xml": "<block atomic=\"true\">",\r
+        "atomic": "true",\r
+        "outputs": 1,\r
+        "x": 240.41666412353516,\r
+        "y": 481.6666622161865,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "490a17e0.43a998",\r
+                "5bf28db1.61b564",\r
+                "5b09bd46.5c0574",\r
+                "a8e6104b.8eaab",\r
+                "5ddadd37.238e54",\r
+                "653d68c6.7140b8",\r
+                "9b19e105.b2e98",\r
+                "7bd93c51.6f0374"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "5bf28db1.61b564",\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": 548.7499847412109,\r
+        "y": 340.83336353302,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "89467472.09d148"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "89467472.09d148",\r
+        "type": "other",\r
+        "name": "NULL",\r
+        "xml": "<outcome value=''>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 735.4166641235352,\r
+        "y": 340.1666612625122,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "7e601764.405ac8"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "7e601764.405ac8",\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": 917.0832901000977,\r
+        "y": 340.1666612625122,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "5b09bd46.5c0574",\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": 530.4166641235352,\r
+        "y": 389.16668128967285,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "4e154697.d6fc28"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "4e154697.d6fc28",\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": 785.4167518615723,\r
+        "y": 387.8333492279053,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "e7691b1.8180fe8"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "e7691b1.8180fe8",\r
+        "type": "outcomeTrue",\r
+        "name": "true",\r
+        "xml": "<outcome value='true'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 1023.7500381469727,\r
+        "y": 386.833327293396,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "cc442217.f25db"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "cc442217.f25db",\r
+        "type": "set",\r
+        "name": "set pnf-index",\r
+        "xml": "<set>\n<parameter name='pnf-index' value='`$idx`' />\n",\r
+        "comments": "",\r
+        "x": 1192.0832328796387,\r
+        "y": 386.8333492279053,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "a8e6104b.8eaab",\r
+        "type": "switchNode",\r
+        "name": "switch pnf-index",\r
+        "xml": "<switch test='`$pnf-index`'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 542.0833282470703,\r
+        "y": 435.8333511352539,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "f4e58e32.9147f"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "f4e58e32.9147f",\r
+        "type": "other",\r
+        "name": "NULL",\r
+        "xml": "<outcome value=''>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 723.7499465942383,\r
+        "y": 435.16668128967285,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "1460f65f.17708a"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "1460f65f.17708a",\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 ' + $pnf-topology-operation-input.pnf-details.pnf-id + ' in MD-SAL'\" />\n",\r
+        "comments": "",\r
+        "x": 890.416633605957,\r
+        "y": 434.83330726623535,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "9b19e105.b2e98",\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": 530.8332901000977,\r
+        "y": 788.7500114440918,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "653d68c6.7140b8",\r
+        "type": "set",\r
+        "name": "set pnf-level-oper-status to Created",\r
+        "xml": "<set>\n<parameter name='service-data.pnfs.pnf[$pnf-index].pnf-data.pnf-level-oper-status.order-status' value='Created' />\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": 594.5633964538574,\r
+        "y": 739.8371295928955,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "5ddadd37.238e54",\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": 535.4165382385254,\r
+        "y": 695.8333110809326,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "cb0c3cab.3e7f9",\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": 1053.7500190734863,\r
+        "y": 581.4999418258667,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "7ccf7c78.770534",\r
+        "type": "failure",\r
+        "name": "failure",\r
+        "xml": "<outcome value='failure'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 884.7739181518555,\r
+        "y": 537.7857532501221,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "bb23b26b.3439a"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "877c806f.dc481",\r
+        "type": "not-found",\r
+        "name": "not-found",\r
+        "xml": "<outcome value='not-found'>\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 893.3453483581543,\r
+        "y": 582.0714664459229,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "cb0c3cab.3e7f9"\r
+            ]\r
+        ]\r
+    },\r
+    {\r
+        "id": "bb23b26b.3439a",\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": 1056.4406127929688,\r
+        "y": 538.2621469497681,\r
+        "z": "decb865e.560cf8",\r
+        "wires": []\r
+    },\r
+    {\r
+        "id": "7bd93c51.6f0374",\r
+        "type": "save",\r
+        "name": "update generic-pnf prov-status to NVTPROV",\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=\"prov-status\" value=\"NVTPROV\" />\n",\r
+        "comments": "",\r
+        "outputs": 1,\r
+        "x": 632.0833435058594,\r
+        "y": 557.5000095367432,\r
+        "z": "decb865e.560cf8",\r
+        "wires": [\r
+            [\r
+                "7ccf7c78.770534",\r
+                "877c806f.dc481"\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-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_pnf-topology-operation-activate.xml
new file mode 100644 (file)
index 0000000..a382b02
--- /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-activate' mode='sync'>\r
+        <block atomic="true">\r
+            <switch test='`$pnf-topology-operation-input.request-information.request-action`'>\r
+                <outcome value='CreatePnfInstance'>\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 'activate' then request-action must be 'CreatePnfInstance'" />\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 ' + $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="prov-status" value="NVTPROV" />\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='Created' />\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