blob: 66a710a6c0ea02b97de148dde05fa7fc73720a87 (
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
<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='service-topology-operation-assign' mode='sync'>
<block atomic="true"><switch test='`$service-topology-operation-input.request-information.request-action`'>
<outcome value='CreateServiceInstance'>
<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="If svc-action is 'assign' then request-action must be 'CreateServiceInstance'" />
</return></outcome></switch><switch test='`$service-data.service-level-oper-status.order-status`'>
<outcome value=''><block>
</block></outcome><outcome value='Created'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="The requested service already exists" />
</return></outcome><outcome value='PendingDelete'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="The requested service is pending deletion" />
</return></outcome></switch><get-resource plugin='org.onap.ccsdk.sli.adaptors.sli.resource.sql.SqlResource' resource='SQL'
key='SELECT * from SERVICE_MODEL WHERE service_uuid = $service-topology-operation-input.service-information.onap-model-information.model-uuid'
pfx='db.service-model'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading SERVICE_MODEL table" />
</return></outcome><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 model found for service UUID ' + $service-topology-operation-input.service-information.onap-model-information.model-uuid`" />
</return></outcome></get-resource><switch test='`$service-topology-operation-input.service-request-input.service-instance-name`'>
<outcome value=''><block atomic="true"><switch test='`$db.service-model.ecomp-naming`'>
<outcome value='Y'><block>
</block></outcome><outcome value='N'><return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
</return></outcome><outcome value='Other'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="No service-instance-name was received but ecomp-naming is not Y" />
</return></outcome></switch><set>
<parameter name='generate-unique-name-input.index-table-name' value='SERVICE_INSTANCE_NAME_INDEX' />
<parameter name='generate-unique-name-input.index-table-prefix-column' value='service_instance_name_prefix' />
<parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
<parameter name='generate-unique-name-input.prefix' value="`$db.service-model.service-instance-name-prefix + '_'`" />
</set><call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
</return></outcome><outcome value='success'>
<set>
<parameter name='tmp.service-instance-name' value='`$generate-unique-name-output.generated-name`' />
</set></outcome></call></block></outcome><outcome value='Other'>
<block atomic="true"><set>
<parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
<parameter name='generate-unique-name-input.supplied-name' value='`$service-topology-operation-input.service-request-input.service-instance-name`' />
</set><call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`$generate-unique-name-output.error-message`" />
</return></outcome><outcome value='success'>
<set>
<parameter name='tmp.service-instance-name' value="`$service-topology-operation-input.service-request-input.service-instance-name`" />
</set></outcome></call></block></outcome></switch><set>
<parameter name='service-object-path'
value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $service-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="service-instance"
key="customer.global-customer-id = $service-topology-operation-input.service-information.global-customer-id AND
service-subscription.service-type = $service-topology-operation-input.service-information.subscription-service-type AND
service-instance.service-instance-id = $service-topology-operation-input.service-information.service-instance-id"
pfx='pfx' local-only='false' force='false'>
<parameter name="service-instance-name" value="`$tmp.service-instance-name`" />
<parameter name="selflink" value="`$service-object-path`" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="AAI failed" />
</return></outcome><outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="The service instance does not exist in AAI" />
</return></outcome></update><set>
<parameter name='service-data.service-topology.service-topology-identifier.service-instance-id'
value='`$service-topology-operation-input.service-information.service-instance-id`' />
<parameter name='service-data.service-topology.service-topology-identifier.service-type'
value='`$service-topology-operation-input.service-information.subscription-service-type`' />
<parameter name='service-data.service-topology.service-topology-identifier.service-instance-name'
value='`$tmp.service-instance-name`' />
<parameter name='service-data.service-topology.service-topology-identifier.global-customer-id'
value='`$service-topology-operation-input.service-information.global-customer-id`' />
</set><set>
<parameter name='service-data.service-topology.onap-model-information.'
value='`$service-topology-operation-input.service-information.onap-model-information.`' />
</set><switch test='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`'>
<outcome value=''><block>
</block></outcome><outcome value='Other'>
<for index='idx' start='0' end='`$service-topology-operation-input.service-request-input.service-input-parameters.param_length`' >
<set>
<parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-name'
value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].name`' />
<parameter name='service-data.service-topology.service-parameters[$idx].service-parameter-value'
value='`$service-topology-operation-input.service-request-input.service-input-parameters.param[$idx].value`' />
</set></for></outcome></switch><set>
<parameter name='service-data.service-level-oper-status.order-status' value='Created' />
<parameter name='service-data.service-level-oper-status.last-rpc-action' value='assign' />
<parameter name='service-data.service-level-oper-status.last-action' value='CreateServiceInstance' />
</set></block></method></service-logic>
|