2 xmlns='http://www.onap.org/sdnc/svclogic'
\r
3 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
4 <method rpc='vnf-topology-operation-changeassign' mode='sync'>
\r
5 <block atomic="true">
\r
6 <switch test='`$vnf-topology-operation-input.request-information.request-action`'>
\r
7 <outcome value='CreateVnfInstance'>
\r
10 <outcome value='Other'>
\r
11 <return status='failure'>
\r
12 <parameter name='ack-final' value='Y'/>
\r
13 <parameter name="error-code" value="500" />
\r
14 <parameter name="error-message" value="If svc-action is 'changeassign' then request-action must be 'CreateVnfInstance'" />
\r
18 <switch test='`$service-data.vnfs.vnf_length`'>
\r
20 <return status='failure'>
\r
21 <parameter name='ack-final' value='Y'/>
\r
22 <parameter name="error-code" value="404" />
\r
23 <parameter name="error-message" value="There are no VNFs in MD-SAL" />
\r
27 <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' >
\r
28 <switch test='`$service-data.vnfs.vnf[$idx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`'>
\r
29 <outcome value='true'>
\r
31 <parameter name='vnf-index' value='`$idx`' />
\r
36 <switch test='`$vnf-index`'>
\r
38 <return status='failure'>
\r
39 <parameter name='ack-final' value='Y'/>
\r
40 <parameter name="error-code" value="404" />
\r
41 <parameter name="error-message" value="'Could not find VNF ' + $vnf-topology-operation-input.vnf-information.vnf-id + ' in MD-SAL'" />
\r
45 <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
\r
46 key='SELECT * from VF_MODEL WHERE customization_uuid = $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
\r
48 <outcome value='failure'>
\r
49 <return status='failure'>
\r
50 <parameter name='ack-final' value='Y'/>
\r
51 <parameter name="error-code" value="500" />
\r
52 <parameter name="error-message" value="Error reading VF_MODEL table" />
\r
55 <outcome value='not-found'>
\r
56 <return status='failure'>
\r
57 <parameter name='ack-final' value='Y'/>
\r
58 <parameter name="error-code" value="500" />
\r
59 <parameter name="error-message" value="`'No model found for VNF customization UUID ' + $vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
\r
64 <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.onap-model-information.'
\r
65 value='`$vnf-topology-operation-input.vnf-information.onap-model-information.`' />
\r
68 <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' />
\r
69 <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-rpc-action' value='`$vnf-topology-operation-input.sdnc-request-header.svc-action`' />
\r
70 <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.last-action' value='`$vnf-topology-operation-input.request-information.request-action`' />
\r
73 <parameter name='service-object-path'
\r
74 value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
\r
75 + $service-topology-operation-input.service-information.service-instance-id
\r
76 + '/service-data/service-topology/'`"/>
\r
78 <return status='success'></return>
\r