Merge branch feature7928. It includes feature5837
[osm/LCM.git] / osm_lcm / tests / test_db_descriptors.py
1 #
2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
5 #
6 # http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
12 # under the License.
13 #
14 # For those usages not covered by the Apache License, Version 2.0 please
15 # contact: esousa@whitestack.com or alfonso.tiernosepulveda@telefonica.com
16 ##
17 db_nsds_text = """
18 ---
19 - _admin:
20 created: 1566823353.971486
21 modified: 1566823353.971486
22 onboardingState: ONBOARDED
23 operationalState: ENABLED
24 projects_read:
25 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
26 projects_write:
27 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
28 storage:
29 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
30 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
31 fs: local
32 path: /app/storage/
33 pkg-dir: hackfest_3charmed_nsd
34 zipfile: package.tar.gz
35 usageState: NOT_IN_USE
36 userDefinedData: {}
37 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
38 constituent-vnfd:
39 - member-vnf-index: '1'
40 vnfd-id-ref: hackfest3charmed-vnf
41 - member-vnf-index: '2'
42 vnfd-id-ref: hackfest3charmed-vnf
43 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and mgmtnet
44 VLs
45 id: hackfest3charmed-ns
46 logo: osm.png
47 name: hackfest3charmed-ns
48 short-name: hackfest3charmed-ns
49 version: '1.0'
50 vld:
51 - id: mgmt
52 mgmt-network: true
53 name: mgmt
54 short-name: mgmt
55 type: ELAN
56 vim-network-name: mgmt
57 vnfd-connection-point-ref:
58 - member-vnf-index-ref: '1'
59 vnfd-connection-point-ref: vnf-mgmt
60 vnfd-id-ref: hackfest3charmed-vnf
61 - member-vnf-index-ref: '2'
62 vnfd-connection-point-ref: vnf-mgmt
63 vnfd-id-ref: hackfest3charmed-vnf
64 - id: datanet
65 name: datanet
66 short-name: datanet
67 type: ELAN
68 vnfd-connection-point-ref:
69 - member-vnf-index-ref: '1'
70 vnfd-connection-point-ref: vnf-data
71 vnfd-id-ref: hackfest3charmed-vnf
72 - member-vnf-index-ref: '2'
73 vnfd-connection-point-ref: vnf-data
74 vnfd-id-ref: hackfest3charmed-vnf
75 """
76 db_nslcmops_text = """
77 ---
78 - _admin:
79 created: 1566823354.4148262
80 modified: 1566823354.4148262
81 projects_read:
82 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
83 projects_write:
84 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
85 worker: 86434c2948e2
86 operations:
87 - member_vnf_index: '1'
88 primitive: touch
89 primitive_params: /home/ubuntu/last-touch-1
90 operationState: COMPLETED
91 detailed-status: Done
92 - member_vnf_index: '1'
93 primitive: touch
94 primitive_params: /home/ubuntu/last-touch-2
95 operationState: COMPLETED
96 detailed-status: Done
97 - member_vnf_index: '2'
98 primitive: touch
99 primitive_params: /home/ubuntu/last-touch-3
100 operationState: FAILED
101 detailed-status: Unknown error
102 _id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
103 detailed-status: 'FAILED executing proxy charm initial primitives for member_vnf_index=1
104 vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
105 vdu_id=None: ''timeout after 600 seconds'''
106 id: a639fac7-e0bb-4225-8ecb-c1f8efcc125e
107 isAutomaticInvocation: false
108 isCancelPending: false
109 lcmOperationType: instantiate
110 links:
111 nsInstance: /osm/nslcm/v1/ns_instances/f48163a6-c807-47bc-9682-f72caef5af85
112 self: /osm/nslcm/v1/ns_lcm_op_occs/a639fac7-e0bb-4225-8ecb-c1f8efcc125e
113 nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
114 operationParams:
115 additionalParamsForVnf:
116 - additionalParams:
117 touch_filename: /home/ubuntu/first-touch-1
118 touch_filename2: /home/ubuntu/second-touch-1
119 member-vnf-index: '1'
120 - additionalParams:
121 touch_filename: /home/ubuntu/first-touch-2
122 touch_filename2: /home/ubuntu/second-touch-2
123 member-vnf-index: '2'
124 lcmOperationType: instantiate
125 nsDescription: default description
126 nsInstanceId: f48163a6-c807-47bc-9682-f72caef5af85
127 nsName: ALF
128 nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
129 vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
130 operationState: FAILED
131 startTime: 1566823354.414689
132 statusEnteredTime: 1566824534.5112448
133 """
134 db_nsrs_text = """
135 ---
136 - _admin:
137 created: 1566823354.3716335
138 deployed:
139 RO:
140 nsd_id: 876573b5-968d-40b9-b52b-91bf5c5844f7
141 nsr_id: c9fe9908-3180-430d-b633-fca2f68db008
142 nsr_status: ACTIVE
143 vnfd:
144 - id: 1ab2a418-9fe3-4358-bf17-411e5155535f
145 member-vnf-index: '1'
146 - id: 0de348e3-c201-4f6a-91cc-7f957e2d5504
147 member-vnf-index: '2'
148 VCA:
149 - application: alf-b-aa
150 detailed-status: Ready!
151 member-vnf-index: '1'
152 model: f48163a6-c807-47bc-9682-f72caef5af85
153 operational-status: active
154 primitive_id: null
155 ssh-public-key: ssh-rsa pub-key root@juju-145d3e-0
156 step: ssh-public-key-obtained
157 vdu_count_index: null
158 vdu_id: null
159 vdu_name: null
160 vnfd_id: hackfest3charmed-vnf
161 - application: alf-c-ab
162 detailed-status: Ready!
163 member-vnf-index: '2'
164 model: f48163a6-c807-47bc-9682-f72caef5af85
165 operational-status: active
166 primitive_id: null
167 ssh-public-key: ssh-rsa pub-key root@juju-145d3e-0
168 step: ssh-public-key-obtained
169 vdu_count_index: null
170 vdu_id: null
171 vdu_name: null
172 vnfd_id: hackfest3charmed-vnf
173 VCA-model-name: f48163a6-c807-47bc-9682-f72caef5af85
174 modified: 1566823354.3716335
175 nsState: INSTANTIATED
176 nslcmop: null
177 projects_read:
178 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
179 projects_write:
180 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
181 _id: f48163a6-c807-47bc-9682-f72caef5af85
182 additionalParamsForNs: null
183 admin-status: ENABLED
184 config-status: init
185 constituent-vnfr-ref:
186 - 88d90b0c-faff-4b9f-bccd-017f33985984
187 - 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
188 create-time: 1566823354.36234
189 datacenter: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
190 description: default description
191 detailed-status: 'ERROR executing proxy charm initial primitives for member_vnf_index=1
192 vdu_id=None: charm error executing primitive verify-ssh-credentials for member_vnf_index=1
193 vdu_id=None: ''timeout after 600 seconds'''
194 id: f48163a6-c807-47bc-9682-f72caef5af85
195 instantiate_params:
196 nsDescription: default description
197 nsName: ALF
198 nsdId: 8c2f8b95-bb1b-47ee-8001-36dc090678da
199 vimAccountId: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
200 name: ALF
201 name-ref: ALF
202 ns-instance-config-ref: f48163a6-c807-47bc-9682-f72caef5af85
203 nsd:
204 _admin:
205 created: 1566823353.971486
206 modified: 1566823353.971486
207 onboardingState: ONBOARDED
208 operationalState: ENABLED
209 projects_read:
210 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
211 projects_write:
212 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
213 storage:
214 descriptor: hackfest_3charmed_nsd/hackfest_3charmed_nsd.yaml
215 folder: 8c2f8b95-bb1b-47ee-8001-36dc090678da
216 fs: local
217 path: /app/storage/
218 pkg-dir: hackfest_3charmed_nsd
219 zipfile: package.tar.gz
220 usageState: NOT_IN_USE
221 userDefinedData: {}
222 _id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
223 constituent-vnfd:
224 - member-vnf-index: '1'
225 vnfd-id-ref: hackfest3charmed-vnf
226 - member-vnf-index: '2'
227 vnfd-id-ref: hackfest3charmed-vnf
228 description: NS with 2 VNFs hackfest3charmed-vnf connected by datanet and
229 mgmtnet VLs
230 id: hackfest3charmed-ns
231 logo: osm.png
232 name: hackfest3charmed-ns
233 short-name: hackfest3charmed-ns
234 version: '1.0'
235 vld:
236 - id: mgmt
237 mgmt-network: true
238 name: mgmt
239 short-name: mgmt
240 type: ELAN
241 vim-network-name: mgmt
242 vnfd-connection-point-ref:
243 - member-vnf-index-ref: '1'
244 vnfd-connection-point-ref: vnf-mgmt
245 vnfd-id-ref: hackfest3charmed-vnf
246 - member-vnf-index-ref: '2'
247 vnfd-connection-point-ref: vnf-mgmt
248 vnfd-id-ref: hackfest3charmed-vnf
249 - id: datanet
250 name: datanet
251 short-name: datanet
252 type: ELAN
253 vnfd-connection-point-ref:
254 - member-vnf-index-ref: '1'
255 vnfd-connection-point-ref: vnf-data
256 vnfd-id-ref: hackfest3charmed-vnf
257 - member-vnf-index-ref: '2'
258 vnfd-connection-point-ref: vnf-data
259 vnfd-id-ref: hackfest3charmed-vnf
260 nsd-id: 8c2f8b95-bb1b-47ee-8001-36dc090678da
261 nsd-name-ref: hackfest3charmed-ns
262 nsd-ref: hackfest3charmed-ns
263 operational-events: []
264 operational-status: failed
265 orchestration-progress: {}
266 resource-orchestrator: osmopenmano
267 short-name: ALF
268 ssh-authorized-key: null
269 vld:
270 - id: mgmt
271 name: null
272 status: ACTIVE
273 status-detailed: null
274 vim-id: f99ae780-0e2f-4985-af41-574eae6919c0
275 vim-network-name: mgmt
276 - id: datanet
277 name: ALF-datanet
278 status: ACTIVE
279 status-detailed: null
280 vim-id: c31364ba-f573-4ab6-bf1a-fed30ede39a8
281 vnfd-id:
282 - 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
283 """
284 db_ro_ns_text = """
285 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
286 description: null
287 name: ALF
288 nets:
289 - created: false
290 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
291 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
292 error_msg: null
293 ns_net_osm_id: mgmt
294 related: c6bac394-fa27-4c43-bb34-42f621a9d343
295 sce_net_id: 8f215bab-c35e-41e6-a035-42bfaa07af9f
296 sdn_net_id: null
297 status: ACTIVE
298 uuid: c6bac394-fa27-4c43-bb34-42f621a9d343
299 vim_info: "{vim_info: null}"
300 vim_name: null
301 vim_net_id: f99ae780-0e2f-4985-af41-574eae6919c0
302 vnf_net_id: null
303 vnf_net_osm_id: null
304 - created: true
305 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
306 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
307 error_msg: null
308 ns_net_osm_id: datanet
309 related: 509d576c-120f-493a-99a1-5fea99dfe041
310 sce_net_id: 3d766bbc-33a8-41aa-a986-2f35e8d25c16
311 sdn_net_id: null
312 status: ACTIVE
313 uuid: 509d576c-120f-493a-99a1-5fea99dfe041
314 vim_info: "{vim_info: null}"
315 vim_name: ALF-datanet
316 vim_net_id: c31364ba-f573-4ab6-bf1a-fed30ede39a8
317 vnf_net_id: null
318 vnf_net_osm_id: null
319 - created: true
320 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
321 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
322 error_msg: null
323 ns_net_osm_id: null
324 related: 277fed09-3220-4bfd-9052-b96b21a32daf
325 sce_net_id: null
326 sdn_net_id: null
327 status: ACTIVE
328 uuid: 277fed09-3220-4bfd-9052-b96b21a32daf
329 vim_info: "{vim_info: null}"
330 vim_name: ALF-internal
331 vim_net_id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
332 vnf_net_id: 62e62fae-c12b-4ebc-9a9b-30031c6c16fa
333 vnf_net_osm_id: internal
334 - created: true
335 datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
336 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
337 error_msg: null
338 ns_net_osm_id: null
339 related: 92534d1a-e697-4372-a84d-aa0aa643b68a
340 sce_net_id: null
341 sdn_net_id: null
342 status: ACTIVE
343 uuid: 92534d1a-e697-4372-a84d-aa0aa643b68a
344 vim_info: "{vim_info: null}"
345 vim_name: ALF-internal
346 vim_net_id: 09655387-b639-421a-b5f6-72b26d685fb4
347 vnf_net_id: 13c6c77d-86a5-4914-832c-990d4ec7b54e
348 vnf_net_osm_id: internal
349 nsd_osm_id: f48163a6-c807-47bc-9682-f72caef5af85.2.hackfest3charmed-ns
350 scenario_id: 876573b5-968d-40b9-b52b-91bf5c5844f7
351 scenario_name: hackfest3charmed-ns
352 sfis: []
353 sfps: []
354 sfs: []
355 tenant_id: 0ea38bd0-2729-47a9-ae07-c6ce76115eb2
356 uuid: c9fe9908-3180-430d-b633-fca2f68db008
357 vnfs:
358 - datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
359 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
360 ip_address: 10.205.1.46
361 member_vnf_index: '1'
362 mgmt_access: '{interface_id: 61549ee3-cd6c-4930-8b90-eaad97fe345b, required: ''False'',
363 vm_id: 6cf4a48f-3b6c-4395-8221-119fa37de24a}
364
365 '
366 sce_vnf_id: 83be04a8-c513-42ba-9908-22728f686d31
367 uuid: 94724042-7576-4fb0-82ec-6a7ab642741c
368 vms:
369 - created_at: '2019-08-26T12:50:38'
370 error_msg: null
371 interfaces:
372 - external_name: vnf-mgmt
373 instance_net_id: c6bac394-fa27-4c43-bb34-42f621a9d343
374 internal_name: mgmtVM-eth0
375 ip_address: 10.205.1.46
376 mac_address: fa:16:3e:b4:3e:b1
377 sdn_port_id: null
378 type: mgmt
379 vim_info: "{vim_info: null}"
380 vim_interface_id: 4d3cb8fd-7040-4169-a0ad-2486d2b006a1
381 - external_name: null
382 instance_net_id: 277fed09-3220-4bfd-9052-b96b21a32daf
383 internal_name: mgmtVM-eth1
384 ip_address: 192.168.54.2
385 mac_address: fa:16:3e:6e:7e:78
386 sdn_port_id: null
387 type: bridge
388 vim_info: "{vim_info: null}"
389 vim_interface_id: 54ed68e2-9802-4dfe-b68a-280b3fc6e02d
390 ip_address: 10.205.1.46
391 name: mgmtVM
392 related: d0b91293-a91d-4f08-b15f-0bf841216dfe
393 status: ACTIVE
394 uuid: d0b91293-a91d-4f08-b15f-0bf841216dfe
395 vdu_osm_id: mgmtVM
396 vim_info: "{vim_info: null}"
397 vim_name: ALF-1-mgmtVM-1
398 vim_vm_id: c2538499-4c30-41c0-acd5-80cb92f48061
399 - created_at: '2019-08-26T12:50:38'
400 error_msg: null
401 interfaces:
402 - external_name: null
403 instance_net_id: 277fed09-3220-4bfd-9052-b96b21a32daf
404 internal_name: dataVM-eth0
405 ip_address: 192.168.54.3
406 mac_address: fa:16:3e:d9:7a:5d
407 sdn_port_id: null
408 type: bridge
409 vim_info: "{vim_info: null}"
410 vim_interface_id: 1637f350-8840-4241-8ed0-4616bdcecfcf
411 - external_name: vnf-data
412 instance_net_id: 509d576c-120f-493a-99a1-5fea99dfe041
413 internal_name: dataVM-xe0
414 ip_address: 192.168.24.3
415 mac_address: fa:16:3e:d1:6c:0d
416 sdn_port_id: null
417 type: bridge
418 vim_info: "{vim_info: null}"
419 vim_interface_id: 54c73e83-7059-41fe-83a9-4c4ae997b481
420 name: dataVM
421 related: 5c08253d-8a35-474f-b0d3-c5297d174c13
422 status: ACTIVE
423 uuid: 5c08253d-8a35-474f-b0d3-c5297d174c13
424 vdu_osm_id: dataVM
425 vim_info: "{vim_info: null}"
426 vim_name: ALF-1-dataVM-1
427 vim_vm_id: 87973c3f-365d-4227-95c2-7a8abc74349c
428 - created_at: '2019-08-26T13:40:54'
429 error_msg: null
430 interfaces:
431 - external_name: null
432 instance_net_id: 277fed09-3220-4bfd-9052-b96b21a32daf
433 internal_name: dataVM-eth0
434 ip_address: 192.168.54.5
435 mac_address: fa:16:3e:e4:17:45
436 sdn_port_id: null
437 type: bridge
438 vim_info: "{vim_info: null}"
439 vim_interface_id: 7e246e40-8710-4c33-9c95-78fc3c02bc5b
440 - external_name: vnf-data
441 instance_net_id: 509d576c-120f-493a-99a1-5fea99dfe041
442 internal_name: dataVM-xe0
443 ip_address: 192.168.24.5
444 mac_address: fa:16:3e:29:6f:a6
445 sdn_port_id: null
446 type: bridge
447 vim_info: "{vim_info: null}"
448 vim_interface_id: ce81af7a-9adf-494b-950e-6581fd04ecc4
449 name: dataVM
450 related: 1ae5a0a2-c15a-49a4-a77c-2991d97f6dbe
451 status: ACTIVE
452 uuid: 1ae5a0a2-c15a-49a4-a77c-2991d97f6dbe
453 vdu_osm_id: dataVM
454 vim_info: "{vim_info: null}"
455 vim_name: ALF-1-dataVM-2
456 vim_vm_id: 4916533e-36c6-4861-9fe3-366a8fb0a5f8
457 vnf_id: 1ab2a418-9fe3-4358-bf17-411e5155535f
458 vnf_name: hackfest3charmed-vnf.1
459 vnfd_osm_id: f48163a6-c807-47bc-9682-f72caef5af85.0.1
460 - datacenter_id: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
461 datacenter_tenant_id: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
462 ip_address: 10.205.1.47
463 member_vnf_index: '2'
464 mgmt_access: '{interface_id: 538604c3-5c5e-41eb-8f84-c0239c7fabcd, required: ''False'',
465 vm_id: dd04d792-05c9-4ecc-bf28-f77384d00311}
466
467 '
468 sce_vnf_id: c4f3607a-08ff-4f75-893c-fce507e2f240
469 uuid: 00020403-e80f-4ef2-bb7e-b29669643035
470 vms:
471 - created_at: '2019-08-26T12:50:38'
472 error_msg: null
473 interfaces:
474 - external_name: vnf-mgmt
475 instance_net_id: c6bac394-fa27-4c43-bb34-42f621a9d343
476 internal_name: mgmtVM-eth0
477 ip_address: 10.205.1.47
478 mac_address: fa:16:3e:cb:9f:c7
479 sdn_port_id: null
480 type: mgmt
481 vim_info: "{vim_info: null}"
482 vim_interface_id: dcd6d2de-3c68-481c-883e-e9d38c671dc4
483 - external_name: null
484 instance_net_id: 92534d1a-e697-4372-a84d-aa0aa643b68a
485 internal_name: mgmtVM-eth1
486 ip_address: 192.168.231.1
487 mac_address: fa:16:3e:1a:89:24
488 sdn_port_id: null
489 type: bridge
490 vim_info: "{vim_info: null}"
491 vim_interface_id: 50e538e3-aba0-4652-93bb-20487f3f28e1
492 ip_address: 10.205.1.47
493 name: mgmtVM
494 related: 4543ab5d-578c-427c-9df2-affd17e21b66
495 status: ACTIVE
496 uuid: 4543ab5d-578c-427c-9df2-affd17e21b66
497 vdu_osm_id: mgmtVM
498 vim_info: "{vim_info: null}"
499 vim_name: ALF-2-mgmtVM-1
500 vim_vm_id: 248077b2-e3b8-4a37-8b72-575abb8ed912
501 - created_at: '2019-08-26T12:50:38'
502 error_msg: null
503 interfaces:
504 - external_name: null
505 instance_net_id: 92534d1a-e697-4372-a84d-aa0aa643b68a
506 internal_name: dataVM-eth0
507 ip_address: 192.168.231.3
508 mac_address: fa:16:3e:7e:ba:8c
509 sdn_port_id: null
510 type: bridge
511 vim_info: "{vim_info: null}"
512 vim_interface_id: 15274862-14ea-4527-b405-101cae8bc1a0
513 - external_name: vnf-data
514 instance_net_id: 509d576c-120f-493a-99a1-5fea99dfe041
515 internal_name: dataVM-xe0
516 ip_address: 192.168.24.4
517 mac_address: fa:16:3e:d2:e1:f5
518 sdn_port_id: null
519 type: bridge
520 vim_info: "{vim_info: null}"
521 vim_interface_id: 253ebe4e-38d5-46be-8777-dbb57510a2ec
522 name: dataVM
523 related: 6f03f16b-295a-47a1-9a69-2d069d574a33
524 status: ACTIVE
525 uuid: 6f03f16b-295a-47a1-9a69-2d069d574a33
526 vdu_osm_id: dataVM
527 vim_info: "{vim_info: null}"
528 vim_name: ALF-2-dataVM-1
529 vim_vm_id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
530 vnf_id: 0de348e3-c201-4f6a-91cc-7f957e2d5504
531 vnf_name: hackfest3charmed-vnf.2
532 vnfd_osm_id: f48163a6-c807-47bc-9682-f72caef5af85.1.2
533 """
534 db_vim_accounts_text = """
535 ---
536 - _admin:
537 created: 1566818150.3024442
538 current_operation: 0
539 deployed:
540 RO: dc51ce6c-c7f2-11e9-b9c0-02420aff0004
541 RO-account: dc5c67fa-c7f2-11e9-b9c0-02420aff0004
542 detailed-status: Done
543 modified: 1566818150.3024442
544 operationalState: ENABLED
545 operations:
546 - detailed-status: Done
547 lcmOperationType: create
548 operationParams: null
549 operationState: COMPLETED
550 startTime: 1566818150.3025382
551 statusEnteredTime: 1566818150.3025382
552 worker: 86434c2948e2
553 projects_read:
554 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
555 projects_write:
556 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
557 _id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
558 description: Openstack site 2, based on Mirantis, also called DSS9000-1, with
559 tenant tid
560 name: ost2-mrt-tid
561 schema_version: '1.1'
562 vim_password: 5g0yGX86qIhprX86YTMcpg==
563 vim_tenant_name: osm
564 vim_type: openstack
565 vim_url: http://10.95.87.162:5000/v2.0
566 vim_user: osm
567 """
568 db_vnfds_text = """
569 ---
570 - _admin:
571 created: 1566823352.7154346
572 modified: 1566823353.9295402
573 onboardingState: ONBOARDED
574 operationalState: ENABLED
575 projects_read:
576 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
577 projects_write:
578 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
579 storage:
580 descriptor: hackfest_3charmed_vnfd/hackfest_3charmed_vnfd.yaml
581 folder: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
582 fs: local
583 path: /app/storage/
584 pkg-dir: hackfest_3charmed_vnfd
585 zipfile: package.tar.gz
586 type: vnfd
587 usageState: NOT_IN_USE
588 userDefinedData: {}
589 _id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
590 connection-point:
591 - id: vnf-mgmt
592 name: vnf-mgmt
593 short-name: vnf-mgmt
594 type: VPORT
595 - id: vnf-data
596 name: vnf-data
597 short-name: vnf-data
598 type: VPORT
599 description: A VNF consisting of 2 VDUs connected to an internal VL, and one VDU
600 with cloud-init
601 id: hackfest3charmed-vnf
602 internal-vld:
603 - id: internal
604 internal-connection-point:
605 - id-ref: mgmtVM-internal
606 - id-ref: dataVM-internal
607 name: internal
608 short-name: internal
609 type: ELAN
610 logo: osm.png
611 mgmt-interface:
612 cp: vnf-mgmt
613 monitoring-param:
614 - aggregation-type: AVERAGE
615 id: monitor1
616 name: monitor1
617 vdu-monitoring-param:
618 vdu-monitoring-param-ref: dataVM_cpu_util
619 vdu-ref: dataVM
620 name: hackfest3charmed-vnf
621 scaling-group-descriptor:
622 - max-instance-count: 10
623 name: scale_dataVM
624 scaling-config-action:
625 - trigger: post-scale-out
626 vnf-config-primitive-name-ref: touch
627 - trigger: pre-scale-in
628 vnf-config-primitive-name-ref: touch
629 scaling-policy:
630 - cooldown-time: 60
631 name: auto_cpu_util_above_threshold
632 scaling-criteria:
633 - name: cpu_util_above_threshold
634 scale-in-relational-operation: LE
635 scale-in-threshold: '15.0000000000'
636 scale-out-relational-operation: GE
637 scale-out-threshold: '60.0000000000'
638 vnf-monitoring-param-ref: monitor1
639 scaling-type: automatic
640 threshold-time: 0
641 vdu:
642 - count: 1
643 vdu-id-ref: dataVM
644 short-name: hackfest3charmed-vnf
645 vdu:
646 - count: '1'
647 cloud-init-file: cloud-config.txt
648 id: mgmtVM
649 image: hackfest3-mgmt
650 interface:
651 - external-connection-point-ref: vnf-mgmt
652 name: mgmtVM-eth0
653 position: 1
654 type: EXTERNAL
655 virtual-interface:
656 type: VIRTIO
657 - internal-connection-point-ref: mgmtVM-internal
658 name: mgmtVM-eth1
659 position: 2
660 type: INTERNAL
661 virtual-interface:
662 type: VIRTIO
663 internal-connection-point:
664 - id: mgmtVM-internal
665 name: mgmtVM-internal
666 short-name: mgmtVM-internal
667 type: VPORT
668 name: mgmtVM
669 vm-flavor:
670 memory-mb: '1024'
671 storage-gb: '10'
672 vcpu-count: 1
673 - count: '1'
674 id: dataVM
675 image: hackfest3-mgmt
676 interface:
677 - internal-connection-point-ref: dataVM-internal
678 name: dataVM-eth0
679 position: 1
680 type: INTERNAL
681 virtual-interface:
682 type: VIRTIO
683 - external-connection-point-ref: vnf-data
684 name: dataVM-xe0
685 position: 2
686 type: EXTERNAL
687 virtual-interface:
688 type: VIRTIO
689 internal-connection-point:
690 - id: dataVM-internal
691 name: dataVM-internal
692 short-name: dataVM-internal
693 type: VPORT
694 monitoring-param:
695 - id: dataVM_cpu_util
696 nfvi-metric: cpu_utilization
697 name: dataVM
698 vm-flavor:
699 memory-mb: '1024'
700 storage-gb: '10'
701 vcpu-count: 1
702 version: '1.0'
703 vnf-configuration:
704 config-access:
705 ssh-access:
706 required: True
707 default-user: ubuntu
708 config-primitive:
709 - name: touch
710 parameter:
711 - data-type: STRING
712 default-value: <touch_filename2>
713 name: filename
714 initial-config-primitive:
715 - name: config
716 parameter:
717 - name: ssh-hostname
718 value: <rw_mgmt_ip>
719 - name: ssh-username
720 value: ubuntu
721 - name: ssh-password
722 value: osm4u
723 seq: '1'
724 - name: touch
725 parameter:
726 - name: filename
727 value: <touch_filename>
728 seq: '2'
729 juju:
730 charm: simple
731 """
732 db_vnfrs_text = """
733 ---
734 - _admin:
735 created: 1566823354.3668208
736 modified: 1566823354.3668208
737 nsState: NOT_INSTANTIATED
738 projects_read:
739 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
740 projects_write:
741 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
742 _id: 88d90b0c-faff-4b9f-bccd-017f33985984
743 additionalParamsForVnf:
744 touch_filename: /home/ubuntu/first-touch-1
745 touch_filename2: /home/ubuntu/second-touch-1
746 connection-point:
747 - connection-point-id: vnf-mgmt
748 id: vnf-mgmt
749 name: vnf-mgmt
750 - connection-point-id: vnf-data
751 id: vnf-data
752 name: vnf-data
753 created-time: 1566823354.36234
754 id: 88d90b0c-faff-4b9f-bccd-017f33985984
755 ip-address: 10.205.1.46
756 member-vnf-index-ref: '1'
757 nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
758 vdur:
759 - _id: f0e7d7ce-2443-4dcb-ad0b-5ab9f3b13d37
760 count-index: 0
761 interfaces:
762 - ip-address: 10.205.1.46
763 mac-address: fa:16:3e:b4:3e:b1
764 mgmt-vnf: true
765 name: mgmtVM-eth0
766 ns-vld-id: mgmt
767 - ip-address: 192.168.54.2
768 mac-address: fa:16:3e:6e:7e:78
769 name: mgmtVM-eth1
770 vnf-vld-id: internal
771 internal-connection-point:
772 - connection-point-id: mgmtVM-internal
773 id: mgmtVM-internal
774 name: mgmtVM-internal
775 ip-address: 10.205.1.46
776 name: ALF-1-mgmtVM-1
777 status: ACTIVE
778 status-detailed: null
779 vdu-id-ref: mgmtVM
780 vim-id: c2538499-4c30-41c0-acd5-80cb92f48061
781 - _id: ab453219-2d9a-45c2-864d-2c0788385028
782 count-index: 0
783 interfaces:
784 - ip-address: 192.168.54.3
785 mac-address: fa:16:3e:d9:7a:5d
786 name: dataVM-eth0
787 vnf-vld-id: internal
788 - ip-address: 192.168.24.3
789 mac-address: fa:16:3e:d1:6c:0d
790 name: dataVM-xe0
791 ns-vld-id: datanet
792 internal-connection-point:
793 - connection-point-id: dataVM-internal
794 id: dataVM-internal
795 name: dataVM-internal
796 ip-address: null
797 name: ALF-1-dataVM-1
798 status: ACTIVE
799 status-detailed: null
800 vdu-id-ref: dataVM
801 vim-id: 87973c3f-365d-4227-95c2-7a8abc74349c
802 vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
803 vld:
804 - id: internal
805 name: ALF-internal
806 status: ACTIVE
807 status-detailed: null
808 vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
809 vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
810 vnfd-ref: hackfest3charmed-vnf
811 - _admin:
812 created: 1566823354.3703845
813 modified: 1566823354.3703845
814 nsState: NOT_INSTANTIATED
815 projects_read:
816 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
817 projects_write:
818 - 25b5aebf-3da1-49ed-99de-1d2b4a86d6e4
819 _id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
820 additionalParamsForVnf:
821 touch_filename: /home/ubuntu/first-touch-2
822 touch_filename2: /home/ubuntu/second-touch-2
823 connection-point:
824 - connection-point-id: vnf-mgmt
825 id: vnf-mgmt
826 name: vnf-mgmt
827 - connection-point-id: vnf-data
828 id: vnf-data
829 name: vnf-data
830 created-time: 1566823354.36234
831 id: 1ca3bb1a-b29b-49fe-bed6-5f3076d77434
832 ip-address: 10.205.1.47
833 member-vnf-index-ref: '2'
834 nsr-id-ref: f48163a6-c807-47bc-9682-f72caef5af85
835 vdur:
836 - _id: 190b4a2c-4f85-4cfe-9406-4cef7ffb1e67
837 count-index: 0
838 interfaces:
839 - ip-address: 10.205.1.47
840 mac-address: fa:16:3e:cb:9f:c7
841 mgmt-vnf: true
842 name: mgmtVM-eth0
843 ns-vld-id: mgmt
844 - ip-address: 192.168.231.1
845 mac-address: fa:16:3e:1a:89:24
846 name: mgmtVM-eth1
847 vnf-vld-id: internal
848 internal-connection-point:
849 - connection-point-id: mgmtVM-internal
850 id: mgmtVM-internal
851 name: mgmtVM-internal
852 ip-address: 10.205.1.47
853 name: ALF-2-mgmtVM-1
854 status: ACTIVE
855 status-detailed: null
856 vdu-id-ref: mgmtVM
857 vim-id: 248077b2-e3b8-4a37-8b72-575abb8ed912
858 - _id: 889b874d-e1c3-4e75-aa45-53a9b0ddabd9
859 count-index: 0
860 interfaces:
861 - ip-address: 192.168.231.3
862 mac-address: fa:16:3e:7e:ba:8c
863 name: dataVM-eth0
864 vnf-vld-id: internal
865 - ip-address: 192.168.24.4
866 mac-address: fa:16:3e:d2:e1:f5
867 name: dataVM-xe0
868 ns-vld-id: datanet
869 internal-connection-point:
870 - connection-point-id: dataVM-internal
871 id: dataVM-internal
872 name: dataVM-internal
873 ip-address: null
874 name: ALF-2-dataVM-1
875 status: ACTIVE
876 status-detailed: null
877 vdu-id-ref: dataVM
878 vim-id: a4ce4372-e0ad-4ae3-8f9f-1c969f32e77b
879 vim-account-id: ea958ba5-4e58-4405-bf42-6e3be15d4c3a
880 vld:
881 - id: internal
882 name: ALF-internal
883 status: ACTIVE
884 status-detailed: null
885 vim-id: ff181e6d-2597-4244-b40b-bb0174bdfeb6
886 vnfd-id: 7637bcf8-cf14-42dc-ad70-c66fcf1e6e77
887 vnfd-ref: hackfest3charmed-vnf
888 """
889 db_nslcmops_scale_text = """
890 ---
891 - _admin:
892 created: 1565250912.2643092
893 modified: 1570026174.83263
894 projects_read:
895 - d3581c99-31e3-45f9-b45c-49a290faedbc
896 current_operation: '5'
897 deployed:
898 RO: d9aea288-b9b1-11e9-b19e-02420aff0006
899 RO-account: d9bb2f1c-b9b1-11e9-b19e-02420aff0006
900 detailed-status: Done
901 modified: 1565250912.2643092
902 operationalState: ENABLED
903 operations:
904 - member_vnf_index: '1'
905 primitive: touch
906 primitive_params: /home/ubuntu/last-touch-1
907 operationState: COMPLETED
908 detailed-status: Done
909 - member_vnf_index: '1'
910 primitive: touch
911 primitive_params: /home/ubuntu/last-touch-2
912 operationState: COMPLETED
913 detailed-status: Done
914 - member_vnf_index: '2'
915 primitive: touch
916 primitive_params: /home/ubuntu/last-touch-3
917 operationState: COMPLETED
918 detailed-status: Done
919 projects_read:
920 - b2d2ce4b-a1a0-4c01-847e-048632c43b40
921 projects_write:
922 - b2d2ce4b-a1a0-4c01-847e-048632c43b40
923 worker: c4055a07655b
924 deploy:
925 RO: ACTION-1570026232.061742
926 _id: 053967e8-7c1c-400f-ae82-3d45b291374b
927 lcmOperationType: scale
928 nsInstanceId: 90d9ebb7-2b5a-4b7c-bc34-a51fd7ef7b7b
929 statusEnteredTime: 1570026243.09784
930 startTime: 1570026174.8326
931 operationParams:
932 lcmOperationType: scale
933 nsInstanceId: 90d9ebb7-2b5a-4b7c-bc34-a51fd7ef7b7b
934 scaleVnfData:
935 scaleByStepData:
936 member-vnf-index: '1'
937 scaling-group-descriptor: scale_scaling_group
938 scaleVnfType: SCALE_IN
939 scaleType: SCALE_VNF
940 isAutomaticInvocation: false
941 isCancelPending: false
942 id: 053967e8-7c1c-400f-ae82-3d45b291374b
943 links:
944 nsInstance: "/osm/nslcm/v1/ns_instances/90d9ebb7-2b5a-4b7c-bc34-a51fd7ef7b7b"
945 self: "/osm/nslcm/v1/ns_lcm_op_occs/053967e8-7c1c-400f-ae82-3d45b291374b"
946 operationState: COMPLETED
947 detailed-status: done
948 """