diff options
author | 2018-07-26 18:10:42 +0000 | |
---|---|---|
committer | 2018-07-26 18:10:42 +0000 | |
commit | 5a41e5c15bdbfba0e84e89e13bb06d9930988e77 (patch) | |
tree | 72fa804d3fc3f1e286e3c8e1209309e97a3ff528 /platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml | |
parent | 3b79de733187d2c1c9bccf626958a43bb06dbf2e (diff) |
Generic resource API DG catch up
Generic resource API DG catch up with several new capabilities
Change-Id: I6ba4a1716693a2fb0ba5314f60038277a50249a3
Issue-ID: SDNC-403
Signed-off-by: Brandon, Bruce (bb2697) <bb2697@att.com>
Former-commit-id: dd97cf829ce1c0b3bbb0e98e93a2e6619d945beb
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml')
-rwxr-xr-x | platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml new file mode 100755 index 00000000..07a0486e --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_get-complex-resource-service-model.xml @@ -0,0 +1,181 @@ +<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-complex-resource-service-model' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from COMPLEX_RESOURCE
+ WHERE customization_uuid = $get-complex-resource-service-model-input.customization-uuid'
+ pfx='db.complex-resource'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from ATTRIBUTE_VALUE_PAIR
+ WHERE resource_uuid = $db.complex-resource.uuid
+ and resource_type = $db.complex-resource.type'
+ pfx='db.av-pair'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No attribute found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.av-pair_length`' >
+ <block atomic='true'>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_function' `">
+ <outcome value='true'>
+ <set>
+ <parameter name='get-complex-resource-service-model-output.cr-function' value='`$db.sdn-circuit-req[$idx].attribute-value`' />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_role'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-role" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'cr_type'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.cr-type" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_function'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-function" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'network_collection_description'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-collection-description" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.sdn-circuit-req[$idx].attribute-name == 'subinterface_network_quantity'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subinterface-network-quantity" value="`$db.sdn-circuit-req[$idx].attribute-value`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from NETWORK_MODEL
+ WHERE complex_resource_uuid = $db.complex-resource.uuid'
+ pfx='db.network-model'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No network model found" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No network model found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='SELECT * from RESOURCE_POLICY_TO_TARGET_NODE_MAPPING
+ WHERE target_node_uuid = $db.network-model.uuid
+ AND target_node_customization_uuid = db.network-model.customization-uuid'
+ pfx='db.respoltargetnodemap' >
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="No resource_policy_to_target_node_mapping found" />
+ </return>
+ </outcome>
+ </get-resource>
+ <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key="SELECT * from RESOURCE_POLICY
+ WHERE policy_uuid = $db.respoltargetnodemap.policy_uuid
+ and policy_type = 'ecomp.policies.External' "
+ pfx='db.resource-policy'>
+ <outcome value='not-found'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="`'No complex resource found for customization UUID ' + $get-complex-resource-service-model-input.customization-uuid`" />
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <for silentFailure='true' index='idx' start='0' end='`$db.resource-policy_length`' >
+ <block atomic='true'>
+ <switch test="`$db.resource-policy[$idx].property-type == 'Name' and $db.resource-policy[$idx].property-name == 'Network Collection Name'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.network-naming-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'subnetwork assignments' and $db.resource-policy[$idx].property-name == 'subnet'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.subnet-assignment-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ <switch test="`$db.resource-policy[$idx].property-type == 'network assignments' and $db.resource-policy[$idx].property-name == 'route target'`">
+ <outcome value='true'>
+ <set>
+ <parameter name="get-complex-resource-service-model-output.vpn-binding-policy" value="`$db.resource-policy[$idx].policy-name`" />
+ </set>
+ </outcome>
+ </switch>
+ </block>
+ </for>
+ </outcome>
+ </get-resource>
+ </block>
+ </method>
+</service-logic>
\ No newline at end of file |