aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_network-topology-operation-activate.xml
blob: 9bef4ee92c41ce9e38fa180b3295a5c38334f8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<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='network-topology-operation-activate' mode='sync'>
<block atomic="true"><get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
	resource="l3-network" 
		key="l3-network.network-id = $network-topology-operation-input.network-information.network-id" 
		local-only="false" 
		pfx="aai.l3-network">
<outcome value='not-found'>
<return status='failure'>
	<parameter name="error-code" value="404" />
	<parameter name="error-message" value="network-id not found in AAI" /></return></outcome><outcome value='failure'>
<return status='failure'>
	<parameter name="error-code" value="500" />
	<parameter name="error-message" value="'Error retrieving l3-network with network-id=' + $network-topology-operation-input.network-request-information.network-id + 'from AnAI'" /></return></outcome></get-resource><switch test='`$aai.l3-network.subnets.subnet_length`'>
<outcome value=''>
<return status='failure'>
	<parameter name='ack-final' value='Y'/>
	<parameter name="error-code" value="500" />
    <parameter name="error-message" value="no networks found" />
</return></outcome><outcome value='Other'>
<for index='sidx' start='0' end='`$aai.l3-network.subnets.subnet_length`' >
<block atomic="true"><get-resource
        plugin='org.onap.ccsdk.sli.adaptors.sli.resource.sql.SqlResource'
        resource='SQL'
        key="SELECT * from EIPAM_IP_SUBNETS where entity_id = $aai.l3-network.subnets.subnet[$sidx].subnet-id ; "
        pfx='tmp.eipam-subnet-row'>

<outcome value='failure'>
<return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Query to DB table EIPAM_IP_SUBNETS failed to find subnet matching aai subnet." />
	</return></outcome><outcome value="not-found"><return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Subnet not found in EIPAM_IP_SUBNETS - activate failed." />
	</return></outcome><outcome value='success'>
<block atomic='true'><set>
	<parameter name="eipam-ip-block.entity-id" value="`$aai.l3-network.subnets.subnet[$sidx].subnet-id`"/>
	<parameter name="eipam-ip-block.plans[0].plan-name" value="`$tmp.eipam-subnet-row.plan-name`"/>
</set><!--subnet and subnet_keys are deleted in the EIPAMPlugin--><execute plugin="com.att.sdnctl.sli.plugin.eipam.EIPAMPlugin" method="activateSubnet">
<outcome value='failure'><return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while activating subnet in EIPAM." />
	</return></outcome></execute><save 
	plugin='org.onap.ccsdk.sli.adaptors.sli.resource.sql.SqlResource' 
	resource='SQL'
	key="UPDATE EIPAM_IP_SUBNETS
             SET status = 'ACTIVE'
             WHERE entity_id = $eipam-ip-block.entity-id ; "
    force='true'
        pfx='pfx.eipam-subnet-row'>
<outcome value='failure'>
<return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
	</return></outcome><outcome value="not-found"><return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="An error occured while updating subnet to active in mysql." />
	</return></outcome><outcome value='success'>
<block atomic='true'><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
	resource="subnet" 
		key="l3-network.network-id = $aai.l3-network.network-id 
			AND subnet.subnet-id = $eipam-ip-block.entity-id" >
<parameter name="orchestration-status" value="Created" />
		<outcome value='failure'>
<return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet." />
	</return></outcome><outcome value="not-found"><return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Failure updating orchestration-status in AAI for subnet.  Subnet not found." />
	</return></outcome></update></block></outcome></save></block></outcome></get-resource></block></for></outcome></switch><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService" 
	resource="l3-network" 
		key="l3-network.network-id = $aai.l3-network.network-id" >
<parameter name="orchestration-status" value="Active" />	<outcome value='failure'>
<return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network" />
	</return></outcome><outcome value="not-found"><return status="failure">
	<parameter name="error-code" value="500"/>
	<parameter name="error-message" value="Failure updating orchestration-status in AAI for l3-network.  Network not found." />
	</return></outcome></update><set>
<parameter name='service-data.networks.network[$nidx].network-data.sdnc-request-header.' value='`$network-topology-operation-input.sdnc-request-header.`' />
<parameter name='service-data.networks.network[$nidx].network-data.request-information.' value='`$network-topology-operation-input.request-information.`' />
</set><set>
<parameter name='networkId' value='`$network-topology-operation-input.network-information.network-id`' />
</set><set>
<parameter name='network-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
 + $network-topology-operation-input.service-information.service-instance-id
 + '/service-data/networks/network/'
 + $networkId
 + '/network-data/network-topology/'` " />
 
</set><set>
<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.order-status' value='Created' />
<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-rpc-action' value='`$network-topology-operation-input.sdnc-request-header.svc-action`' />
<parameter name='service-data.networks.network[$tmp.nidx].network-data.network-level-oper-status.last-action' value='`$network-topology-operation-input.request-information.request-action`' />
</set><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>