Deploy activities to SDC from Catalog
[so.git] / asdc-controller / src / test / resources / data.sql
1 use catalogdb;
2
3 insert into heat_template(artifact_uuid, name, version, description, body, timeout_minutes, artifact_checksum, creation_timestamp) values ('ff874603-4222-11e7-9252-005056850d2e', 'module_mns_zrdm3frwl01exn_01_rgvm_1.yml', '1', 'created from csar', 'heat_template_version: 2013-05-23 description: heat template that creates TEST VNF parameters: TEST_server_name: type: string label: TEST server name description: TEST server name TEST_image_name: type: string label: image name description: TEST image name TEST_flavor_name: type: string label: TEST flavor name description: flavor name of TEST instance TEST_Role_net_name: type: string label: TEST network name description: TEST network name TEST_vnf_id: type: string label: TEST VNF Id description: TEST VNF Id resources:TEST: type: OS::Nova::Server properties: name: { get_param: TEST_server_name } image: { get_param: TEST_image_name } flavor: { get_param: TEST_flavor_name } networks: - port: { get_resource: TEST_port_0} metadata: vnf_id: {get_param: TEST_vnf_id} TEST_port_0: type: OS::Neutron::Port properties: network: { get_param: TEST_Role_net_name }', '60', 'MANUAL RECORD', '2017-01-21 23:26:56');
4
5 insert into temp_network_heat_template_lookup(network_resource_model_name, heat_template_artifact_uuid, aic_version_min, aic_version_max) values
6 ('CONTRAIL30_GNDIRECT', 'ff874603-4222-11e7-9252-005056850d2e', '3', '3'),
7 ('MSO_Example', 'ff874603-4222-11e7-9252-005056850d2e', '3', '3'),
8 ('ExtVL', 'ff874603-4222-11e7-9252-005056850d2e', '3', '3'),
9 ('AIC30_CONTRAIL_BASIC', 'ff874603-4222-11e7-9252-005056850d2e', '3', '3'),
10 ('CONTRAIL30_BASIC', 'ff874603-4222-11e7-9252-005056850d2e', '3', '3');
11
12 insert into network_resource(model_uuid, model_name, model_invariant_uuid, description, heat_template_artifact_uuid, neutron_network_type, model_version, tosca_node_type, aic_version_min, aic_version_max, orchestration_mode, creation_timestamp) values
13 ('10b36f65-f4e6-4be6-ae49-9596dc1c47fc', 'CONTRAIL30_GNDIRECT', 'ce4ff476-9641-4e60-b4d5-b4abbec1271d', 'Contrail 30 GNDIRECT NW', 'ff874603-4222-11e7-9252-005056850d2e', 'BASIC', '1.0', '', '3.0', '', 'HEAT', '2017-01-17 20:35:05');
14
15 insert into network_resource_customization(model_customization_uuid, model_instance_name, network_technology, network_type, network_role, network_scope, creation_timestamp, network_resource_model_uuid) values
16 ('3bdbb104-476c-483e-9f8b-c095b3d308ac', 'CONTRAIL30_GNDIRECT 9', '', '', '', '', '2017-04-19 14:28:32', '10b36f65-f4e6-4be6-ae49-9596dc1c47fc');
17
18
19
20 INSERT INTO temp_network_heat_template_lookup(NETWORK_RESOURCE_MODEL_NAME, HEAT_TEMPLATE_ARTIFACT_UUID, AIC_VERSION_MIN, AIC_VERSION_MAX) VALUES
21 ('TENANT_OAM_NETWORK', 'ff874603-4222-11e7-9252-005056850d2e', '3.0', NULL);
22 INSERT INTO temp_network_heat_template_lookup(NETWORK_RESOURCE_MODEL_NAME, HEAT_TEMPLATE_ARTIFACT_UUID, AIC_VERSION_MIN, AIC_VERSION_MAX) VALUES
23 ('SRIOV_PROVIDER_NETWORK', 'ff874603-4222-11e7-9252-005056850d2e', '3.0', NULL);
24
25 insert into vnf_resource(orchestration_mode, description, creation_timestamp, model_uuid, aic_version_min, aic_version_max, model_invariant_uuid, model_version, model_name, tosca_node_type, heat_template_artifact_uuid) values
26 ('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002671', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '1.0', 'vSAMP10a', 'VF', null);
27
28 insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
29 ('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
30
31 insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values
32 ('ff2ae348-214a-11e7-93ae-92361f002671', '1');
33
34 insert into activity_spec(name, description, version) values
35 ('testActivity1', 'Test Activity 1', 1.0);
36
37 insert into workflow_activity_spec_sequence(workflow_id, activity_spec_id, seq_no) values
38 (1, 1, 1);
39
40 INSERT INTO activity_spec (NAME, DESCRIPTION, VERSION) 
41 VALUES 
42 ('VNFSetInMaintFlagActivity','Activity to Set InMaint Flag in A&AI',1.0),
43 ('VNFCheckPserversLockedFlagActivity','Activity Check Pservers Locked Flag VNF',1.0),
44 ('VNFCheckInMaintFlagActivity','Activity CheckIn Maint Flag on VNF',1.0),
45 ('VNFCheckClosedLoopDisabledFlagActivity','Activity Check Closed Loop Disabled Flag on VNF',1.0),
46 ('VNFSetClosedLoopDisabledFlagActivity','Activity Set Closed Loop Disabled Flag on VNF',1.0),
47 ('VNFUnsetClosedLoopDisabledFlagActivity','Activity Unset Closed Loop Disabled Flag on VNF',1.0),
48 ('VNFLockActivity','Activity Lock on VNF',1.0),
49 ('VNFUnlockActivity','Activity UnLock on VNF',1.0),
50 ('VNFStopActivity','Activity Stop on VNF',1.0),
51 ('VNFStartActivity','Activity Start on VNF',1.0),
52 ('VNFSnapShotActivity','Activity Snap Shot on VNF',1.0),
53 ('FlowCompleteActivity','Activity Complete on VNF',1.0),
54 ('PauseForManualTaskActivity','Activity Pause For Manual Task on VNF',1.0),
55 ('DistributeTrafficActivity','Activity Distribute Traffic on VNF',1.0),
56 ('DistributeTrafficCheckActivity','Activity Distribute Traffic Check on VNF',1.0),
57 ('VNFHealthCheckActivity','Activity Health Check on VNF',1.0),
58 ('VNFQuiesceTrafficActivity','Activity Quiesce Traffic on VNF',1.0),
59 ('VNFResumeTrafficActivity','Activity Resume Traffic on VNF',1.0),
60 ('VNFUnsetInMaintFlagActivity','Activity Unset InMaint Flag on VNF',1.0),
61 ('VNFUpgradeBackupActivity','Activity Upgrade Backup on VNF',1.0),
62 ('VNFUpgradePostCheckActivity','Activity Upgrade Post Check on VNF',1.0),
63 ('VNFUpgradePreCheckActivity','Activity Upgrade PreCheck on VNF',1.0),
64 ('VNFUpgradeSoftwareActivity','Activity UpgradeS oftware on VNF',1.0),
65 ('VnfInPlaceSoftwareUpdate','Activity InPlace Software Update on VNF',1.0);
66
67 INSERT INTO activity_spec_categories (NAME)
68 VALUES ('VNF');
69
70 INSERT INTO activity_spec_to_activity_spec_categories(ACTIVITY_SPEC_ID, ACTIVITY_SPEC_CATEGORIES_ID) 
71 VALUES
72 ((select ID from activity_spec where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0),
73 (select ID from activity_spec_categories where NAME='VNF')),
74 ((select ID from activity_spec where NAME='VNFCheckPserversLockedFlagActivity' and VERSION=1.0),
75 (select ID from activity_spec_categories where NAME='VNF')),
76 ((select ID from activity_spec where NAME='VNFCheckInMaintFlagActivity' and VERSION=1.0),
77 (select ID from activity_spec_categories where NAME='VNF')),
78 ((select ID from activity_spec where NAME='VNFCheckClosedLoopDisabledFlagActivity' and VERSION=1.0),
79 (select ID from activity_spec_categories where NAME='VNF')),
80 ((select ID from activity_spec where NAME='VNFSetClosedLoopDisabledFlagActivity' and VERSION=1.0),
81 (select ID from activity_spec_categories where NAME='VNF')),
82 ((select ID from activity_spec where NAME='VNFUnsetClosedLoopDisabledFlagActivity' and VERSION=1.0),
83 (select ID from activity_spec_categories where NAME='VNF')),
84 ((select ID from activity_spec where NAME='VNFLockActivity' and VERSION=1.0),
85 (select ID from activity_spec_categories where NAME='VNF')),
86 ((select ID from activity_spec where NAME='VNFUnlockActivity' and VERSION=1.0),
87 (select ID from activity_spec_categories where NAME='VNF')),
88 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
89 (select ID from activity_spec_categories where NAME='VNF')),
90 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
91 (select ID from activity_spec_categories where NAME='VNF')),
92 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
93 (select ID from activity_spec_categories where NAME='VNF')),
94 ((select ID from activity_spec where NAME='FlowCompleteActivity' and VERSION=1.0),
95 (select ID from activity_spec_categories where NAME='VNF')),
96 ((select ID from activity_spec where NAME='PauseForManualTaskActivity' and VERSION=1.0),
97 (select ID from activity_spec_categories where NAME='VNF')),
98 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
99 (select ID from activity_spec_categories where NAME='VNF')),
100 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
101 (select ID from activity_spec_categories where NAME='VNF')),
102 ((select ID from activity_spec where NAME='VNFHealthCheckActivity' and VERSION=1.0),
103 (select ID from activity_spec_categories where NAME='VNF')),
104 ((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0),
105 (select ID from activity_spec_categories where NAME='VNF')),
106 ((select ID from activity_spec where NAME='VNFResumeTrafficActivity' and VERSION=1.0),
107 (select ID from activity_spec_categories where NAME='VNF')),
108 ((select ID from activity_spec where NAME='VNFUnsetInMaintFlagActivity' and VERSION=1.0),
109 (select ID from activity_spec_categories where NAME='VNF')),
110 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
111 (select ID from activity_spec_categories where NAME='VNF')),
112 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
113 (select ID from activity_spec_categories where NAME='VNF')),
114 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
115 (select ID from activity_spec_categories where NAME='VNF')),
116 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
117 (select ID from activity_spec_categories where NAME='VNF')),
118 ((select ID from activity_spec where NAME='VnfInPlaceSoftwareUpdate' and VERSION=1.0),
119 (select ID from activity_spec_categories where NAME='VNF'));
120
121 INSERT INTO activity_spec_parameters (NAME, TYPE, DIRECTION, DESCRIPTION) 
122 VALUES('WorkflowException','WorkflowException','output','Description');
123
124 INSERT INTO activity_spec_to_activity_spec_parameters( ACTIVITY_SPEC_ID, ACTIVITY_SPEC_PARAMETERS_ID) 
125 VALUES
126 ((select ID from activity_spec where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0),
127 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
128 ((select ID from activity_spec where NAME='VNFCheckPserversLockedFlagActivity' and VERSION=1.0),
129 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
130 ((select ID from activity_spec where NAME='VNFCheckInMaintFlagActivity' and VERSION=1.0),
131 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
132 ((select ID from activity_spec where NAME='VNFCheckClosedLoopDisabledFlagActivity' and VERSION=1.0),
133 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
134 ((select ID from activity_spec where NAME='VNFSetClosedLoopDisabledFlagActivity' and VERSION=1.0),
135 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
136 ((select ID from activity_spec where NAME='VNFUnsetClosedLoopDisabledFlagActivity' and VERSION=1.0),
137 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
138 ((select ID from activity_spec where NAME='VNFLockActivity' and VERSION=1.0),
139 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
140 ((select ID from activity_spec where NAME='VNFUnlockActivity' and VERSION=1.0),
141 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
142 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
143 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
144 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
145 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
146 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
147 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
148 ((select ID from activity_spec where NAME='FlowCompleteActivity' and VERSION=1.0),
149 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
150 ((select ID from activity_spec where NAME='PauseForManualTaskActivity' and VERSION=1.0),
151 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
152 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
153 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
154 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
155 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
156 ((select ID from activity_spec where NAME='VNFHealthCheckActivity' and VERSION=1.0),
157 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
158 ((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0),
159 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
160 ((select ID from activity_spec where NAME='VNFResumeTrafficActivity' and VERSION=1.0),
161 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
162 ((select ID from activity_spec where NAME='VNFUnsetInMaintFlagActivity' and VERSION=1.0),
163 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
164 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
165 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
166 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
167 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
168 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
169 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
170 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
171 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output'));
172
173 INSERT INTO `user_parameters`(`NAME`,`PAYLOAD_LOCATION`,`LABEL`,`TYPE`,`DESCRIPTION`,`IS_REQUIRED`,`MAX_LENGTH`,`ALLOWABLE_CHARS`)
174 VALUES 
175 ('cloudOwner','cloudConfiguration','Cloud Owner','text','',1,7,''), 
176 ('operations_timeout','userParams','Operations Timeout','text','',1,50,''),
177 ('existing_software_version','userParams','Existing Software Version','text','',1,50,''),
178 ('tenantId','cloudConfiguration','Tenant/Project ID','text','',1,36,''),
179 ('new_software_version','userParams','New Software Version','text','',1,50,''),
180 ('lcpCloudRegionId','cloudConfiguration','Cloud Region ID','text','',1,7,'');
181
182 INSERT INTO `activity_spec_to_user_parameters`(`ACTIVITY_SPEC_ID`,`USER_PARAMETERS_ID`)
183 VALUES
184 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
185 (select ID from user_parameters where NAME='lcpCloudRegionId')),
186 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
187 (select ID from user_parameters where NAME='tenantId')),
188 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
189 (select ID from user_parameters where NAME='lcpCloudRegionId')),
190 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
191 (select ID from user_parameters where NAME='tenantId')),
192 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
193 (select ID from user_parameters where NAME='lcpCloudRegionId')),
194 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
195 (select ID from user_parameters where NAME='tenantId')),
196 ((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0),
197 (select ID from user_parameters where NAME='operations_timeout')),
198 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
199 (select ID from user_parameters where NAME='existing_software_version')),
200 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
201 (select ID from user_parameters where NAME='new_software_version')),
202 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
203 (select ID from user_parameters where NAME='existing_software_version')),
204 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
205 (select ID from user_parameters where NAME='new_software_version')),
206 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
207 (select ID from user_parameters where NAME='existing_software_version')),
208 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
209 (select ID from user_parameters where NAME='new_software_version')),
210 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
211 (select ID from user_parameters where NAME='existing_software_version')),
212 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
213 (select ID from user_parameters where NAME='new_software_version'));
214
215
216 --------START Request DB INSERTS --------
217 insert into requestdb.watchdog_distributionid_status(DISTRIBUTION_ID, DISTRIBUTION_ID_STATUS,LOCK_VERSION) values 
218 ('watchdogTestStatusSuccess', 'SUCCESS',0),
219 ('watchdogTestStatusFailure', 'FAILURE',0),
220 ('watchdogTestStatusTimeout', 'TIMEOUT',0),
221 ('watchdogTestStatusIncomplete', 'INCOMPLETE',0),
222 ('watchdogTestStatusException', 'EXCEPTION',0),
223 ('watchdogTestStatusNull', 'NULL',0),
224 ('testStatusSuccessTosca', 'SUCCESS',0),
225 ('testStatusFailureTosca', 'FAILURE',0),
226 ('testStatusTimeoutTosca', 'TIMEOUT',0),
227 ('testStatusIncompleteTosca', 'INCOMPLETE',0),
228 ('testStatusExceptionTosca', 'EXCEPTION',0),
229 ('testStatusNullTosca', 'NULL',0);
230
231 --WatchdogDistrubutionTest
232 insert into requestdb.watchdog_per_component_distribution_status(DISTRIBUTION_ID, COMPONENT_NAME, COMPONENT_DISTRIBUTION_STATUS) values
233 ('watchdogTestStatusSuccess', 'SO', 'COMPONENT_DONE_OK'),
234 ('watchdogTestStatusSuccess', 'AAI', 'COMPONENT_DONE_OK'),
235 ('watchdogTestStatusSuccess', 'SDNC', 'COMPONENT_DONE_OK'),
236 ('watchdogTestStatusFailure', 'SO', 'COMPONENT_DONE_ERROR'),
237 ('watchdogTestStatusFailure', 'AAI', 'COMPONENT_DONE_ERROR'),
238 ('watchdogTestStatusFailure', 'SDNC', 'COMPONENT_DONE_ERROR'),
239 ('watchdogTestStatusException', 'SO', 'COMPONENT_MALFORMED'),
240 ('watchdogTestStatusException', 'AAI', 'COMPONENT_MALFORMED'),
241 ('watchdogTestStatusException', 'SDNC', 'COMPONENT_MALFORMED'),
242 ('testStatusSuccessTosca', 'SO', 'COMPONENT_DONE_OK'),
243 ('testStatusSuccessTosca', 'AAI', 'COMPONENT_DONE_OK'),
244 ('testStatusSuccessTosca', 'SDNC', 'COMPONENT_DONE_OK'),
245 ('testStatusFailureTosca', 'SO', 'COMPONENT_DONE_ERROR'),
246 ('testStatusFailureTosca', 'AAI', 'COMPONENT_DONE_ERROR'),
247 ('testStatusFailureTosca', 'SDNC', 'COMPONENT_DONE_ERROR'),
248 ('testStatusExceptionTosca', 'SO', 'COMPONENT_MALFORMED'),
249 ('testStatusExceptionTosca', 'AAI', 'COMPONENT_MALFORMED'),
250 ('testStatusExceptionTosca', 'SDNC', 'COMPONENT_MALFORMED');
251
252 insert into requestdb.watchdog_service_mod_ver_id_lookup(DISTRIBUTION_ID, SERVICE_MODEL_VERSION_ID, DISTRIBUTION_NOTIFICATION, CONSUMER_ID) values
253 ('watchdogTestStatusSuccess', '5df8b6de-2083-11e7-93ae-92361f002671', NULL, NULL),
254 ('watchdogTestStatusNull', '00000000-0000-0000-0000-000000000000', NULL, NULL);