diff options
3 files changed, 1347 insertions, 966 deletions
diff --git a/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.json b/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.json index fb57cbe8..6261220c 100644 --- a/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.json +++ b/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.json @@ -1,968 +1,1037 @@ [ - { - "id": "2530b9b4.e6f64e", - "type": "dgstart", - "name": "DGSTART", - "outputs": 1, - "x": 122, - "y": 66, - "z": "a50b508.c70bcb", - "wires": [ - [ - "f24329c.83c4e58" - ] - ] - }, - { - "id": "97a5934b.60b828", - "type": "method", - "name": "method self-serve-netbox-ip-assignment", - "xml": "<method rpc='self-serve-netbox-ip-assignment' mode='sync'>\n", - "comments": "", - "outputs": 1, - "x": 257.7857208251953, - "y": 123.1269884109497, - "z": "a50b508.c70bcb", - "wires": [ - [ - "439274d0.e50354" - ] - ] - }, - { - "id": "439274d0.e50354", - "type": "block", - "name": "block : atomic", - "xml": "<block atomic=\"true\">", - "atomic": "true", - "comments": "", - "outputs": 1, - "x": 151.32144165039062, - "y": 209.4286069869995, - "z": "a50b508.c70bcb", - "wires": [ - [ - "4408534b.4e62fc", - "795381cc.ae76e8", - "9e36d81b.e4d19" - ] - ] - }, - { - "id": "f24329c.83c4e58", - "type": "service-logic", - "name": "GENERIC-RESOURCE-API ${project.version}", - "module": "GENERIC-RESOURCE-API", - "version": "${project.version}", - "comments": "", - "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}'>", - "outputs": 1, - "x": 394.8571472167969, - "y": 65.42856693267822, - "z": "a50b508.c70bcb", - "wires": [ - [ - "97a5934b.60b828" - ] - ] - }, - { - "id": "4408534b.4e62fc", - "type": "switchNode", - "name": "switch: ss.capability-name", - "xml": "<switch test='`$ss.capability-name`'>\n", - "comments": "", - "outputs": 1, - "x": 385.75000762939453, - "y": 210.75000476837158, - "z": "a50b508.c70bcb", - "wires": [ - [ - "e3e743cf.b5708" - ] - ] - }, - { - "id": "e3e743cf.b5708", - "type": "outcome", - "name": "NULL", - "xml": "<outcome value=''>", - "outputs": 1, - "x": 610.7500305175781, - "y": 211.2500033378601, - "z": "a50b508.c70bcb", - "wires": [ - [ - "45c19f4e.02e1e" - ] - ] - }, - { - "id": "45c19f4e.02e1e", - "type": "returnFailure", - "name": "return failure", - "xml": "<return status=\"failure\">\n\t<parameter name=\"ack-final\" value=\"Y\" />\n\t<parameter name=\"error-code\" value=\"500\"/>\n\t<parameter name=\"error-message\" value=\"ss.capability-name is null\" />\n", - "comments": "", - "x": 770.6667022705078, - "y": 211.361102104187, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "795381cc.ae76e8", - "type": "switchNode", - "name": "switch: ss.capability-action", - "xml": "<switch test='`$ss.capability-action`'>\n", - "comments": "", - "outputs": 1, - "x": 387.00002670288086, - "y": 260.75000524520874, - "z": "a50b508.c70bcb", - "wires": [ - [ - "9d04bb67.f3d528", - "969e4445.b0611", - "d6457743.c33b1" - ] - ] - }, - { - "id": "9d04bb67.f3d528", - "type": "outcome", - "name": "NULL", - "xml": "<outcome value=''>", - "comments": "", - "outputs": 1, - "x": 610.5000228881836, - "y": 261.00000524520874, - "z": "a50b508.c70bcb", - "wires": [ - [ - "7ed3650.ebf061c" - ] - ] - }, - { - "id": "7ed3650.ebf061c", - "type": "returnFailure", - "name": "return failure", - "xml": "<return status=\"failure\">\n\t<parameter name=\"ack-final\" value=\"Y\" />\n\t<parameter name=\"error-code\" value=\"500\"/>\n\t<parameter name=\"error-message\" value=\"ss.capability-action is null\" />\n", - "comments": "", - "x": 770.4166946411133, - "y": 261.11110401153564, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "969e4445.b0611", - "type": "outcome", - "name": "assign", - "xml": "<outcome value='assign'>", - "comments": "", - "outputs": 1, - "x": 609.2500190734863, - "y": 316.00000858306885, - "z": "a50b508.c70bcb", - "wires": [ - [ - "f154be48.ae57c" - ] - ] - }, - { - "id": "d6457743.c33b1", - "type": "outcome", - "name": "unassign", - "xml": "<outcome value='unassign'>", - "comments": "", - "outputs": 1, - "x": 609.1786499023438, - "y": 1127.642822265625, - "z": "a50b508.c70bcb", - "wires": [ - [ - "6adef88c.08d9f8" - ] - ] - }, - { - "id": "ddde01a5.7d761", - "type": "call", - "name": "call self-service-capability-param-resolution", - "xml": "<call module='GENERIC-RESOURCE-API' rpc='self-service-capability-param-resolution' mode='sync' >\n", - "comments": "", - "outputs": 1, - "x": 1099.416748046875, - "y": 316.25, - "z": "a50b508.c70bcb", - "wires": [ - [ - "289ac02f.fef728" - ] - ] - }, - { - "id": "289ac02f.fef728", - "type": "failure", - "name": "failure", - "xml": "<outcome value='failure'>\n", - "comments": "", - "outputs": 1, - "x": 1350.6666679382324, - "y": 316.25000858306885, - "z": "a50b508.c70bcb", - "wires": [ - [ - "37e2330e.5ce094" - ] - ] - }, - { - "id": "37e2330e.5ce094", - "type": "returnFailure", - "name": "return failure", - "xml": "<return status=\"failure\">\n\t<parameter name=\"ack-final\" value=\"Y\" />\n\t<parameter name=\"error-code\" value=\"500\"/>\n\t<parameter name=\"error-message\" value=\"`'Not all assignments are resolved' + $error-message`\" />\n", - "comments": "", - "x": 1509.416648864746, - "y": 316.2500047683716, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "193f213d.d80e7f", - "type": "set", - "name": "set tmp.ss.param.capability-name", - "xml": "<set>\n<parameter name='tmp.ss.param.capability-name' \n\tvalue='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />\n", - "comments": "", - "x": 1514.5634536743164, - "y": 372.03172874450684, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "667d4699.51911", - "type": "for", - "name": "for pidx in param_length", - "xml": "<for index=\"pidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`\">", - "comments": "", - "outputs": 1, - "x": 1224.7776794433594, - "y": 372.10319900512695, - "z": "a50b508.c70bcb", - "wires": [ - [ - "e03f298c.89ef68", - "193f213d.d80e7f", - "4678ae91.df7428" - ] - ] - }, - { - "id": "e03f298c.89ef68", - "type": "switchNode", - "name": "switch: capability-name - ss vs param", - "xml": "<switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>\n", - "comments": "", - "outputs": 1, - "x": 1527.638916015625, - "y": 453.3809814453125, - "z": "a50b508.c70bcb", - "wires": [ - [ - "ad87e8f8.f29d8" - ] - ] - }, - { - "id": "ad87e8f8.f29d8", - "type": "outcomeTrue", - "name": "true", - "xml": "<outcome value='true'>\n", - "comments": "", - "outputs": 1, - "x": 1766.3889236450195, - "y": 453.1309814453125, - "z": "a50b508.c70bcb", - "wires": [ - [ - "3fea9750.333958" - ] - ] - }, - { - "id": "4b58ccb.9c3cd34", - "type": "switchNode", - "name": "switch: resource-key[].name", - "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>\n", - "comments": "", - "outputs": 1, - "x": 1526.0637130737305, - "y": 542.9484596252441, - "z": "a50b508.c70bcb", - "wires": [ - [ - "5c012e9d.3803c", - "d37d3547.691c58", - "180cc75.008d139", - "385a53b.66671ac", - "6407a5bc.0cc834" - ] - ] - }, - { - "id": "d37d3547.691c58", - "type": "outcome", - "name": "service-instance-id", - "xml": "<outcome value='service-instance-id'>\n", - "comments": "", - "outputs": 1, - "x": 1797.452621459961, - "y": 542.4206781387329, - "z": "a50b508.c70bcb", - "wires": [ - [ - "52db4f21.43a918" - ] - ] - }, - { - "id": "52db4f21.43a918", - "type": "set", - "name": "set tmp.ss.service-instance-id", - "xml": "<set>\n<parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", - "comments": "", - "x": 2063.702621459961, - "y": 542.1706781387329, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "daf7a5b3.f6dd1", - "type": "set", - "name": "set service-data...param[].value = ip-address", - "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' \n\tvalue='`$self_serve_netbox_ip_assignement.ip-address`' />\n", - "comments": "", - "x": 2035.96044921875, - "y": 980.0316772460938, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "680b90a.12cf17", - "type": "for", - "name": "for pidx in param_length", - "xml": "<for index=\"pidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`\">", - "comments": "", - "outputs": 1, - "x": 1042.28564453125, - "y": 980.9642944335938, - "z": "a50b508.c70bcb", - "wires": [ - [ - "62315add.1e0734" - ] - ] - }, - { - "id": "62315add.1e0734", - "type": "switchNode", - "name": "switch: param[].name", - "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>\n", - "comments": "", - "outputs": 1, - "x": 1288.0633544921875, - "y": 980.7142333984375, - "z": "a50b508.c70bcb", - "wires": [ - [ - "2bb8b8e0.b3d528" - ] - ] - }, - { - "id": "e46bc99.e09a7b8", - "type": "block", - "name": "block", - "xml": "<block>\n", - "atomic": "false", - "comments": "", - "outputs": 1, - "x": 1766.0714225769043, - "y": 980.8928833007812, - "z": "a50b508.c70bcb", - "wires": [ - [ - "daf7a5b3.f6dd1", - "c2ef384b.46015" - ] - ] - }, - { - "id": "789789b0.192b1", - "type": "update", - "name": "get-resource NETBOX_IP_ASSIGNMENTS", - "xml": "<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey='SELECT * from NETBOX_IP_ASSIGNMENTS \n\t\tWHERE external_key = $tmp.ss.external-key\n\t\tAND service_instance_id = $tmp.ss.service-instance-id\" >", - "comments": "", - "outputs": 1, - "x": 1084.6627197265625, - "y": 1126.4642333984375, - "z": "a50b508.c70bcb", - "wires": [ - [ - "263460f3.585f6", - "e0cf0d4e.662af8" - ] - ] - }, - { - "id": "263460f3.585f6", - "type": "not-found", - "name": "not-found", - "xml": "<outcome value='not-found'>\n", - "comments": "", - "outputs": 1, - "x": 1379.250057220459, - "y": 1127.46426653862, - "z": "a50b508.c70bcb", - "wires": [ - [ - "827adc75.f19d3" - ] - ] - }, - { - "id": "827adc75.f19d3", - "type": "block", - "name": "block", - "xml": "<block>\n", - "atomic": "false", - "comments": "", - "outputs": 1, - "x": 1549.3928658621653, - "y": 1127.8928443363734, - "z": "a50b508.c70bcb", - "wires": [ - [] - ] - }, - { - "id": "e0cf0d4e.662af8", - "type": "success", - "name": "success", - "xml": "<outcome value='success'>\n", - "comments": "", - "outputs": 1, - "x": 1375.9642028808594, - "y": 1175.1785793304443, - "z": "a50b508.c70bcb", - "wires": [ - [ - "74c412e0.e4563c" - ] - ] - }, - { - "id": "6adef88c.08d9f8", - "type": "block", - "name": "block : atomic", - "xml": "<block atomic=\"true\">", - "atomic": "true", - "outputs": 1, - "x": 778.5000152587891, - "y": 1128.107177734375, - "z": "a50b508.c70bcb", - "wires": [ - [ - "97394cd8.c006c", - "789789b0.192b1", - "8a29b237.3a1ab8" - ] - ] - }, - { - "id": "f154be48.ae57c", - "type": "block", - "name": "block : atomic", - "xml": "<block atomic=\"true\">", - "atomic": "true", - "comments": "", - "outputs": 1, - "x": 782.0000305175781, - "y": 316.25000953674316, - "z": "a50b508.c70bcb", - "wires": [ - [ - "ddde01a5.7d761", - "97394cd8.c006c", - "680b90a.12cf17", - "bfdda910.78af88" - ] - ] - }, - { - "id": "3fea9750.333958", - "type": "break", - "name": "break", - "xml": "<break>\n", - "comments": "", - "x": 1904.785831451416, - "y": 452.4483938217163, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "2cc58bea.09d2f4", - "type": "for", - "name": "for kidx in resource-key_length", - "xml": "<for index=\"kidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`\">", - "comments": "", - "outputs": 1, - "x": 1246.924789428711, - "y": 542.8095703125, - "z": "a50b508.c70bcb", - "wires": [ - [ - "4b58ccb.9c3cd34" - ] - ] - }, - { - "id": "97394cd8.c006c", - "type": "block", - "name": "block", - "xml": "<block>\n", - "atomic": "false", - "comments": "", - "outputs": 1, - "x": 990.0357055664062, - "y": 372.2261657714844, - "z": "a50b508.c70bcb", - "wires": [ - [ - "667d4699.51911", - "2cc58bea.09d2f4", - "c6e8fa3c.1df4d8" - ] - ] - }, - { - "id": "9e36d81b.e4d19", - "type": "execute", - "name": "printContext", - "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >\n<parameter name='filename' value='/var/tmp/ss.eipam.log' />\n", - "comments": "", - "outputs": 1, - "x": 343.25000762939453, - "y": 426.0000066757202, - "z": "a50b508.c70bcb", - "wires": [ - [] - ] - }, - { - "id": "b4c5f803.8e5ff8", - "type": "update", - "name": "update NETBOX_IP_ASSIGNMENTS to PENDING_DELETE...", - "xml": "<update plugin=\"org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource\" resource=\"SQL\"\n\tkey=\"UPDATE NETBOX_IP_ASSIGNMENTS set ip_status = $tmp.status \n\t\tWHERE external_key = $tmp.ss.external-key\n\t\tAND service_instance_id = $tmp.ss.service-instance-id\" >", - "comments": "", - "outputs": 1, - "x": 1907.5596923828125, - "y": 1218.1429443359375, - "z": "a50b508.c70bcb", - "wires": [ - [ - "804b2812.ef90a8" - ] - ] - }, - { - "id": "331e2fe5.e9d148", - "type": "set", - "name": "set status = PENDING_DELETE", - "xml": "<set>\n<parameter name='tmp.status' value=\"PENDING_DELETE\" />\n", - "comments": "", - "x": 1817.4761962890625, - "y": 1176.4761962890625, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "804b2812.ef90a8", - "type": "failure", - "name": "failure", - "xml": "<outcome value='failure'>\n", - "comments": "", - "outputs": 1, - "x": 2215.2261505126953, - "y": 1218.7262678146362, - "z": "a50b508.c70bcb", - "wires": [ - [ - "5b0ce03c.02484" - ] - ] - }, - { - "id": "5b0ce03c.02484", - "type": "returnFailure", - "name": "return failure", - "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 EIPAM_IP_ASSIGNMENTS table to unassign ip with client_key=' + $tmp.ss.client-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`\" />\n", - "comments": "", - "x": 2394.2264404296875, - "y": 1218.535888671875, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "c884502.10a993", - "type": "execute", - "name": "execute Netbox unassign IP addresses", - "xml": "<execute plugin=\"org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient\" method=\"unassignIpAddress\">\n<parameter name=\"service_instance_id\" value=\"`$tmp.ss.service-instance-id`\" />\n<parameter name=\"external_key\" value=\"`$tmp.ss.external_key`\" />", - "comments": "", - "outputs": 1, - "x": 1837.5595703125, - "y": 1264.3930053710938, - "z": "a50b508.c70bcb", - "wires": [ - [ - "938555fd.2c9f4" - ] - ] - }, - { - "id": "938555fd.2c9f4", - "type": "failure", - "name": "failure", - "xml": "<outcome value='failure'>\n", - "comments": "", - "outputs": 1, - "x": 2080.892837524414, - "y": 1264.392954826355, - "z": "a50b508.c70bcb", - "wires": [ - [ - "73bb5af.611c4a4" - ] - ] - }, - { - "id": "73bb5af.611c4a4", - "type": "returnFailure", - "name": "return failure", - "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 in EIPAMPlugin.unassignIPAddress with client-key='+ $tmp.ss.client-key`\" />\n", - "comments": "", - "x": 2242.892864227295, - "y": 1264.2026901245117, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "74c412e0.e4563c", - "type": "block", - "name": "block : atomic", - "xml": "<block atomic=\"true\">", - "atomic": "true", - "outputs": 1, - "x": 1558.1786041259766, - "y": 1175.8928241729736, - "z": "a50b508.c70bcb", - "wires": [ - [ - "331e2fe5.e9d148", - "b4c5f803.8e5ff8", - "c884502.10a993" - ] - ] - }, - { - "id": "c6e8fa3c.1df4d8", - "type": "record", - "name": "record", - "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"`'SS: pidx: ' + $pidx`\"/>\n", - "comments": "", - "outputs": 1, - "x": 1171.84130859375, - "y": 488.4206237792969, - "z": "a50b508.c70bcb", - "wires": [ - [] - ] - }, - { - "id": "5c012e9d.3803c", - "type": "outcome", - "name": "vf-module-id", - "xml": "<outcome value='vf-module-id'>\n", - "comments": "", - "outputs": 1, - "x": 1779.285629272461, - "y": 588.6706171035767, - "z": "a50b508.c70bcb", - "wires": [ - [ - "b3c8659d.3706c" - ] - ] - }, - { - "id": "b3c8659d.3706c", - "type": "set", - "name": "set tmp.ss.vf-module-id", - "xml": "<set>\n<parameter name='tmp.ss.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", - "comments": "", - "x": 2045.2857513427734, - "y": 588.6706171035767, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "8a29b237.3a1ab8", - "type": "for", - "name": "for pidx in param_length", - "xml": "<for index=\"pidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`\">", - "comments": "", - "outputs": 1, - "x": 1045.9285888671875, - "y": 1366.7142124176025, - "z": "a50b508.c70bcb", - "wires": [ - [ - "e55f8062.b15058" - ] - ] - }, - { - "id": "e55f8062.b15058", - "type": "switchNode", - "name": "switch: param[].name", - "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>\n", - "comments": "", - "outputs": 1, - "x": 1293.9285888671875, - "y": 1366.4642124176025, - "z": "a50b508.c70bcb", - "wires": [ - [ - "783ce22f.9c0904" - ] - ] - }, - { - "id": "783ce22f.9c0904", - "type": "outcome", - "name": "ip-address", - "xml": "<outcome value='ip-address'>", - "comments": "", - "outputs": 1, - "x": 1538.464340209961, - "y": 1366.642786026001, - "z": "a50b508.c70bcb", - "wires": [ - [ - "85da44f2.9478b8" - ] - ] - }, - { - "id": "85da44f2.9478b8", - "type": "set", - "name": "set resource-resolution-data.status = DELETED", - "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' \n\tvalue='DELETED' />\n", - "comments": "", - "x": 1860.6429443359375, - "y": 1366.857177734375, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "180cc75.008d139", - "type": "outcome", - "name": "prefix-id", - "xml": "<outcome value='prefix-id'>\n", - "comments": "", - "outputs": 1, - "x": 1768.341293334961, - "y": 632.9206476211548, - "z": "a50b508.c70bcb", - "wires": [ - [ - "4e3dfad.08e4684" - ] - ] - }, - { - "id": "4e3dfad.08e4684", - "type": "set", - "name": "set prefix-id", - "xml": "<set>\n<parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", - "comments": "", - "x": 2014.841293334961, - "y": 633.1706171035767, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "bfdda910.78af88", - "type": "execute", - "name": "execute NetboxClient assignIpAddress", - "xml": "<execute plugin=\"org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient\" method=\"assignIpAddress\">\n<parameter name=\"service_instance_id\" value=\"`$tmp.ss.service-instance-id`\" />\n<parameter name=\"vf_module_id\" value=\"`$tmp.ss.vf-module-id`\" />\n<parameter name=\"prefix_id\" value=\"`$tmp.ss.prefix-id`\" />\n<parameter name=\"resource_name\" value=\"`$tmp.ss.param.name`\" />\n<parameter name=\"external_key\" value=\"`$tmp.ss.external_key`\" />", - "comments": "", - "outputs": 1, - "x": 1094.52392578125, - "y": 804.2023315429688, - "z": "a50b508.c70bcb", - "wires": [ - [ - "632677c6.e90368" - ] - ] - }, - { - "id": "632677c6.e90368", - "type": "failure", - "name": "failure", - "xml": "<outcome value='failure'>\n", - "comments": "", - "outputs": 1, - "x": 1349.5238647460938, - "y": 804.2023315429688, - "z": "a50b508.c70bcb", - "wires": [ - [ - "2c62cad1.235d9e" - ] - ] - }, - { - "id": "2c62cad1.235d9e", - "type": "block", - "name": "block : atomic", - "xml": "<block atomic='true'>", - "atomic": "true", - "comments": "", - "outputs": 1, - "x": 1519.5238647460938, - "y": 804.2023315429688, - "z": "a50b508.c70bcb", - "wires": [ - [ - "db150ab3.5a407", - "5b7f4cc.962b0b4" - ] - ] - }, - { - "id": "db150ab3.5a407", - "type": "set", - "name": "set resource-resolution-data.status = FAILED", - "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />\n", - "comments": "", - "x": 1834.5238647460938, - "y": 804.2023315429688, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "5b7f4cc.962b0b4", - "type": "returnFailure", - "name": "return failure", - "xml": "<return status='failure'>\n<parameter name='error-code' value='' />\n<parameter name='error-message' value='' />\n", - "comments": "", - "x": 1736.1903076171875, - "y": 858.0912170410156, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "c2ef384b.46015", - "type": "set", - "name": "set resource-resolution-data.status = SUCCESS", - "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' \n\tvalue='SUCCESS' />\n", - "comments": "", - "x": 2057.3214111328125, - "y": 1037.8928833007812, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "385a53b.66671ac", - "type": "outcome", - "name": "ip-address-id", - "xml": "<outcome value='ip-address-id'>\n", - "comments": "", - "outputs": 1, - "x": 1782.2224426269531, - "y": 677.7777214050293, - "z": "a50b508.c70bcb", - "wires": [ - [ - "882acfd1.857a7" - ] - ] - }, - { - "id": "882acfd1.857a7", - "type": "set", - "name": "ip-address-id", - "xml": "<set>\n<parameter name='tmp.ss.ip-address-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", - "comments": "", - "x": 2017.2223205566406, - "y": 677.7777824401855, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "6407a5bc.0cc834", - "type": "outcome", - "name": "external_key", - "xml": "<outcome value='external_key'>\n", - "comments": "", - "outputs": 1, - "x": 1769.8414611816406, - "y": 723.492015838623, - "z": "a50b508.c70bcb", - "wires": [ - [ - "51922093.53fea8" - ] - ] - }, - { - "id": "51922093.53fea8", - "type": "set", - "name": "set external-key", - "xml": "<set>\n<parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", - "comments": "", - "x": 2018.4128723144531, - "y": 723.4920768737793, - "z": "a50b508.c70bcb", - "wires": [] - }, - { - "id": "2bb8b8e0.b3d528", - "type": "outcome", - "name": "tmp.ss.param.name", - "xml": "<outcome value='tmp.ss.param.name'>\n", - "comments": "", - "outputs": 1, - "x": 1543.3333740234375, - "y": 979.9998779296875, - "z": "a50b508.c70bcb", - "wires": [ - [ - "e46bc99.e09a7b8" - ] - ] - }, - { - "id": "4678ae91.df7428", - "type": "set", - "name": "set tmp.ss.param.name", - "xml": "<set>\n<parameter name='tmp.ss.param.name' \n\tvalue='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`' />\n", - "comments": "", - "x": 1477.7779541015625, - "y": 412.22216796875, - "z": "a50b508.c70bcb", - "wires": [] - } + { + "id": "1ac00e46.c3e9e2", + "type": "dgstart", + "name": "DGSTART", + "outputs": 1, + "x": 114, + "y": 47, + "z": "143c1488.728ec3", + "wires": [ + [ + "52295e06.9cc6c" + ] + ] + }, + { + "id": "df5325d5.fd4748", + "type": "method", + "name": "method self-serve-netbox-ip-assignment", + "xml": "<method rpc='self-serve-netbox-ip-assignment' mode='sync'>\n", + "comments": "", + "outputs": 1, + "x": 249.7857208251953, + "y": 104.1269884109497, + "z": "143c1488.728ec3", + "wires": [ + [ + "63c730e0.c25018" + ] + ] + }, + { + "id": "63c730e0.c25018", + "type": "block", + "name": "block : atomic", + "xml": "<block atomic=\"true\">", + "atomic": "true", + "comments": "", + "outputs": 1, + "x": 143.32144165039062, + "y": 190.4286069869995, + "z": "143c1488.728ec3", + "wires": [ + [ + "5df07877.d41d48", + "317924e0.177cf4", + "66e86dab.782c14", + "fe9daa10.860a48", + "cd60dd04.3a49e" + ] + ] + }, + { + "id": "52295e06.9cc6c", + "type": "service-logic", + "name": "GENERIC-RESOURCE-API ${project.version}", + "module": "GENERIC-RESOURCE-API", + "version": "${project.version}", + "comments": "", + "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}'>", + "outputs": 1, + "x": 386.8571472167969, + "y": 46.42856693267822, + "z": "143c1488.728ec3", + "wires": [ + [ + "df5325d5.fd4748" + ] + ] + }, + { + "id": "5df07877.d41d48", + "type": "switchNode", + "name": "switch: ss.capability-name", + "xml": "<switch test='`$ss.capability-name`'>\n", + "comments": "", + "outputs": 1, + "x": 401.4999694824219, + "y": 194.25000858306885, + "z": "143c1488.728ec3", + "wires": [ + [ + "1172f991.e8e1ce" + ] + ] + }, + { + "id": "1172f991.e8e1ce", + "type": "outcome", + "name": "NULL", + "xml": "<outcome value=''>", + "outputs": 1, + "x": 626.4999923706055, + "y": 194.75000715255737, + "z": "143c1488.728ec3", + "wires": [ + [ + "788ea450.d0af24" + ] + ] + }, + { + "id": "788ea450.d0af24", + "type": "returnFailure", + "name": "return failure", + "xml": "<return status=\"failure\">\n\t<parameter name=\"ack-final\" value=\"Y\" />\n\t<parameter name=\"error-code\" value=\"500\"/>\n\t<parameter name=\"error-message\" value=\"ss.capability-name is null\" />\n", + "comments": "", + "x": 786.4166641235352, + "y": 194.86110591888428, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "317924e0.177cf4", + "type": "switchNode", + "name": "switch: ss.capability-action", + "xml": "<switch test='`$ss.capability-action`'>\n", + "comments": "", + "outputs": 1, + "x": 404.74996185302734, + "y": 270.25000381469727, + "z": "143c1488.728ec3", + "wires": [ + [ + "ef7a453e.505a28" + ] + ] + }, + { + "id": "ef7a453e.505a28", + "type": "outcome", + "name": "NULL", + "xml": "<outcome value=''>", + "comments": "", + "outputs": 1, + "x": 628.2499618530273, + "y": 270.50000381469727, + "z": "143c1488.728ec3", + "wires": [ + [ + "2cd2be60.fa73d2" + ] + ] + }, + { + "id": "2cd2be60.fa73d2", + "type": "returnFailure", + "name": "return failure", + "xml": "<return status=\"failure\">\n\t<parameter name=\"ack-final\" value=\"Y\" />\n\t<parameter name=\"error-code\" value=\"500\"/>\n\t<parameter name=\"error-message\" value=\"ss.capability-action is null\" />\n", + "comments": "", + "x": 788.166633605957, + "y": 270.61110258102417, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "dd9f2f74.302358", + "type": "outcome", + "name": "unassign", + "xml": "<outcome value='unassign'>", + "comments": "", + "outputs": 1, + "x": 908.8930053710938, + "y": 1550.9286060333252, + "z": "143c1488.728ec3", + "wires": [ + [ + "d2384164.43d4b8" + ] + ] + }, + { + "id": "fe9daa10.860a48", + "type": "call", + "name": "call self-service-capability-param-resolution", + "xml": "<call module='GENERIC-RESOURCE-API' rpc='self-service-capability-param-resolution' mode='sync' >\n", + "comments": "", + "outputs": 1, + "x": 455.41680908203125, + "y": 345.250039100647, + "z": "143c1488.728ec3", + "wires": [ + [ + "6271ac3c.dbb524" + ] + ] + }, + { + "id": "6271ac3c.dbb524", + "type": "failure", + "name": "failure", + "xml": "<outcome value='failure'>\n", + "comments": "", + "outputs": 1, + "x": 759.6667060852051, + "y": 347.25004291534424, + "z": "143c1488.728ec3", + "wires": [ + [ + "6983c90c.9f085" + ] + ] + }, + { + "id": "6983c90c.9f085", + "type": "returnFailure", + "name": "return failure", + "xml": "<return status=\"failure\">\n\t<parameter name=\"ack-final\" value=\"Y\" />\n\t<parameter name=\"error-code\" value=\"500\"/>\n\t<parameter name=\"error-message\" value=\"`'Not all assignments are resolved' + $error-message`\" />\n", + "comments": "", + "x": 918.4166870117188, + "y": 347.250039100647, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "a1557c8b.0af52", + "type": "set", + "name": "set tmp.ss.param.capability-name", + "xml": "<set>\n<parameter name='tmp.ss.param.capability-name' \n\tvalue='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' />\n", + "comments": "", + "x": 918.5634307861328, + "y": 403.0317540168762, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "dcc3036b.be682", + "type": "for", + "name": "for pidx in param_length", + "xml": "<for index=\"pidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`\">", + "comments": "", + "outputs": 1, + "x": 628.7776565551758, + "y": 403.10322427749634, + "z": "143c1488.728ec3", + "wires": [ + [ + "ac1bc695.ba30f8", + "a1557c8b.0af52", + "a8c879d0.2e224" + ] + ] + }, + { + "id": "ac1bc695.ba30f8", + "type": "switchNode", + "name": "switch: capability-name - ss vs param", + "xml": "<switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'>\n", + "comments": "", + "outputs": 1, + "x": 931.6388931274414, + "y": 484.3810067176819, + "z": "143c1488.728ec3", + "wires": [ + [ + "95d45cef.739a4" + ] + ] + }, + { + "id": "95d45cef.739a4", + "type": "outcomeTrue", + "name": "true", + "xml": "<outcome value='true'>\n", + "comments": "", + "outputs": 1, + "x": 1170.388900756836, + "y": 484.1310067176819, + "z": "143c1488.728ec3", + "wires": [ + [ + "58a7e2ac.369edc" + ] + ] + }, + { + "id": "ae0c0642.b8f398", + "type": "switchNode", + "name": "switch: resource-key[].name", + "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'>\n", + "comments": "", + "outputs": 1, + "x": 1357.778221130371, + "y": 804.4249711036682, + "z": "143c1488.728ec3", + "wires": [ + [ + "30dba812.eebad", + "9ccc6ec3.307098", + "17e282ca.caa0c5", + "79d8a08e.f34778", + "a090c1a0.159c8" + ] + ] + }, + { + "id": "9ccc6ec3.307098", + "type": "outcome", + "name": "service-instance-id", + "xml": "<outcome value='service-instance-id'>\n", + "comments": "", + "outputs": 1, + "x": 1629.1671295166016, + "y": 803.897189617157, + "z": "143c1488.728ec3", + "wires": [ + [ + "c862bfff.9602c" + ] + ] + }, + { + "id": "c862bfff.9602c", + "type": "set", + "name": "set tmp.ss.service-instance-id", + "xml": "<set>\n<parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", + "comments": "", + "x": 1895.4171295166016, + "y": 803.647189617157, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "ae459d03.790da", + "type": "set", + "name": "set service-data...param[].value = ip-address", + "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' \n\tvalue='`$self_serve_netbox_ip_assignement.ip-address`' />\n", + "comments": "", + "x": 2387.3892211914062, + "y": 1346.746416091919, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "e576077c.d41a68", + "type": "for", + "name": "for pidx in param_length", + "xml": "<for index=\"pidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`\">", + "comments": "", + "outputs": 1, + "x": 1363.7142944335938, + "y": 1345.6789722442627, + "z": "143c1488.728ec3", + "wires": [ + [ + "b57441f1.40176" + ] + ] + }, + { + "id": "b57441f1.40176", + "type": "switchNode", + "name": "switch: param[].name", + "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>\n", + "comments": "", + "outputs": 1, + "x": 1609.4920043945312, + "y": 1345.4289112091064, + "z": "143c1488.728ec3", + "wires": [ + [ + "afe763c2.be4ad" + ] + ] + }, + { + "id": "8b2de334.ba017", + "type": "block", + "name": "block", + "xml": "<block>\n", + "atomic": "false", + "comments": "", + "outputs": 1, + "x": 2117.5001945495605, + "y": 1347.6076221466064, + "z": "143c1488.728ec3", + "wires": [ + [ + "ae459d03.790da", + "2123959.27e4fea" + ] + ] + }, + { + "id": "bd927868.04ca28", + "type": "update", + "name": "get-resource IPAM_IP_ASSIGNEMENT", + "xml": "<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey='SELECT * from IPAM_IP_ASSIGNEMENT \n\t\tWHERE external_key = $tmp.ss.external-key\n\t\tAND service_instance_id = $tmp.ss.service-instance-id' >", + "comments": "", + "outputs": 1, + "x": 1384.3770751953125, + "y": 1549.7500171661377, + "z": "143c1488.728ec3", + "wires": [ + [ + "97c050e3.e78ef8", + "fcaae989.8a065" + ] + ] + }, + { + "id": "97c050e3.e78ef8", + "type": "not-found", + "name": "not-found", + "xml": "<outcome value='not-found'>\n", + "comments": "", + "outputs": 1, + "x": 1678.964412689209, + "y": 1550.7500503063202, + "z": "143c1488.728ec3", + "wires": [ + [ + "e707327c.c14c1" + ] + ] + }, + { + "id": "e707327c.c14c1", + "type": "block", + "name": "block", + "xml": "<block>\n", + "atomic": "false", + "comments": "", + "outputs": 1, + "x": 1849.1072213309153, + "y": 1551.1786281040736, + "z": "143c1488.728ec3", + "wires": [ + [] + ] + }, + { + "id": "fcaae989.8a065", + "type": "success", + "name": "success", + "xml": "<outcome value='success'>\n", + "comments": "", + "outputs": 1, + "x": 1675.6785583496094, + "y": 1598.4643630981445, + "z": "143c1488.728ec3", + "wires": [ + [ + "1905e389.47be1c" + ] + ] + }, + { + "id": "d2384164.43d4b8", + "type": "block", + "name": "block : atomic", + "xml": "<block atomic=\"true\">", + "atomic": "true", + "outputs": 1, + "x": 1078.214370727539, + "y": 1551.3929615020752, + "z": "143c1488.728ec3", + "wires": [ + [ + "bd927868.04ca28", + "8b0e1626.d5a95" + ] + ] + }, + { + "id": "dd1d0acb.f3d9f", + "type": "for", + "name": "for kidx in resource-key_length", + "xml": "<for index=\"kidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`\">", + "comments": "", + "outputs": 1, + "x": 1074.639305114746, + "y": 802.2860550880432, + "z": "143c1488.728ec3", + "wires": [ + [ + "ae0c0642.b8f398" + ] + ] + }, + { + "id": "cd60dd04.3a49e", + "type": "block", + "name": "block", + "xml": "<block>\n", + "atomic": "false", + "comments": "", + "outputs": 1, + "x": 345.03570556640625, + "y": 401.22620487213135, + "z": "143c1488.728ec3", + "wires": [ + [ + "dcc3036b.be682", + "8f13f8ba.2b7f7" + ] + ] + }, + { + "id": "66e86dab.782c14", + "type": "execute", + "name": "printContext", + "xml": "<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >\n<parameter name='filename' value='/var/tmp/ss.eipam.log' />\n", + "comments": "", + "outputs": 1, + "x": 143.5833740234375, + "y": 1909.6664819717407, + "z": "143c1488.728ec3", + "wires": [ + [] + ] + }, + { + "id": "178de813.ea0878", + "type": "update", + "name": "update IPAM_IP_ASSIGNEMENT to PENDING_DELETE...", + "xml": "<update plugin=\"org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource\" resource=\"SQL\"\n\tkey=\"UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status \n\t\tWHERE external_key = $tmp.ss.external-key\n\t\tAND service_instance_id = $tmp.ss.service-instance-id\" >", + "comments": "", + "outputs": 1, + "x": 2207.2740478515625, + "y": 1641.4287281036377, + "z": "143c1488.728ec3", + "wires": [ + [ + "22ea54b4.9a4a5c" + ] + ] + }, + { + "id": "c8aa945e.cb553", + "type": "set", + "name": "set status = PENDING_DELETE", + "xml": "<set>\n<parameter name='tmp.status' value=\"PENDING_DELETE\" />\n", + "comments": "", + "x": 2117.1905517578125, + "y": 1599.7619800567627, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "22ea54b4.9a4a5c", + "type": "failure", + "name": "failure", + "xml": "<outcome value='failure'>\n", + "comments": "", + "outputs": 1, + "x": 2514.9405059814453, + "y": 1642.0120515823364, + "z": "143c1488.728ec3", + "wires": [ + [ + "29d7a55a.db16a2" + ] + ] + }, + { + "id": "29d7a55a.db16a2", + "type": "returnFailure", + "name": "return failure", + "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 NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`\" />\n", + "comments": "", + "x": 2693.9407958984375, + "y": 1641.8216724395752, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "e13d8645.38dff8", + "type": "execute", + "name": "execute Netbox unassign IP addresses", + "xml": "<execute plugin=\"org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient\" method=\"unassignIpAddress\">\n<parameter name=\"service_instance_id\" value=\"`$tmp.ss.service-instance-id`\" />\n<parameter name=\"external_key\" value=\"`$tmp.ss.external-key`\" />", + "comments": "", + "outputs": 1, + "x": 2137.27392578125, + "y": 1687.678789138794, + "z": "143c1488.728ec3", + "wires": [ + [ + "8a2f8559.485e" + ] + ] + }, + { + "id": "8a2f8559.485e", + "type": "failure", + "name": "failure", + "xml": "<outcome value='failure'>\n", + "comments": "", + "outputs": 1, + "x": 2380.607192993164, + "y": 1687.6787385940552, + "z": "143c1488.728ec3", + "wires": [ + [ + "745a09ce.fc0c18" + ] + ] + }, + { + "id": "745a09ce.fc0c18", + "type": "returnFailure", + "name": "return failure", + "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 in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`\" />\n", + "comments": "", + "x": 2542.607219696045, + "y": 1687.488473892212, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "1905e389.47be1c", + "type": "block", + "name": "block : atomic", + "xml": "<block atomic=\"true\">", + "atomic": "true", + "outputs": 1, + "x": 1857.8929595947266, + "y": 1599.1786079406738, + "z": "143c1488.728ec3", + "wires": [ + [ + "c8aa945e.cb553", + "178de813.ea0878", + "e13d8645.38dff8" + ] + ] + }, + { + "id": "8f13f8ba.2b7f7", + "type": "record", + "name": "record", + "xml": "<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder\">\n<parameter name=\"logger\" value=\"message-log\"/>\n<parameter name=\"field1\" value=\"__TIMESTAMP__\"/>\n<parameter name=\"field2\" value=\"`'SS: pidx: ' + $pidx`\"/>\n", + "comments": "", + "outputs": 1, + "x": 580.84130859375, + "y": 458.170693397522, + "z": "143c1488.728ec3", + "wires": [ + [] + ] + }, + { + "id": "30dba812.eebad", + "type": "outcome", + "name": "vf-module-id", + "xml": "<outcome value='vf-module-id'>\n", + "comments": "", + "outputs": 1, + "x": 1611.0001373291016, + "y": 850.1471285820007, + "z": "143c1488.728ec3", + "wires": [ + [ + "c1e7f26f.85c74" + ] + ] + }, + { + "id": "c1e7f26f.85c74", + "type": "set", + "name": "set tmp.ss.vf-module-id", + "xml": "<set>\n<parameter name='tmp.ss.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", + "comments": "", + "x": 1877.000259399414, + "y": 850.1471285820007, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "8b0e1626.d5a95", + "type": "for", + "name": "for pidx in param_length", + "xml": "<for index=\"pidx\" start=\"0\" end=\"`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`\">", + "comments": "", + "outputs": 1, + "x": 1345.6429443359375, + "y": 1789.9999961853027, + "z": "143c1488.728ec3", + "wires": [ + [ + "81010aef.f49a18" + ] + ] + }, + { + "id": "81010aef.f49a18", + "type": "switchNode", + "name": "switch: param[].name", + "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'>\n", + "comments": "", + "outputs": 1, + "x": 1593.6429443359375, + "y": 1789.7499961853027, + "z": "143c1488.728ec3", + "wires": [ + [ + "e1dfefe2.393f88" + ] + ] + }, + { + "id": "e1dfefe2.393f88", + "type": "outcome", + "name": "ip-address", + "xml": "<outcome value='ip-address'>", + "comments": "", + "outputs": 1, + "x": 1838.178695678711, + "y": 1789.9285697937012, + "z": "143c1488.728ec3", + "wires": [ + [ + "e87a20cc.b590a8" + ] + ] + }, + { + "id": "e87a20cc.b590a8", + "type": "set", + "name": "set resource-resolution-data.status = DELETED", + "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' \n\tvalue='DELETED' />\n", + "comments": "", + "x": 2160.3572998046875, + "y": 1790.1429615020752, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "17e282ca.caa0c5", + "type": "outcome", + "name": "prefix-id", + "xml": "<outcome value='prefix-id'>\n", + "comments": "", + "outputs": 1, + "x": 1600.0558013916016, + "y": 894.3971590995789, + "z": "143c1488.728ec3", + "wires": [ + [ + "d72c0767.d2203" + ] + ] + }, + { + "id": "d72c0767.d2203", + "type": "set", + "name": "set prefix-id", + "xml": "<set>\n<parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", + "comments": "", + "x": 1846.5558013916016, + "y": 894.6471285820007, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "e8bdbae6.040f1", + "type": "execute", + "name": "execute NetboxClient assignIpAddress", + "xml": "<execute plugin=\"org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient\" method=\"assignIpAddress\">\n<parameter name=\"service_instance_id\" value=\"`$tmp.ss.service-instance-id`\" />\n<parameter name=\"vf_module_id\" value=\"`$tmp.ss.vf-module-id`\" />\n<parameter name=\"prefix_id\" value=\"`$tmp.ss.prefix-id`\" />\n<parameter name=\"resource_name\" value=\"`$tmp.ss.param.name`\" />\n<parameter name=\"external_key\" value=\"`$tmp.ss.external-key`\" />", + "comments": "", + "outputs": 1, + "x": 1381.9525756835938, + "y": 1208.9170093536377, + "z": "143c1488.728ec3", + "wires": [ + [ + "6e70c100.8f1ee" + ] + ] + }, + { + "id": "6e70c100.8f1ee", + "type": "failure", + "name": "failure", + "xml": "<outcome value='failure'>\n", + "comments": "", + "outputs": 1, + "x": 1698.9525756835938, + "y": 1210.9169483184814, + "z": "143c1488.728ec3", + "wires": [ + [ + "1439cf99.003e9" + ] + ] + }, + { + "id": "1439cf99.003e9", + "type": "block", + "name": "block : atomic", + "xml": "<block atomic='true'>", + "atomic": "true", + "comments": "", + "outputs": 1, + "x": 1906.9525756835938, + "y": 1214.9169483184814, + "z": "143c1488.728ec3", + "wires": [ + [ + "2738f77e.bc5c7", + "663a6846.85cae8" + ] + ] + }, + { + "id": "2738f77e.bc5c7", + "type": "set", + "name": "set resource-resolution-data.status = FAILED", + "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' />\n", + "comments": "", + "x": 2223.95263671875, + "y": 1218.9169178009033, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "663a6846.85cae8", + "type": "returnFailure", + "name": "return failure", + "xml": "<return status='failure'>\n<parameter name='error-code' value='' />\n<parameter name='error-message' value='' />\n", + "comments": "", + "x": 2125.6190795898438, + "y": 1272.8058032989502, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "2123959.27e4fea", + "type": "set", + "name": "set resource-resolution-data.status = SUCCESS", + "xml": "<set>\n<parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' \n\tvalue='SUCCESS' />\n", + "comments": "", + "x": 2408.750160217285, + "y": 1404.6076169013977, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "79d8a08e.f34778", + "type": "outcome", + "name": "ip-address-id", + "xml": "<outcome value='ip-address-id'>\n", + "comments": "", + "outputs": 1, + "x": 1613.9369506835938, + "y": 939.2542328834534, + "z": "143c1488.728ec3", + "wires": [ + [ + "e3ef613a.32a62" + ] + ] + }, + { + "id": "e3ef613a.32a62", + "type": "set", + "name": "ip-address-id", + "xml": "<set>\n<parameter name='tmp.ss.ip-address-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", + "comments": "", + "x": 1848.9368286132812, + "y": 939.2542939186096, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "a090c1a0.159c8", + "type": "outcome", + "name": "external_key", + "xml": "<outcome value='external_key'>\n", + "comments": "", + "outputs": 1, + "x": 1601.5559692382812, + "y": 984.9685273170471, + "z": "143c1488.728ec3", + "wires": [ + [ + "5e668590.73215c" + ] + ] + }, + { + "id": "5e668590.73215c", + "type": "set", + "name": "set external-key", + "xml": "<set>\n<parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' />\n", + "comments": "", + "x": 1850.1273803710938, + "y": 984.9685883522034, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "afe763c2.be4ad", + "type": "outcome", + "name": "tmp.ss.param.name", + "xml": "<outcome value='`$tmp.ss.param.name`'>\n", + "comments": "", + "outputs": 1, + "x": 1894.7621459960938, + "y": 1346.7146167755127, + "z": "143c1488.728ec3", + "wires": [ + [ + "8b2de334.ba017" + ] + ] + }, + { + "id": "a8c879d0.2e224", + "type": "set", + "name": "set tmp.ss.param.name", + "xml": "<set>\n<parameter name='tmp.ss.param.name' \n\tvalue='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`' />\n", + "comments": "", + "x": 890.3493728637695, + "y": 443.2222390174866, + "z": "143c1488.728ec3", + "wires": [] + }, + { + "id": "58a7e2ac.369edc", + "type": "switchNode", + "name": "switch: resource-resolution-data.status", + "xml": "<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'>\n", + "comments": "", + "outputs": 1, + "x": 430.2855224609375, + "y": 779.1906518936157, + "z": "143c1488.728ec3", + "wires": [ + [ + "9a3a9127.28a32", + "1a31fbda.d127d4" + ] + ] + }, + { + "id": "9a3a9127.28a32", + "type": "not-found", + "name": "FAILED", + "xml": "<outcome value='FAILED'>\n", + "comments": "", + "outputs": 1, + "x": 661.7143249511719, + "y": 775.1906976699829, + "z": "143c1488.728ec3", + "wires": [ + [ + "b5c2d57.1e7f9a8" + ] + ] + }, + { + "id": "1a31fbda.d127d4", + "type": "success", + "name": "PENDING", + "xml": "<outcome value='PENDING'>\n", + "comments": "", + "outputs": 1, + "x": 668.4285011291504, + "y": 826.9050257205963, + "z": "143c1488.728ec3", + "wires": [ + [ + "b5c2d57.1e7f9a8" + ] + ] + }, + { + "id": "b5c2d57.1e7f9a8", + "type": "block", + "name": "block", + "xml": "<block>\n", + "atomic": "false", + "comments": "", + "outputs": 1, + "x": 823.142822265625, + "y": 799.190712928772, + "z": "143c1488.728ec3", + "wires": [ + [ + "dd1d0acb.f3d9f", + "1ab3438e.44fb7c" + ] + ] + }, + { + "id": "efe3d3a6.f63418", + "type": "outcome", + "name": "assign", + "xml": "<outcome value='assign'>", + "comments": "", + "outputs": 1, + "x": 880.9999389648438, + "y": 1207.0002613067627, + "z": "143c1488.728ec3", + "wires": [ + [ + "f69c94df.b1d828" + ] + ] + }, + { + "id": "1ab3438e.44fb7c", + "type": "switchNode", + "name": "switch: ss.capability-action", + "xml": "<switch test='`$ss.capability-action`'>\n", + "comments": "", + "outputs": 1, + "x": 644.9999389648438, + "y": 1205.0002613067627, + "z": "143c1488.728ec3", + "wires": [ + [ + "efe3d3a6.f63418", + "dd9f2f74.302358" + ] + ] + }, + { + "id": "f69c94df.b1d828", + "type": "block", + "name": "block : atomic", + "xml": "<block atomic='true'>", + "atomic": "true", + "comments": "", + "outputs": 1, + "x": 1056.4285888671875, + "y": 1207.857500076294, + "z": "143c1488.728ec3", + "wires": [ + [ + "e8bdbae6.040f1", + "e576077c.d41a68" + ] + ] + } ]
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/resources/graph.versions b/platform-logic/generic-resource-api/src/main/resources/graph.versions index 1a9fb89d..52fe79c6 100755 --- a/platform-logic/generic-resource-api/src/main/resources/graph.versions +++ b/platform-logic/generic-resource-api/src/main/resources/graph.versions @@ -114,6 +114,7 @@ GENERIC-RESOURCE-API self-serve-eipam-ip-assignment ${project.version} sync GENERIC-RESOURCE-API self-serve-generate-FQPN ${project.version} sync GENERIC-RESOURCE-API self-serve-generate-name ${project.version} sync GENERIC-RESOURCE-API self-serve-mac-address-assign ${project.version} sync +GENERIC-RESOURCE-API self-serve-netbox-ip-assignment ${project.version} sync GENERIC-RESOURCE-API self-serve-unresolved-composite-data ${project.version} sync GENERIC-RESOURCE-API self-serve-vf-module-assign ${project.version} sync GENERIC-RESOURCE-API self-serve-vfmodule-ra-assignment ${project.version} sync diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.xml new file mode 100644 index 00000000..167ab43e --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_self-serve-netbox-ip-assignment.xml @@ -0,0 +1,311 @@ +<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}'> + <method rpc='self-serve-netbox-ip-assignment' mode='sync'> + <block atomic="true"> + <switch test='`$ss.capability-name`'> + <outcome value=''> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="ss.capability-name is null" /> + </return> + </outcome> + </switch> + <switch test='`$ss.capability-action`'> + <outcome value=''> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="ss.capability-action is null" /> + </return> + </outcome> + </switch> + <call module='GENERIC-RESOURCE-API' rpc='self-service-capability-param-resolution' mode='sync' > + <outcome value='failure'> + <return status="failure"> + <parameter name="ack-final" value="Y" /> + <parameter name="error-code" value="500"/> + <parameter name="error-message" value="`'Not all assignments are resolved' + $error-message`" /> + </return> + </outcome> + </call> + <block> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <set> + <parameter name='tmp.ss.param.capability-name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.capability-name`' /> + </set> + <set> + <parameter name='tmp.ss.param.name' + value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`' /> + </set> + <switch test='`$tmp.ss.param.capability-name == $ss.capability-name`'> + <outcome value='true'> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status`'> + <outcome value='FAILED'> + <block> + <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'> + <outcome value='service-instance-id'> + <set> + <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='vf-module-id'> + <set> + <parameter name='tmp.ss.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='prefix-id'> + <set> + <parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='ip-address-id'> + <set> + <parameter name='tmp.ss.ip-address-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='external_key'> + <set> + <parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + </switch> + </for> + <switch test='`$ss.capability-action`'> + <outcome value='assign'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vf-module-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + </execute> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'> + <outcome value='`$tmp.ss.param.name`'> + <block> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' + value='`$self_serve_netbox_ip_assignement.ip-address`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from IPAM_IP_ASSIGNEMENT + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id' > + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.status' value="PENDING_DELETE" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error updating NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" /> + </return> + </outcome> + </update> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="unassignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`" /> + </return> + </outcome> + </execute> + </block> + </outcome> + </get-resource> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'> + <outcome value='ip-address'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='DELETED' /> + </set> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='PENDING'> + <block> + <for index="kidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].name`'> + <outcome value='service-instance-id'> + <set> + <parameter name='tmp.ss.service-instance-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='vf-module-id'> + <set> + <parameter name='tmp.ss.vf-module-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='prefix-id'> + <set> + <parameter name='tmp.ss.prefix-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='ip-address-id'> + <set> + <parameter name='tmp.ss.ip-address-id' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + <outcome value='external_key'> + <set> + <parameter name='tmp.ss.external-key' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.resource-key[$kidx].value`' /> + </set> + </outcome> + </switch> + </for> + <switch test='`$ss.capability-action`'> + <outcome value='assign'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="assignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="vf_module_id" value="`$tmp.ss.vf-module-id`" /> + <parameter name="prefix_id" value="`$tmp.ss.prefix-id`" /> + <parameter name="resource_name" value="`$tmp.ss.param.name`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <block atomic='true'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' value='FAILED' /> + </set> + <return status='failure'> + <parameter name='error-code' value='' /> + <parameter name='error-message' value='' /> + </return> + </block> + </outcome> + </execute> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'> + <outcome value='`$tmp.ss.param.name`'> + <block> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].value' + value='`$self_serve_netbox_ip_assignement.ip-address`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='SUCCESS' /> + </set> + </block> + </outcome> + </switch> + </for> + </block> + </outcome> + <outcome value='unassign'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' + key='SELECT * from IPAM_IP_ASSIGNEMENT + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id' > + <outcome value='not-found'> + <block></block> + </outcome> + <outcome value='success'> + <block atomic="true"> + <set> + <parameter name='tmp.status' value="PENDING_DELETE" /> + </set> + <update plugin="org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource" resource="SQL" + key="UPDATE IPAM_IP_ASSIGNEMENT set ip_status = $tmp.status + WHERE external_key = $tmp.ss.external-key + AND service_instance_id = $tmp.ss.service-instance-id" > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error updating NETBOX_IP_ASSIGNMENTS table to unassign ip with external_key=' + $tmp.ss.external-key + ' and service_instance_id=' + $tmp.ss.service-instance-id`" /> + </return> + </outcome> + </update> + <execute plugin="org.onap.ccsdk.sli.adaptors.netbox.api.NetboxClient" method="unassignIpAddress"> + <parameter name="service_instance_id" value="`$tmp.ss.service-instance-id`" /> + <parameter name="external_key" value="`$tmp.ss.external-key`" /> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'Error in NetboxClient#unassignIPAddress with external-key='+ $tmp.ss.external-key`" /> + </return> + </outcome> + </execute> + </block> + </outcome> + </get-resource> + <for index="pidx" start="0" end="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`"> + <switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].name`'> + <outcome value='ip-address'> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param[$pidx].resource-resolution-data.status' + value='DELETED' /> + </set> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + </block> + </outcome> + </switch> + </outcome> + </switch> + </for> + <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder"> + <parameter name="logger" value="message-log"/> + <parameter name="field1" value="__TIMESTAMP__"/> + <parameter name="field2" value="`'SS: pidx: ' + $pidx`"/> + </record> + </block> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' > + <parameter name='filename' value='/var/tmp/ss.eipam.log' /> + </execute> + </block> + </method> +</service-logic>
\ No newline at end of file |