diff options
author | Marcus G K Williams <marcus.williams@intel.com> | 2017-11-13 14:02:05 -0800 |
---|---|---|
committer | Marcus G K Williams <marcus.williams@intel.com> | 2017-11-13 14:02:12 -0800 |
commit | 058e2a65a7a18a5914767a6fa16b0f84f692d85f (patch) | |
tree | b4248397460ee98714ea2a02dc6aa472a92a3754 /platform-logic/generic-resource-api/src/main/xml | |
parent | 17986b076be31cf96cd3223536edce004b6be4db (diff) |
Fix tunnelxconn create/delete ip bugs
1. Pull brg-wan-ip from dmaap DHCP_MAP
in sql database.
2. Pull vgmux-mgmt-ip from vnf-api
parent-instance
3. Add and activate
get-vnf-api-parent-instance DG
to facilitate pulling of vgmux-mgmt-ip
Issue-Id: SDNC-190
Change-Id: I9d0805b56de4b2aafee1c83c8966a8f4bb324ee3
Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Former-commit-id: 0459370c8aa73aecd1de4cd3fe77db589db93c95
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
3 files changed, 66 insertions, 4 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml new file mode 100644 index 00000000..d03a1c30 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-vnf-api-parent-instance.xml @@ -0,0 +1,28 @@ +<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='get-vnf-api-parent-instance' mode='sync'> + <block atomic="true"> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs' pfx='tmp.vnfdata' ></get-resource> + <for index='vnfidx' start='0' end='`$tmp.vnfdata.vnfs.vnf-list_length`' > + <switch test='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.service-information.service-instance-id == $tmp.search.parent-service-instance-id`'> + <outcome value='true'> + <block> + <set> + <parameter name='tmp.old-service-data.vnf-id' value='`$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.vnf-id`' /> + </set> + <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='VNF-API' key='vnfs/vnf-list/$tmp.vnfdata.vnfs.vnf-list[$vnfidx].service-data.vnf-id/service-data/' pfx='parent-service-instance' > + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" + value="`'No entry found for parent service instance id ' + $tmp.ar.parent-service-instance-id + '.'`" /> + </return> + </outcome> + </get-resource> + </block> + </outcome> + </switch> + </for> + </block> + </method> +</service-logic>
\ No newline at end of file diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml index bc93bea0..64ae95e8 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-create.xml @@ -105,15 +105,32 @@ </return>
</outcome>
</execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
<set>
<parameter name='tmp.tunnel-vgMUX-vG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
- <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.brg-wan-ip-address` " />
+ <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
+ </set>
+ <set>
+ <parameter name='tmp.search.parent-service-instance-id' value='`$tmp.ar.parent-service-instance-id`' />
</set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' ></call>
+ <for index='paramidx' start='0' end='`$parent-service-instance.vnf-topology-information.vnf-parameters_length`' >
+ <switch test='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$prop.honeycomb.url`"/>
<parameter name="outputPath" value="tmp.honeycomb.url"/>
<parameter name="target" value="{honeycomb-instance-ip}"/>
- <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip`"/>
+ <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip`"/>
</execute>
<set>
<parameter name='tmp.tunnel-name' value="`$tmp.tunnel-vgMUX-vG-name` " />
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml index 8dbd34e1..d70fb608 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_tunnelxconn-topology-operation-delete.xml @@ -108,15 +108,32 @@ </return>
</outcome>
</execute>
+ <set>
+ <parameter name='tmp.search.parent-service-instance-id' value='`$tmp.ar.parent-service-instance-id`' />
+ </set>
+ <call module='GENERIC-RESOURCE-API' rpc='get-vnf-api-parent-instance' mode='sync' ></call>
+ <for index='paramidx' start='0' end='`$parent-service-instance.vnf-topology-information.vnf-parameters_length`' >
+ <switch test='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-name == vgmux_private_ip_1`'>
+ <outcome value='true'>
+ <set>
+ <parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip' value='`$parent-service-instance.vnf-topology-information.vnf-parameters[$paramidx].vnf-parameter-value`' />
+ </set>
+ </outcome>
+ </switch>
+ </for>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$prop.honeycomb.url`"/>
<parameter name="outputPath" value="tmp.honeycomb.url"/>
<parameter name="target" value="{honeycomb-instance-ip}"/>
- <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-bearer-ip`"/>
+ <parameter name="replacement" value="`$tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vgmux-mgmt-ip`"/>
</execute>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='IPADDR' key="SELECT min(ip_addr) ip from DHCP_MAP where mac_addr = $tx-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.brg-wan-mac-address" pfx="tmp.brg-wan-ip" ></get-resource>
+ <set>
+ <parameter name='tunnelxconn-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip' value='`$tmp.brg-wan-ip.ip`' />
+ </set>
<set>
<parameter name='tmp.tunnel-vgMUX-vG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vg-ip` " />
- <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.brg-wan-ip-address` " />
+ <parameter name='tmp.tunnel-vgMUX-vBRG-name' value="`'vxlanTun' + $tx-ar.allotted-resource-data.tunnelxconn-topology.tunnelxconn-assignments.vbrg-wan-ip` " />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$prop.restapi.vpp-honeycomb`"/>
|