diff options
author | Dan Timoney <dt5972@att.com> | 2018-07-25 14:48:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-25 14:48:39 +0000 |
commit | aef640f821dce11b1182ecbf48a78f5b26a1c4c3 (patch) | |
tree | d03228466e52aad205f9192863a08911cf2181d3 /platform-logic/generic-resource-api/src/main/xml | |
parent | 8f7cf1ed2c18431bb2ed4b4ef8c96dd5c1692a7a (diff) | |
parent | bb17c401f713e29f652ac49ff8633b829604c40b (diff) |
Merge "Adding site Resource DG"
Former-commit-id: 027c60e3bbcc371552af20947aec15a622d4daab
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
6 files changed, 690 insertions, 65 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml new file mode 100644 index 00000000..0078f07d --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-activate.xml @@ -0,0 +1,149 @@ +<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='site-vnf-topology-operation-activate' mode='sync'> + <block atomic="true"> + <switch test='`$service-data.vnfs.vnf_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' > + <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.vidx' value='`$vidx`' /> + <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.vidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <set> + <parameter name='tmp.sdwan.site' value='false' /> + </set> + <for index='idx' start='0' end='`$ctx.vnf-data.vnf-request-input.vnf-input-parameters.param_length`' > + <block> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'id'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.id' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'name'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'description'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.description' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'location'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.location' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'type'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.type' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + <parameter name='tmp.sdwan.site' value='true' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'role'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.role' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + <parameter name='tmp.sdwan.site' value='true' /> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.sdwan.site`"> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <block atomic="true"></block> + </outcome> + </switch> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-index`' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Active' /> + <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`' /> + <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`' /> + </set> + <set> + <parameter name='vnfId' value='`$prop.vnf-index`' /> + <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-index + '/vnf-data/'` " /> + </set> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='generic-vnf' + key='generic-vnf.vnf-id = $prop.vnf-index' > + <parameter name='vnf-id' value='`$prop.vnf-index`' /> + <parameter name='in-maint' value='true' /> + <parameter name='is-closed-loop-disabled' value='false' /> + <parameter name='orchestration-status' value='Active' /> + <parameter name='operational-status' value='Active' /> + <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' /> + <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' /> + <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' /> + <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-index + '/vnf-data/'` " /> + </update> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list' + key='service-instance.service-instance-id = $service-data.service-information.service-instance-id + AND customer.global-customer-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.global-customer-id + AND service-subscription.service-type = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.subscription-service-type' + force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $prop.vnf-index`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.vnf-index`" /> + </save> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml new file mode 100644 index 00000000..ab728d7c --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-create.xml @@ -0,0 +1,137 @@ +<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='site-vnf-topology-operation-create' mode='sync'> + <block atomic="true"> + <for index="idx" start="0" end="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param_length`"> + <block> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'id'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.id' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'name'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'description'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.description' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'location'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.location' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'type'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.type' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'role'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.role' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + </block> + </for> + <switch test='`$service-data.vnfs.vnf_length`'> + <outcome value=''> + <set> + <parameter name='vnf-index' value='0' /> + </set> + </outcome> + <outcome value='Other'> + <block> + <set> + <parameter name='vnf-index' value='`$service-data.vnfs.vnf_length`' /> + </set> + <for index='idx' start='0' end='`$service-data.vnfs.vnf_length`' > + <switch test='`$vnf-topology-operation-input.vnf-information.vnf-id == $service-data.vnfs.vnf[$idx].vnf-id`'> + <outcome value='true'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`'VNF id ' + $service-data.vnfs.vnf[$idx].vnf-id + + ' already exists, and has order status ' + $service-data.vnfs.vnf[$idx].vnf-data.vnf-level-oper-status.order-status`" /> + </return> + </outcome> + </switch> + </for> + </block> + </outcome> + </switch> + <set> + <parameter name='service-data.vnfs.vnf_length' value='`$vnf-index + 1`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='generateUUID' > + <parameter name="ctx-destination" value="prop.vnf-index"/> + </execute> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-index`' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-request-input.' value='$vnf-topology-operation-input.vnf-request-input.' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.vnf-id' value='`$prop.vnf-index`' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='Created' /> + <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`' /> + <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`' /> + </set> + <set> + <parameter name='vnfId' value='`$prop.vnf-index`' /> + <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-index + '/vnf-data/'` " /> + </set> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='generic-vnf' + key='generic-vnf.vnf-id = $prop.vnf-index' > + <parameter name='vnf-id' value='`$prop.vnf-index`' /> + <parameter name='vnf-name' value='`$prop.site.name`' /> + <parameter name='vnf-name2' value='`$prop.site.description`' /> + <parameter name='regional-resource-zone' value='`$prop.site.location`' /> + <parameter name='vnf-type' value='prop.site.type' /> + <parameter name='in-maint' value='true' /> + <parameter name='is-closed-loop-disabled' value='false' /> + <parameter name='orchestration-status' value='Created' /> + <parameter name='operational-status' value='Created' /> + <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' /> + <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' /> + <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' /> + <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-index + '/vnf-data/'` " /> + </save> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list' + key='service-instance.service-instance-id = $service-data.service-information.service-instance-id + AND customer.global-customer-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.global-customer-id + AND service-subscription.service-type = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.subscription-service-type' + force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $prop.vnf-index`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.vnf-index`" /> + </save> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml new file mode 100644 index 00000000..373706fd --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-deactivate.xml @@ -0,0 +1,149 @@ +<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='site-vnf-topology-operation-deactivate' mode='sync'> + <block atomic="true"> + <switch test='`$service-data.vnfs.vnf_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' > + <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.vidx' value='`$vidx`' /> + <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.vidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <set> + <parameter name='tmp.sdwan.site' value='false' /> + </set> + <for index='idx' start='0' end='`$ctx.vnf-data.vnf-request-input.vnf-input-parameters.param_length`' > + <block> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'id'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.id' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'name'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.name' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'description'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.description' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'location'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.location' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'type'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.type' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + <parameter name='tmp.sdwan.site' value='true' /> + </set> + </outcome> + </switch> + <switch test="`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].name == 'role'`"> + <outcome value='true'> + <set> + <parameter name='prop.site.role' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$idx].value`' /> + <parameter name='tmp.sdwan.site' value='true' /> + </set> + </outcome> + </switch> + </block> + </for> + <switch test="`$tmp.sdwan.site`"> + <outcome value='false'> + <block></block> + </outcome> + <outcome value='true'> + <block atomic="true"></block> + </outcome> + </switch> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-id' value='`$prop.vnf-index`' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.sdnc-request-header.' value='$vnf-topology-operation-input.sdnc-request-header.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.request-information.' value='$vnf-topology-operation-input.request-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.' value='$vnf-topology-operation-input.service-information.' /> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.' value='$vnf-topology-operation-input.vnf-information.' /> + </set> + <set> + <parameter name='service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status' value='PendingDelete' /> + <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`' /> + <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`' /> + </set> + <set> + <parameter name='vnfId' value='`$prop.vnf-index`' /> + <parameter name="vnf-object-path" value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-index + '/vnf-data/'` " /> + </set> + <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='generic-vnf' + key='generic-vnf.vnf-id = $prop.vnf-index' > + <parameter name='vnf-id' value='`$prop.vnf-index`' /> + <parameter name='in-maint' value='true' /> + <parameter name='is-closed-loop-disabled' value='false' /> + <parameter name='orchestration-status' value='PendingDelete' /> + <parameter name='operational-status' value='PendingDelete' /> + <parameter name='model-customization-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`' /> + <parameter name='model-invariant-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-invariant-uuid`' /> + <parameter name='model-version-id' value='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-uuid`' /> + <parameter name='selflink' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/' + $vnf-topology-operation-input.service-information.service-instance-id + '/service-data/vnfs/vnf/' + $prop.vnf-index + '/vnf-data/'` " /> + </update> + <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list' + key='service-instance.service-instance-id = $service-data.service-information.service-instance-id + AND customer.global-customer-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.global-customer-id + AND service-subscription.service-type = $service-data.vnfs.vnf[$vnf-index].vnf-data.service-information.subscription-service-type' + force="true" pfx="tmp.AnAI-data"> + <parameter name="relationship-list.relationship[0].related-to" value="generic-vnf" /> + <parameter name="relationship-list.relationship[0].related-link" value="`'/network/generic-vnfs/generic-vnf/' + $prop.vnf-index`" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="generic-vnf.vnf-id" /> + <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$prop.vnf-index`" /> + </save> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml new file mode 100644 index 00000000..2bba7f30 --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_site-vnf-topology-operation-delete.xml @@ -0,0 +1,101 @@ +<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='site-vnf-topology-operation-delete' mode='sync'> + <block atomic="true"> + <switch test='`$service-data.vnfs.vnf_length`'> + <outcome value='0'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='vidx' start='0' end='`$service-data.vnfs.vnf_length`' > + <switch test="`$service-data.vnfs.vnf[$vidx].vnf-id == $vnf-topology-operation-input.vnf-information.vnf-id`"> + <outcome value='true'> + <set> + <parameter name='tmp.vidx' value='`$vidx`' /> + <parameter name='ctx.vnf-data.' value='`$service-data.vnfs.vnf[$vidx].`' /> + </set> + </outcome> + </switch> + </for> + <switch test="`$tmp.vidx`"> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-topology-operation-input.vnf-request-input.vnf-id not found in service-data" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + <switch test="`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-level-oper-status.order-status == 'PendingDelete'`"> + <outcome value='false'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Cannot delete a VNF in a Created state" /> + </return> + </outcome> + </switch> + <switch test="`$ctx.vnf-data.vf-modules.vf-module_length`"> + <outcome value='0'> + <block></block> + </outcome> + <outcome value=''> + <block></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="Cannot delete the VNF because there are VFs defined" /> + </return> + </outcome> + </switch> + <switch test='`$service-data.vnfs.vnf_length`'> + <outcome value='1'> + <set> + <parameter name="service-data.vnfs." value=""/> + </set> + </outcome> + <outcome value='Other'> + <block atomic="true"> + <for index='idx' start='`$vnf-index + 1`' end='`$service-data.vnfs.vnf_length`' > + <set> + <parameter name="$tmpidx" value="`$idx - 1`"/> + <parameter name="service-data.vnfs.vnf[$tmpidx]." value="$service-data.vnfs.vnf[$idx]." /> + </set> + </for> + <set> + <parameter name="service-data.vnfs.vnf[$service-data.vnfs.vnf_length-1]." value=""/> + </set> + <set> + <parameter name="service-data.vnfs.vnf_length" value="`$service-data.vnfs.vnf_length - 1`"/> + </set> + </block> + </outcome> + </switch> + <delete plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='generic-vnf' + key='generic-vnf.vnf-id = $prop.vnf-index' ></delete> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml index c9515f24..744ab373 100755..100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_validate-vnf-input.xml @@ -1,44 +1,77 @@ -<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='validate-vnf-input' mode='sync'>
-<block atomic="true"><switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.request-information.request-action`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="request-information.request-action is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.service-information.service-instance-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="service-information.service-instance-id is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.vnf-information.vnf-id`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-information.vnf-id is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<block atomic="true"><switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.vnf-request-input.tenant`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-information.vnf-request-input.tenant is a required input" />
-</return></outcome></switch><switch test='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'>
-<outcome value=''><return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="vnf-request-input.aic-cloud-region is a required input" />
-</return></outcome></switch></block></outcome></switch></block></method></service-logic> +<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='validate-vnf-input' mode='sync'> + <block atomic="true"> + <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-action is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-request-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="sdnc-request-header.svc-request-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$vnf-topology-operation-input.request-information.request-action`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="request-information.request-action is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$vnf-topology-operation-input.service-information.service-instance-id`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="service-information.service-instance-id is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <block atomic="true"> + <switch test='`$vnf-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-information.onap-model-information.model-customization-uuid is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$vnf-topology-operation-input.vnf-request-input.tenant`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-information.vnf-request-input.tenant is a required input" /> + </return> + </outcome> + </switch> + <switch test='`$vnf-topology-operation-input.vnf-request-input.aic-cloud-region`'> + <outcome value=''> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="vnf-request-input.aic-cloud-region is a required input" /> + </return> + </outcome> + </switch> + </block> + </outcome> + </switch> + </block> + </method> +</service-logic> diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml index 9f4ee0e6..669ed75d 100755..100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_vnf-topology-operation.xml @@ -1,21 +1,77 @@ -<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='vnf-topology-operation' mode='sync'>
-<block atomic="true"><call module='GENERIC-RESOURCE-API' rpc='validate-vnf-input' mode='sync' >
-</call><switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'>
-<outcome value='assign'>
-<call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign' mode='sync' >
-</call></outcome><outcome value='activate'>
-<call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-activate' mode='sync' >
-</call></outcome><outcome value='deactivate'>
-<call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-deactivate' mode='sync' >
-</call></outcome><outcome value='unassign'>
-<call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-unassign' mode='sync' >
-</call></outcome><outcome value='Other'>
-<return status='failure'>
- <parameter name='ack-final' value='Y'/>
- <parameter name="error-code" value="500" />
- <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" />
-</return></outcome></switch><return status='success'>
-<parameter name="ack-final-indicator" value="Y" />
-<parameter name="error-code" value="200" />
-<parameter name="error-message" value="`$error-message`" />
-</return></block></method></service-logic> +<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='vnf-topology-operation' mode='sync'> + <block atomic="true"> + <call module='GENERIC-RESOURCE-API' rpc='validate-vnf-input' mode='sync' ></call> + <switch test='`$vnf-topology-operation-input.sdnc-request-header.svc-action`'> + <outcome value='assign'> + <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-assign' mode='sync' ></call> + </outcome> + <outcome value='activate'> + <block atomic="true"> + <switch test='`$vnf-topology-operation-input.request-information.request-action`'> + <outcome value='ActivateSiteInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-activate' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-activate' mode='sync' ></call> + </outcome> + </switch> + </block> + </outcome> + <outcome value='deactivate'> + <block atomic="true"> + <switch test='`$vnf-topology-operation-input.request-information.request-action`'> + <outcome value='DeActivateSiteInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-deactivate' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-deactivate' mode='sync' ></call> + </outcome> + </switch> + </block> + </outcome> + <outcome value='unassign'> + <call module='GENERIC-RESOURCE-API' rpc='vnf-topology-operation-unassign' mode='sync' ></call> + </outcome> + <outcome value='create'> + <block atomic="true"> + <switch test='`$vnf-topology-operation-input.request-information.request-action`'> + <outcome value='CreateSiteInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-create' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='delete'> + <block atomic="true"> + <switch test='`$vnf-topology-operation-input.request-information.request-action`'> + <outcome value='DeleteSiteInstance'> + <call module='GENERIC-RESOURCE-API' rpc='sotn-vnf-topology-operation-delete' mode='sync' ></call> + </outcome> + <outcome value='Other'> + <block></block> + </outcome> + </switch> + </block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="error-code" value="500" /> + <parameter name="error-message" value="`$vnf-topology-operation-input.sdnc-request-header.svc-action + ' is not a valid svc-action'`" /> + </return> + </outcome> + </switch> + <return status='success'> + <parameter name="ack-final-indicator" value="Y" /> + <parameter name="error-code" value="200" /> + <parameter name="error-message" value="`$error-message`" /> + </return> + </block> + </method> +</service-logic> |