blob: 19aebc3024dbd9f52bbf3d0e17e68708a4f586a8 [file] [log] [blame]
Rene Robert53ef77f2019-01-24 18:24:55 +01001{
2 "variables": [],
3 "info": {
4 "name": "06_Onboard_Service",
5 "_postman_id": "52d092e4-3896-404a-0ebd-e0bef781492e",
6 "description": "",
7 "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
8 },
9 "item": [
10 {
11 "name": "check service exists and get infos",
12 "event": [
13 {
14 "listen": "test",
15 "script": {
16 "type": "text/javascript",
17 "exec": [
18 "tests[\"Status code is 200\"] = responseCode.code === 200;",
19 "",
20 "var jsonData = JSON.parse(responseBody);",
21 "var service_found = false;",
22 "for (var i = 0; i < jsonData.length; i++) { ",
23 " if (jsonData[i].name === postman.getGlobalVariable(\"service\")) {",
24 " service_found = true;",
25 " postman.setGlobalVariable(\"auto_service_uuid\", \"\"+jsonData[i].uuid+\"\");",
26 " postman.setGlobalVariable(\"auto_service_invariant_uuid\", \"\"+jsonData[i].invariantUUID+\"\");",
27 " }",
28 "}",
29 "if (service_found === false) {",
30 " tests[postman.getGlobalVariable(\"service\")+\" does not exists, we continue the run\"] = true;",
31 "}",
32 "",
33 "else {",
34 " tests[postman.getGlobalVariable(\"service\")+\" already exists, stop the run\"] = true;",
35 " postman.setNextRequest(null);",
36 "}"
37 ]
38 }
39 }
40 ],
41 "request": {
42 "url": "{{url-sdc}}/sdc/v1/catalog/services",
43 "method": "GET",
44 "header": [
45 {
46 "key": "Content-Type",
47 "value": "application/json",
48 "description": ""
49 },
50 {
51 "key": "Accept",
52 "value": "application/json",
53 "description": ""
54 },
55 {
56 "key": "X-TransactionId",
57 "value": "ONAP-Test",
58 "description": ""
59 },
60 {
61 "key": "USER_ID",
62 "value": "cs0008",
63 "description": ""
64 },
65 {
66 "key": "X-FromAppId",
67 "value": "ONAP-Test",
68 "description": ""
69 },
70 {
71 "key": "Authorization",
72 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
73 "description": ""
74 },
75 {
76 "key": "x-ecomp-instanceid",
77 "value": "ONAP-Test",
78 "description": ""
79 }
80 ],
81 "body": {
82 "mode": "raw",
83 "raw": "{\"contactId\": \"cs0008\", \"vendorRelease\": \"1.0\", \"requirements\": {}, \"artifacts\": {}, \"capabilities\": {}, \"componentInstancesProperties\": {}, \"deploymentArtifacts\": {}, \"icon\": \"defaulticon\", \"vendorName\": \"test-api-license-model\", \"description\": \"vendor software product\", \"tags\": [\"test-vsp\"], \"groups\": [], \"properties\": [], \"categories\": [{\"subcategories\": [{\"normalizedName\": \"abstract\", \"name\": \"Abstract\", \"uniqueId\": \"resourceNewCategory.generic.abstract\", \"icons\": [\"icon\"]}], \"normalizedName\": \"generic\", \"name\": \"Generic\", \"uniqueId\": \"resourceNewCategory.generic\"}], \"name\": \"test-vsp\", \"toscaArtifacts\": {}, \"csarUUID\": \"F3CD5189C2DF45B4B1CFA6D6E45FD613\", \"resourceType\": \"VF\", \"csarVersion\": \"1.0\", \"componentType\": \"RESOURCE\", \"componentInstancesAttributes\": {}, \"attributes\": [], \"componentInstances\": []}"
84 },
85 "description": ""
86 },
87 "response": []
88 },
89 {
90 "name": "Create a aLaCarte Service",
91 "event": [
92 {
93 "listen": "test",
94 "script": {
95 "type": "text/javascript",
96 "exec": [
97 "tests[\"Status code is 201\"] = responseCode.code === 201;",
98 "",
99 "var jsonData = JSON.parse(responseBody);",
100 "postman.setGlobalVariable(\"auto_service_invariant_uuid\", \"\"+jsonData[\"invariantUUID\"]+\"\");",
101 "postman.setGlobalVariable(\"auto_service_uuid\", \"\"+jsonData[\"uuid\"]+\"\");",
102 "postman.setGlobalVariable(\"auto_service_unique_id\", \"\"+jsonData[\"uniqueId\"]+\"\");",
103 "",
104 "tests[\"Service version is in NOT_CERTIFIED_CHECKOUT status\"] = jsonData[\"lifecycleState\"] === \"NOT_CERTIFIED_CHECKOUT\";"
105 ]
106 }
107 }
108 ],
109 "request": {
110 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services",
111 "method": "POST",
112 "header": [
113 {
114 "key": "Content-Type",
115 "value": "application/json",
116 "description": ""
117 },
118 {
119 "key": "Accept",
120 "value": "application/json",
121 "description": ""
122 },
123 {
124 "key": "X-TransactionId",
125 "value": "ONAP-Test",
126 "description": ""
127 },
128 {
129 "key": "USER_ID",
130 "value": "cs0008",
131 "description": ""
132 },
133 {
134 "key": "X-FromAppId",
135 "value": "ONAP-Test",
136 "description": ""
137 },
138 {
139 "key": "Authorization",
140 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
141 "description": ""
142 },
143 {
144 "key": "x-ecomp-instanceid",
145 "value": "ONAP-Test",
146 "description": ""
147 }
148 ],
149 "body": {
150 "mode": "raw",
151 "raw": "{\r\n\t\"artifacts\": {},\r\n\t\"toscaArtifacts\": {},\r\n\t\"contactId\": \"cs0008\",\r\n\t\"categories\": [{\r\n\t\t\"name\": \"Network Service\",\r\n\t\t\"normalizedName\": \"network service\",\r\n\t\t\"uniqueId\": \"serviceNewCategory.network service\",\r\n\t\t\"icons\": [\"network_l_1-3\"],\r\n\t\t\"subcategories\": null,\r\n\t\t\"version\": null,\r\n\t\t\"ownerId\": null,\r\n\t\t\"empty\": false,\r\n\t\t\"type\": null\r\n\t}],\r\n\t\"description\": \"Service {{service}}\",\r\n\t\"icon\": \"defaulticon\",\r\n\t\"componentInstancesProperties\": {},\r\n\t\"componentInstancesAttributes\": {},\r\n\t\"name\": \"{{service}}\",\r\n\t\"tags\": [\"{{service}}\"],\r\n\t\"capabilities\": {},\r\n\t\"requirements\": {},\r\n\t\"deploymentArtifacts\": {},\r\n\t\"componentType\": \"SERVICE\",\r\n\t\"projectCode\": \"123456\",\r\n\t\"componentInstances\": [],\r\n\t\"properties\": [],\r\n\t\"attributes\": [],\r\n\t\"forwardingPaths\": {},\r\n\t\"ecompGeneratedNaming\": true,\r\n\t\"serviceApiArtifacts\": {},\r\n\t\"instantiationType\": \"A-la-carte\",\r\n\t\"environmentContext\": \"General_Revenue-Bearing\"\r\n}"
152 },
153 "description": ""
154 },
155 "response": []
156 },
157 {
158 "name": "check VF exists and get uuid",
159 "event": [
160 {
161 "listen": "test",
162 "script": {
163 "type": "text/javascript",
164 "exec": [
165 "tests[\"Status code is 200\"] = responseCode.code === 200;",
166 "",
167 "var jsonData = JSON.parse(responseBody);",
168 "var vf_found = false;",
169 "for (var i = 0; i < jsonData.length; i++) { ",
170 " if (jsonData[i][\"name\"] === postman.getGlobalVariable(\"vf_name\")) {",
171 " vf_found = true;",
172 " postman.setGlobalVariable(\"auto_vf_uuid\", \"\"+jsonData[i][\"uuid\"]+\"\");",
173 " postman.setGlobalVariable(\"auto_vf_invariant_uuid\", \"\"+jsonData[i][\"invariantUUID\"]+\"\");",
174 " }",
175 "}",
176 "if (vf_found === false) {",
177 " tests[postman.getGlobalVariable(\"vf_name\")+\" does not exists, we stop the run\"] = true;",
178 " postman.setNextRequest(null);",
179 "",
180 "}",
181 "",
182 "else {",
183 " tests[postman.getGlobalVariable(\"vf_name\")+\" exists, we continue the run\"] = true;",
184 "}"
185 ]
186 }
187 }
188 ],
189 "request": {
190 "url": "{{url-sdc}}/sdc/v1/catalog/resources/{{auto_vf_uuid}}/metadata",
191 "method": "GET",
192 "header": [
193 {
194 "key": "Content-Type",
195 "value": "application/json",
196 "description": ""
197 },
198 {
199 "key": "Accept",
200 "value": "application/json",
201 "description": ""
202 },
203 {
204 "key": "X-TransactionId",
205 "value": "ONAP-Test",
206 "description": ""
207 },
208 {
209 "key": "USER_ID",
210 "value": "cs0008",
211 "description": ""
212 },
213 {
214 "key": "X-FromAppId",
215 "value": "ONAP-Test",
216 "description": ""
217 },
218 {
219 "key": "Authorization",
220 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
221 "description": ""
222 },
223 {
224 "key": "x-ecomp-instanceid",
225 "value": "ONAP-Test",
226 "description": ""
227 }
228 ],
229 "body": {
230 "mode": "raw",
231 "raw": "{\"contactId\": \"cs0008\", \"vendorRelease\": \"1.0\", \"requirements\": {}, \"artifacts\": {}, \"capabilities\": {}, \"componentInstancesProperties\": {}, \"deploymentArtifacts\": {}, \"icon\": \"defaulticon\", \"vendorName\": \"test-api-license-model\", \"description\": \"vendor software product\", \"tags\": [\"test-vsp\"], \"groups\": [], \"properties\": [], \"categories\": [{\"subcategories\": [{\"normalizedName\": \"abstract\", \"name\": \"Abstract\", \"uniqueId\": \"resourceNewCategory.generic.abstract\", \"icons\": [\"icon\"]}], \"normalizedName\": \"generic\", \"name\": \"Generic\", \"uniqueId\": \"resourceNewCategory.generic\"}], \"name\": \"test-vsp\", \"toscaArtifacts\": {}, \"csarUUID\": \"F3CD5189C2DF45B4B1CFA6D6E45FD613\", \"resourceType\": \"VF\", \"csarVersion\": \"1.0\", \"componentType\": \"RESOURCE\", \"componentInstancesAttributes\": {}, \"attributes\": [], \"componentInstances\": []}"
232 },
233 "description": ""
234 },
235 "response": []
236 },
237 {
238 "name": "Get VF uniqueId",
239 "event": [
240 {
241 "listen": "test",
242 "script": {
243 "type": "text/javascript",
244 "exec": [
245 "tests[\"Status code is 200\"] = responseCode.code === 200;",
246 "",
247 "var jsonData = JSON.parse(responseBody);",
248 "var vf_found = false;",
249 "for (var i = 0; i < jsonData.resources.length; i++) { ",
250 " if (jsonData.resources[i].name === postman.getGlobalVariable(\"vf_name\")) {",
251 " vf_found = true;",
252 " postman.setGlobalVariable(\"auto_vf_unique_id\", \"\"+jsonData.resources[i].uniqueId+\"\");",
253 " }",
254 "}",
255 ""
256 ]
257 }
258 }
259 ],
260 "request": {
261 "url": {
262 "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/screen?excludeTypes=VFCMT&excludeTypes=Configuration",
263 "host": [
264 "{{url-sdc2}}"
265 ],
266 "path": [
267 "sdc1",
268 "feProxy",
269 "rest",
270 "v1",
271 "screen"
272 ],
273 "query": [
274 {
275 "key": "excludeTypes",
276 "value": "VFCMT",
277 "equals": true,
278 "description": ""
279 },
280 {
281 "key": "excludeTypes",
282 "value": "Configuration",
283 "equals": true,
284 "description": ""
285 }
286 ],
287 "variable": []
288 },
289 "method": "GET",
290 "header": [
291 {
292 "key": "Content-Type",
293 "value": "application/json",
294 "description": ""
295 },
296 {
297 "key": "Accept",
298 "value": "application/json",
299 "description": ""
300 },
301 {
302 "key": "X-TransactionId",
303 "value": "ONAP-Test",
304 "description": ""
305 },
306 {
307 "key": "USER_ID",
308 "value": "cs0008",
309 "description": ""
310 },
311 {
312 "key": "X-FromAppId",
313 "value": "ONAP-Test",
314 "description": ""
315 },
316 {
317 "key": "Authorization",
318 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
319 "description": ""
320 },
321 {
322 "key": "x-ecomp-instanceid",
323 "value": "ONAP-Test",
324 "description": ""
325 }
326 ],
327 "body": {
328 "mode": "raw",
329 "raw": "{\"contactId\": \"cs0008\", \"vendorRelease\": \"1.0\", \"requirements\": {}, \"artifacts\": {}, \"capabilities\": {}, \"componentInstancesProperties\": {}, \"deploymentArtifacts\": {}, \"icon\": \"defaulticon\", \"vendorName\": \"test-api-license-model\", \"description\": \"vendor software product\", \"tags\": [\"test-vsp\"], \"groups\": [], \"properties\": [], \"categories\": [{\"subcategories\": [{\"normalizedName\": \"abstract\", \"name\": \"Abstract\", \"uniqueId\": \"resourceNewCategory.generic.abstract\", \"icons\": [\"icon\"]}], \"normalizedName\": \"generic\", \"name\": \"Generic\", \"uniqueId\": \"resourceNewCategory.generic\"}], \"name\": \"test-vsp\", \"toscaArtifacts\": {}, \"csarUUID\": \"F3CD5189C2DF45B4B1CFA6D6E45FD613\", \"resourceType\": \"VF\", \"csarVersion\": \"1.0\", \"componentType\": \"RESOURCE\", \"componentInstancesAttributes\": {}, \"attributes\": [], \"componentInstances\": []}"
330 },
331 "description": ""
332 },
333 "response": []
334 },
335 {
336 "name": "Add VF to Service",
337 "event": [
338 {
339 "listen": "test",
340 "script": {
341 "type": "text/javascript",
342 "exec": [
343 "tests[\"Status code is 201\"] = responseCode.code === 201;"
344 ]
345 }
346 }
347 ],
348 "request": {
349 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/resourceInstance",
350 "method": "POST",
351 "header": [
352 {
353 "key": "Content-Type",
354 "value": "application/json",
355 "description": ""
356 },
357 {
358 "key": "Accept",
359 "value": "application/json",
360 "description": ""
361 },
362 {
363 "key": "X-TransactionId",
364 "value": "ONAP-Test",
365 "description": ""
366 },
367 {
368 "key": "USER_ID",
369 "value": "cs0008",
370 "description": ""
371 },
372 {
373 "key": "X-FromAppId",
374 "value": "ONAP-Test",
375 "description": ""
376 },
377 {
378 "key": "Authorization",
379 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
380 "description": ""
381 },
382 {
383 "key": "x-ecomp-instanceid",
384 "value": "ONAP-Test",
385 "description": ""
386 }
387 ],
388 "body": {
389 "mode": "raw",
390 "raw": "{\r\n\t\"name\": \"{{vf_name}}\",\r\n\t\"componentVersion\": \"1.0\",\r\n\t\"posY\": 100,\r\n\t\"posX\": 200,\r\n\t\"uniqueId\": \"{{auto_vf_unique_id}}\",\r\n\t\"originType\": \"VF\",\r\n\t\"componentUid\": \"{{auto_vf_unique_id}}\",\r\n\t\"icon\": \"defaulticon\"\r\n}\r\n"
391 },
392 "description": ""
393 },
394 "response": []
395 },
396 {
397 "name": "Submit for testing",
398 "event": [
399 {
400 "listen": "test",
401 "script": {
402 "type": "text/javascript",
403 "exec": [
404 "tests[\"Status code is 200\"] = responseCode.code === 200;"
405 ]
406 }
407 }
408 ],
409 "request": {
410 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/certificationRequest",
411 "method": "POST",
412 "header": [
413 {
414 "key": "Content-Type",
415 "value": "application/json",
416 "description": ""
417 },
418 {
419 "key": "Accept",
420 "value": "application/json",
421 "description": ""
422 },
423 {
424 "key": "X-TransactionId",
425 "value": "ONAP-Test",
426 "description": ""
427 },
428 {
429 "key": "USER_ID",
430 "value": "cs0008",
431 "description": ""
432 },
433 {
434 "key": "X-FromAppId",
435 "value": "ONAP-Test",
436 "description": ""
437 },
438 {
439 "key": "Authorization",
440 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
441 "description": ""
442 },
443 {
444 "key": "x-ecomp-instanceid",
445 "value": "ONAP-Test",
446 "description": ""
447 }
448 ],
449 "body": {
450 "mode": "raw",
451 "raw": "{\"userRemarks\":\"please test\"}"
452 },
453 "description": ""
454 },
455 "response": []
456 },
457 {
458 "name": "Start Certification",
459 "event": [
460 {
461 "listen": "test",
462 "script": {
463 "type": "text/javascript",
464 "exec": [
465 "tests[\"Status code is 200\"] = responseCode.code === 200;"
466 ]
467 }
468 }
469 ],
470 "request": {
471 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/startCertification",
472 "method": "POST",
473 "header": [
474 {
475 "key": "Content-Type",
476 "value": "application/json",
477 "description": ""
478 },
479 {
480 "key": "Accept",
481 "value": "application/json",
482 "description": ""
483 },
484 {
485 "key": "X-TransactionId",
486 "value": "ONAP-Test",
487 "description": ""
488 },
489 {
490 "key": "USER_ID",
491 "value": "jm0007",
492 "description": ""
493 },
494 {
495 "key": "X-FromAppId",
496 "value": "ONAP-Test",
497 "description": ""
498 },
499 {
500 "key": "Authorization",
501 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
502 "description": ""
503 },
504 {
505 "key": "x-ecomp-instanceid",
506 "value": "ONAP-Test",
507 "description": ""
508 }
509 ],
510 "body": {
511 "mode": "raw",
512 "raw": "{}"
513 },
514 "description": ""
515 },
516 "response": []
517 },
518 {
519 "name": "Certify",
520 "event": [
521 {
522 "listen": "test",
523 "script": {
524 "type": "text/javascript",
525 "exec": [
526 "tests[\"Status code is 200\"] = responseCode.code === 200;",
527 "",
528 "var jsonData = JSON.parse(responseBody);",
529 "postman.setGlobalVariable(\"auto_service_new_unique_id\", \"\"+jsonData[\"uniqueId\"]+\"\");"
530 ]
531 }
532 }
533 ],
534 "request": {
535 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/certify",
536 "method": "POST",
537 "header": [
538 {
539 "key": "Content-Type",
540 "value": "application/json",
541 "description": ""
542 },
543 {
544 "key": "Accept",
545 "value": "application/json",
546 "description": ""
547 },
548 {
549 "key": "X-TransactionId",
550 "value": "ONAP-Test",
551 "description": ""
552 },
553 {
554 "key": "USER_ID",
555 "value": "jm0007",
556 "description": ""
557 },
558 {
559 "key": "X-FromAppId",
560 "value": "ONAP-Test",
561 "description": ""
562 },
563 {
564 "key": "Authorization",
565 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
566 "description": ""
567 },
568 {
569 "key": "x-ecomp-instanceid",
570 "value": "ONAP-Test",
571 "description": ""
572 }
573 ],
574 "body": {
575 "mode": "raw",
576 "raw": "{\"userRemarks\":\"ok\"}"
577 },
578 "description": ""
579 },
580 "response": []
581 },
582 {
583 "name": "distribution approuve",
584 "event": [
585 {
586 "listen": "test",
587 "script": {
588 "type": "text/javascript",
589 "exec": [
590 "tests[\"Status code is 200\"] = responseCode.code === 200;"
591 ]
592 }
593 }
594 ],
595 "request": {
596 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_new_unique_id}}/distribution-state/approve",
597 "method": "POST",
598 "header": [
599 {
600 "key": "Content-Type",
601 "value": "application/json",
602 "description": ""
603 },
604 {
605 "key": "Accept",
606 "value": "application/json",
607 "description": ""
608 },
609 {
610 "key": "X-TransactionId",
611 "value": "ONAP-Test",
612 "description": ""
613 },
614 {
615 "key": "USER_ID",
616 "value": "gv0001",
617 "description": ""
618 },
619 {
620 "key": "X-FromAppId",
621 "value": "ONAP-Test",
622 "description": ""
623 },
624 {
625 "key": "Authorization",
626 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
627 "description": ""
628 },
629 {
630 "key": "x-ecomp-instanceid",
631 "value": "ONAP-Test",
632 "description": ""
633 }
634 ],
635 "body": {
636 "mode": "raw",
637 "raw": "{\"userRemarks\":\"ok\"}"
638 },
639 "description": ""
640 },
641 "response": []
642 },
643 {
644 "name": "Distribute service",
645 "event": [
646 {
647 "listen": "test",
648 "script": {
649 "type": "text/javascript",
650 "exec": [
651 "tests[\"Status code is 200\"] = responseCode.code === 200;"
652 ]
653 }
654 }
655 ],
656 "request": {
657 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_new_unique_id}}/distribution/PROD/activate",
658 "method": "POST",
659 "header": [
660 {
661 "key": "Content-Type",
662 "value": "application/json",
663 "description": ""
664 },
665 {
666 "key": "Accept",
667 "value": "application/json",
668 "description": ""
669 },
670 {
671 "key": "X-TransactionId",
672 "value": "ONAP-Test",
673 "description": ""
674 },
675 {
676 "key": "USER_ID",
677 "value": "op0001",
678 "description": ""
679 },
680 {
681 "key": "X-FromAppId",
682 "value": "ONAP-Test",
683 "description": ""
684 },
685 {
686 "key": "Authorization",
687 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=",
688 "description": ""
689 },
690 {
691 "key": "x-ecomp-instanceid",
692 "value": "ONAP-Test",
693 "description": ""
694 }
695 ],
696 "body": {
697 "mode": "raw",
698 "raw": "{}"
699 },
700 "description": ""
701 },
702 "response": []
703 },
704 {
705 "name": "check distribution",
706 "event": [
707 {
708 "listen": "test",
709 "script": {
710 "type": "text/javascript",
711 "exec": [
712 "tests[\"Status code is 200\"] = responseCode.code === 200;",
713 "",
714 "var jsonData = JSON.parse(responseBody);",
715 "var distrib_done = false;",
716 "for (var i = 0; i < jsonData.distributionStatusOfServiceList.length; i++) { ",
717 " if (jsonData.distributionStatusOfServiceList[i].deployementStatus === \"Distributed\") {",
718 " distrib_done = true;",
719 " postman.setGlobalVariable(\"auto_distribution_id\", \"\"+jsonData.distributionStatusOfServiceList[i].distributionID+\"\");",
720 "",
721 " }",
722 "}",
723 "if (distrib_done === false) {",
724 " tests[postman.getGlobalVariable(\"service\")+\" not distributed\"] = false;",
725 "}",
726 "",
727 "else {",
728 " tests[postman.getGlobalVariable(\"service\")+\" distributed\"] = true;",
729 " postman.setNextRequest(null);",
730 "}"
731 ]
732 }
733 }
734 ],
735 "request": {
736 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_uuid}}/distribution",
737 "method": "GET",
738 "header": [
739 {
740 "key": "Content-Type",
741 "value": "application/json",
742 "description": ""
743 },
744 {
745 "key": "Accept",
746 "value": "application/json",
747 "description": ""
748 },
749 {
750 "key": "X-TransactionId",
751 "value": "ONAP-Test",
752 "description": ""
753 },
754 {
755 "key": "USER_ID",
756 "value": "op0001",
757 "description": ""
758 },
759 {
760 "key": "X-FromAppId",
761 "value": "ONAP-Test",
762 "description": ""
763 },
764 {
765 "key": "Authorization",
766 "value": "Basic YmVlcDpib29w",
767 "description": ""
768 },
769 {
770 "key": "x-ecomp-instanceid",
771 "value": "ONAP-Test",
772 "description": ""
773 }
774 ],
775 "body": {
776 "mode": "raw",
777 "raw": "{}"
778 },
779 "description": ""
780 },
781 "response": []
782 },
783 {
784 "name": "check distribution fully completed",
785 "event": [
786 {
787 "listen": "test",
788 "script": {
789 "type": "text/javascript",
790 "exec": [
791 "tests[\"Status code is 200\"] = responseCode.code === 200;",
792 "",
793 "var jsonData = JSON.parse(responseBody);",
794 "var distrib_SO = false;",
795 "var distrib_AAI = false;",
796 "var distrib_SDNC = false;",
797 "",
798 "",
799 "for (var i = 0; i < jsonData.distributionStatusList.length; i++) { ",
800 " if ((jsonData.distributionStatusList[i].omfComponentID === \"SO-COpenSource-Env11\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
801 " {",
802 " distrib_SO = true;",
803 " }",
804 " if ((jsonData.distributionStatusList[i].omfComponentID === \"aai-ml\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
805 " {",
806 " distrib_AAI = true;",
807 " }",
808 " if ((jsonData.distributionStatusList[i].omfComponentID === \"sdc-COpenSource-Env11-sdnc-dockero\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
809 " {",
810 " distrib_SDNC = true;",
811 " }",
812 "}",
813 "",
814 "",
815 "if (distrib_SO === false) {",
816 " tests[postman.getGlobalVariable(\"service\")+\" not distributed to SO\"] = false;",
817 "}",
818 "",
819 "else {",
820 " tests[postman.getGlobalVariable(\"service\")+\" distributed to SO\"] = true;",
821 "}",
822 "",
823 "if (distrib_AAI === false) {",
824 " tests[postman.getGlobalVariable(\"service\")+\" not distributed to AAI\"] = false;",
825 "}",
826 "",
827 "else {",
828 " tests[postman.getGlobalVariable(\"service\")+\" distributed to AAI\"] = true;",
829 "}",
830 "",
831 "if (distrib_SDNC === false) {",
832 " tests[postman.getGlobalVariable(\"service\")+\" not distributed to SDNC\"] = false;",
833 "}",
834 "",
835 "else {",
836 " tests[postman.getGlobalVariable(\"service\")+\" distributed to SDNC\"] = true;",
837 "}"
838 ]
839 }
840 }
841 ],
842 "request": {
843 "url": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/distribution/{{auto_distribution_id}}",
844 "method": "GET",
845 "header": [
846 {
847 "key": "Content-Type",
848 "value": "application/json",
849 "description": ""
850 },
851 {
852 "key": "Accept",
853 "value": "application/json",
854 "description": ""
855 },
856 {
857 "key": "X-TransactionId",
858 "value": "ONAP-Test",
859 "description": ""
860 },
861 {
862 "key": "USER_ID",
863 "value": "op0001",
864 "description": ""
865 },
866 {
867 "key": "X-FromAppId",
868 "value": "ONAP-Test",
869 "description": ""
870 },
871 {
872 "key": "Authorization",
873 "value": "Basic YmVlcDpib29w",
874 "description": ""
875 },
876 {
877 "key": "x-ecomp-instanceid",
878 "value": "ONAP-Test",
879 "description": ""
880 }
881 ],
882 "body": {
883 "mode": "raw",
884 "raw": "{}"
885 },
886 "description": ""
887 },
888 "response": []
889 }
890 ]
891}