Update documentation
[integration.git] / test / postman / 06_Onboard_Service_Macro.postman_collection.json
1 {
2   "info": {
3     "_postman_id": "aa0955ae-1dd8-48b8-ac63-01117a1c6c2e",
4     "name": "06_Onboard_Service_Macro",
5     "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6   },
7   "item": [
8     {
9       "name": "check  service exists and get infos",
10       "event": [
11         {
12           "listen": "test",
13           "script": {
14             "id": "4f27b99e-23ac-4e7c-a1dc-c42ad63d6f65",
15             "exec": [
16               "pm.test(\"Status code is 200\", function () {",
17               "    pm.response.to.have.status(200);",
18               "});",
19               "",
20               "var jsonData = pm.response.json();",
21               "var service_found = false;",
22               "for (var i = 0; i < jsonData.length; i++) { ",
23               "   if (jsonData[i].name === pm.environment.get(\"service_name_macro\")) {",
24               "       service_found = true;",
25               "       pm.environment.set(\"auto_service_uuid\", \"\"+jsonData[i].uuid+\"\");",
26               "       pm.environment.set(\"auto_service_invariant_uuid\", \"\"+jsonData[i].invariantUUID+\"\");",
27               "   }",
28               "}",
29               "if (service_found === false) {",
30               "    tests[pm.environment.get(\"service_name_macro\")+\" does not exist yet, we continue the run\"] = true;",
31               "}",
32               "",
33               "else {",
34               "    tests[pm.environment.get(\"service_name_macro\")+\" already exists, stop the run\"] = false;",
35               "    postman.setNextRequest(null);",
36               "}"
37             ],
38             "type": "text/javascript"
39           }
40         }
41       ],
42       "request": {
43         "method": "GET",
44         "header": [
45           {
46             "key": "Content-Type",
47             "value": "application/json"
48           },
49           {
50             "key": "Accept",
51             "value": "application/json"
52           },
53           {
54             "key": "X-TransactionId",
55             "value": "ONAP-Test"
56           },
57           {
58             "key": "USER_ID",
59             "value": "cs0008"
60           },
61           {
62             "key": "X-FromAppId",
63             "value": "ONAP-Test"
64           },
65           {
66             "key": "Authorization",
67             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
68           },
69           {
70             "key": "x-ecomp-instanceid",
71             "value": "ONAP-Test"
72           }
73         ],
74         "body": {
75           "mode": "raw",
76           "raw": ""
77         },
78         "url": {
79           "raw": "{{url-sdc}}/sdc/v1/catalog/services",
80           "host": [
81             "{{url-sdc}}"
82           ],
83           "path": [
84             "sdc",
85             "v1",
86             "catalog",
87             "services"
88           ]
89         }
90       },
91       "response": []
92     },
93     {
94       "name": "Declare a Service in Macro mode",
95       "event": [
96         {
97           "listen": "test",
98           "script": {
99             "id": "e6118e78-e476-4049-8e81-f81b53ba625a",
100             "exec": [
101               "pm.test(\"Status code is 201\", function () {",
102               "    pm.response.to.have.status(201);",
103               "});",
104               "",
105               "var jsonData = pm.response.json();",
106               "pm.environment.set(\"auto_service_invariant_uuid\", \"\"+jsonData[\"invariantUUID\"]+\"\");",
107               "pm.environment.set(\"auto_service_uuid\", \"\"+jsonData[\"uuid\"]+\"\");",
108               "pm.environment.set(\"auto_service_unique_id\", \"\"+jsonData[\"uniqueId\"]+\"\");",
109               "",
110               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"NOT_CERTIFIED_CHECKOUT\";"
111             ],
112             "type": "text/javascript"
113           }
114         }
115       ],
116       "request": {
117         "method": "POST",
118         "header": [
119           {
120             "key": "Content-Type",
121             "value": "application/json"
122           },
123           {
124             "key": "Accept",
125             "value": "application/json"
126           },
127           {
128             "key": "X-TransactionId",
129             "value": "ONAP-Test"
130           },
131           {
132             "key": "USER_ID",
133             "value": "cs0008"
134           },
135           {
136             "key": "X-FromAppId",
137             "value": "ONAP-Test"
138           },
139           {
140             "key": "Authorization",
141             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
142           },
143           {
144             "key": "x-ecomp-instanceid",
145             "value": "ONAP-Test"
146           }
147         ],
148         "body": {
149           "mode": "raw",
150           "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_name_macro}}\",\r\n\t\"icon\": \"defaulticon\",\r\n\t\"componentInstancesProperties\": {},\r\n\t\"componentInstancesAttributes\": {},\r\n\t\"name\": \"{{service_name_macro}}\",\r\n\t\"tags\": [\"{{service_name_macro}}\"],\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\": \"Macro\",\r\n\t\"environmentContext\": \"General_Revenue-Bearing\"\r\n}"
151         },
152         "url": {
153           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services",
154           "host": [
155             "{{url-sdc2}}"
156           ],
157           "path": [
158             "sdc1",
159             "feProxy",
160             "rest",
161             "v1",
162             "catalog",
163             "services"
164           ]
165         }
166       },
167       "response": []
168     },
169     {
170       "name": "check VF exists and get uuid",
171       "event": [
172         {
173           "listen": "test",
174           "script": {
175             "id": "87b90661-aefb-4ec9-94fc-fb5277f8c283",
176             "exec": [
177               "pm.test(\"Status code is 200\", function () {",
178               "    pm.response.to.have.status(200);",
179               "});",
180               "",
181               "var jsonData = pm.response.json();",
182               "var vf_found = false;",
183               "if (jsonData.name === pm.environment.get(\"vf_name\")) {",
184               "    vf_found = true;",
185               "    pm.environment.set(\"auto_vf_uuid\", \"\"+jsonData.uuid+\"\");",
186               "    pm.environment.set(\"auto_vf_invariant_uuid\", \"\"+jsonData.invariantUUID+\"\");",
187               "    ",
188               "}",
189               "",
190               "if (vf_found === false) {",
191               "    tests[\"VF \"+pm.environment.get(\"vf_name\")+\" does not exists, we stop the run\"] = false;",
192               "    postman.setNextRequest(null);",
193               "",
194               "}",
195               "",
196               "else {",
197               "    tests[\"VF \"+pm.environment.get(\"vf_name\")+\" exists, we continue the run\"] = true;",
198               "}"
199             ],
200             "type": "text/javascript"
201           }
202         }
203       ],
204       "request": {
205         "method": "GET",
206         "header": [
207           {
208             "key": "Content-Type",
209             "value": "application/json"
210           },
211           {
212             "key": "Accept",
213             "value": "application/json"
214           },
215           {
216             "key": "X-TransactionId",
217             "value": "ONAP-Test"
218           },
219           {
220             "key": "USER_ID",
221             "value": "cs0008"
222           },
223           {
224             "key": "X-FromAppId",
225             "value": "ONAP-Test"
226           },
227           {
228             "key": "Authorization",
229             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
230           },
231           {
232             "key": "x-ecomp-instanceid",
233             "value": "ONAP-Test"
234           }
235         ],
236         "body": {
237           "mode": "raw",
238           "raw": ""
239         },
240         "url": {
241           "raw": "{{url-sdc}}/sdc/v1/catalog/resources/{{auto_vf_uuid}}/metadata",
242           "host": [
243             "{{url-sdc}}"
244           ],
245           "path": [
246             "sdc",
247             "v1",
248             "catalog",
249             "resources",
250             "{{auto_vf_uuid}}",
251             "metadata"
252           ]
253         }
254       },
255       "response": []
256     },
257     {
258       "name": "Get  VF uniqueId",
259       "event": [
260         {
261           "listen": "test",
262           "script": {
263             "id": "16c73747-c973-40d9-ba3f-6061199386ec",
264             "exec": [
265               "pm.test(\"Status code is 200\", function () {",
266               "    pm.response.to.have.status(200);",
267               "});",
268               "var jsonData = pm.response.json();",
269               "var vf_found = false;",
270               "for (var i = 0; i < jsonData.resources.length; i++) { ",
271               "   if (jsonData.resources[i].name === pm.environment.get(\"vf_name\")) {",
272               "       vf_found = true;",
273               "       pm.environment.set(\"auto_vf_unique_id\", \"\"+jsonData.resources[i].uniqueId+\"\");",
274               "   }",
275               "}",
276               ""
277             ],
278             "type": "text/javascript"
279           }
280         }
281       ],
282       "request": {
283         "method": "GET",
284         "header": [
285           {
286             "key": "Content-Type",
287             "value": "application/json"
288           },
289           {
290             "key": "Accept",
291             "value": "application/json"
292           },
293           {
294             "key": "X-TransactionId",
295             "value": "ONAP-Test"
296           },
297           {
298             "key": "USER_ID",
299             "value": "cs0008"
300           },
301           {
302             "key": "X-FromAppId",
303             "value": "ONAP-Test"
304           },
305           {
306             "key": "Authorization",
307             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
308           },
309           {
310             "key": "x-ecomp-instanceid",
311             "value": "ONAP-Test"
312           }
313         ],
314         "body": {
315           "mode": "raw",
316           "raw": ""
317         },
318         "url": {
319           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/screen?excludeTypes=VFCMT&excludeTypes=Configuration",
320           "host": [
321             "{{url-sdc2}}"
322           ],
323           "path": [
324             "sdc1",
325             "feProxy",
326             "rest",
327             "v1",
328             "screen"
329           ],
330           "query": [
331             {
332               "key": "excludeTypes",
333               "value": "VFCMT"
334             },
335             {
336               "key": "excludeTypes",
337               "value": "Configuration"
338             }
339           ]
340         }
341       },
342       "response": []
343     },
344     {
345       "name": "Add VF to Service",
346       "event": [
347         {
348           "listen": "test",
349           "script": {
350             "id": "897b4588-b2e6-4af6-b469-09ae6ea3b797",
351             "exec": [
352               "pm.test(\"Status code is 201\", function () {",
353               "    pm.response.to.have.status(201);",
354               "});",
355               "var jsonData = pm.response.json();",
356               "pm.environment.set(\"auto_vf_customization_uuid\", \"\"+jsonData.customizationUUID+\"\");",
357               "pm.environment.set(\"auto_vf_name_for_model\", \"\"+jsonData.name+\"\");",
358               "",
359               ""
360             ],
361             "type": "text/javascript"
362           }
363         }
364       ],
365       "request": {
366         "method": "POST",
367         "header": [
368           {
369             "key": "Content-Type",
370             "value": "application/json"
371           },
372           {
373             "key": "Accept",
374             "value": "application/json"
375           },
376           {
377             "key": "X-TransactionId",
378             "value": "ONAP-Test"
379           },
380           {
381             "key": "USER_ID",
382             "value": "cs0008"
383           },
384           {
385             "key": "X-FromAppId",
386             "value": "ONAP-Test"
387           },
388           {
389             "key": "Authorization",
390             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
391           },
392           {
393             "key": "x-ecomp-instanceid",
394             "value": "ONAP-Test"
395           }
396         ],
397         "body": {
398           "mode": "raw",
399           "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"
400         },
401         "url": {
402           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/resourceInstance",
403           "host": [
404             "{{url-sdc2}}"
405           ],
406           "path": [
407             "sdc1",
408             "feProxy",
409             "rest",
410             "v1",
411             "catalog",
412             "services",
413             "{{auto_service_unique_id}}",
414             "resourceInstance"
415           ]
416         }
417       },
418       "response": []
419     },
420     {
421       "name": "Submit for testing",
422       "event": [
423         {
424           "listen": "test",
425           "script": {
426             "id": "f3215da0-5a6c-474c-9cc2-6733b36f1347",
427             "exec": [
428               "pm.test(\"Status code is 200\", function () {",
429               "    pm.response.to.have.status(200);",
430               "});",
431               "",
432               "var jsonData = pm.response.json();",
433               "",
434               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"READY_FOR_CERTIFICATION\";",
435               ""
436             ],
437             "type": "text/javascript"
438           }
439         }
440       ],
441       "request": {
442         "method": "POST",
443         "header": [
444           {
445             "key": "Content-Type",
446             "value": "application/json"
447           },
448           {
449             "key": "Accept",
450             "value": "application/json"
451           },
452           {
453             "key": "X-TransactionId",
454             "value": "ONAP-Test"
455           },
456           {
457             "key": "USER_ID",
458             "value": "cs0008"
459           },
460           {
461             "key": "X-FromAppId",
462             "value": "ONAP-Test"
463           },
464           {
465             "key": "Authorization",
466             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
467           },
468           {
469             "key": "x-ecomp-instanceid",
470             "value": "ONAP-Test"
471           }
472         ],
473         "body": {
474           "mode": "raw",
475           "raw": "{\"userRemarks\":\"please test\"}"
476         },
477         "url": {
478           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/certificationRequest",
479           "host": [
480             "{{url-sdc2}}"
481           ],
482           "path": [
483             "sdc1",
484             "feProxy",
485             "rest",
486             "v1",
487             "catalog",
488             "services",
489             "{{auto_service_unique_id}}",
490             "lifecycleState",
491             "certificationRequest"
492           ]
493         }
494       },
495       "response": []
496     },
497     {
498       "name": "Start Certification",
499       "event": [
500         {
501           "listen": "test",
502           "script": {
503             "id": "e9143951-e32e-4d93-b970-20b54ea64fd4",
504             "exec": [
505               "pm.test(\"Status code is 200\", function () {",
506               "    pm.response.to.have.status(200);",
507               "});",
508               "",
509               "var jsonData = pm.response.json();",
510               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"CERTIFICATION_IN_PROGRESS\";"
511             ],
512             "type": "text/javascript"
513           }
514         }
515       ],
516       "request": {
517         "method": "POST",
518         "header": [
519           {
520             "key": "Content-Type",
521             "value": "application/json"
522           },
523           {
524             "key": "Accept",
525             "value": "application/json"
526           },
527           {
528             "key": "X-TransactionId",
529             "value": "ONAP-Test"
530           },
531           {
532             "key": "USER_ID",
533             "value": "jm0007"
534           },
535           {
536             "key": "X-FromAppId",
537             "value": "ONAP-Test"
538           },
539           {
540             "key": "Authorization",
541             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
542           },
543           {
544             "key": "x-ecomp-instanceid",
545             "value": "ONAP-Test"
546           }
547         ],
548         "body": {
549           "mode": "raw",
550           "raw": "{}"
551         },
552         "url": {
553           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/startCertification",
554           "host": [
555             "{{url-sdc2}}"
556           ],
557           "path": [
558             "sdc1",
559             "feProxy",
560             "rest",
561             "v1",
562             "catalog",
563             "services",
564             "{{auto_service_unique_id}}",
565             "lifecycleState",
566             "startCertification"
567           ]
568         }
569       },
570       "response": []
571     },
572     {
573       "name": "Certify",
574       "event": [
575         {
576           "listen": "test",
577           "script": {
578             "id": "2ca11efa-040f-4927-b30f-e58912f0db83",
579             "exec": [
580               "pm.test(\"Status code is 200\", function () {",
581               "    pm.response.to.have.status(200);",
582               "});",
583               "",
584               "var jsonData = pm.response.json();",
585               "",
586               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"CERTIFIED\";",
587               "",
588               "pm.environment.set(\"auto_service_new_unique_id\", \"\"+jsonData.uniqueId+\"\");",
589               ""
590             ],
591             "type": "text/javascript"
592           }
593         }
594       ],
595       "request": {
596         "method": "POST",
597         "header": [
598           {
599             "key": "Content-Type",
600             "value": "application/json"
601           },
602           {
603             "key": "Accept",
604             "value": "application/json"
605           },
606           {
607             "key": "X-TransactionId",
608             "value": "ONAP-Test"
609           },
610           {
611             "key": "USER_ID",
612             "value": "jm0007"
613           },
614           {
615             "key": "X-FromAppId",
616             "value": "ONAP-Test"
617           },
618           {
619             "key": "Authorization",
620             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
621           },
622           {
623             "key": "x-ecomp-instanceid",
624             "value": "ONAP-Test"
625           }
626         ],
627         "body": {
628           "mode": "raw",
629           "raw": "{\"userRemarks\":\"ok\"}"
630         },
631         "url": {
632           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/certify",
633           "host": [
634             "{{url-sdc2}}"
635           ],
636           "path": [
637             "sdc1",
638             "feProxy",
639             "rest",
640             "v1",
641             "catalog",
642             "services",
643             "{{auto_service_unique_id}}",
644             "lifecycleState",
645             "certify"
646           ]
647         }
648       },
649       "response": []
650     },
651     {
652       "name": "Get Service infos by uniqueID to get new_service_unique_id",
653       "event": [
654         {
655           "listen": "test",
656           "script": {
657             "id": "cecdbf68-2176-4dc1-8321-6285d57a2e8f",
658             "exec": [
659               "pm.test(\"Status code is 200\", function () {",
660               "    pm.response.to.have.status(200);",
661               "});",
662               "",
663               "var jsonData = pm.response.json();",
664               "pm.environment.set(\"auto_service_new_unique_id\", \"\"+jsonData[\"metadata\"][\"allVersions\"][\"1.0\"]+\"\");",
665               ""
666             ],
667             "type": "text/javascript"
668           }
669         }
670       ],
671       "request": {
672         "method": "GET",
673         "header": [
674           {
675             "key": "Content-Type",
676             "value": "application/json"
677           },
678           {
679             "key": "Accept",
680             "value": "application/json"
681           },
682           {
683             "key": "X-TransactionId",
684             "value": "ONAP-Test"
685           },
686           {
687             "key": "USER_ID",
688             "value": "cs0008"
689           },
690           {
691             "key": "X-FromAppId",
692             "value": "ONAP-Test"
693           },
694           {
695             "key": "Authorization",
696             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
697           },
698           {
699             "key": "x-ecomp-instanceid",
700             "value": "ONAP-Test"
701           }
702         ],
703         "body": {
704           "mode": "raw",
705           "raw": ""
706         },
707         "url": {
708           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/filteredDataByParams?include=metadata",
709           "host": [
710             "{{url-sdc2}}"
711           ],
712           "path": [
713             "sdc1",
714             "feProxy",
715             "rest",
716             "v1",
717             "catalog",
718             "services",
719             "{{auto_service_unique_id}}",
720             "filteredDataByParams"
721           ],
722           "query": [
723             {
724               "key": "include",
725               "value": "metadata"
726             }
727           ]
728         }
729       },
730       "response": []
731     },
732     {
733       "name": "Approve distribution",
734       "event": [
735         {
736           "listen": "test",
737           "script": {
738             "id": "ef5105ec-e9ea-454a-954a-3398364ecb89",
739             "exec": [
740               "pm.test(\"Status code is 200\", function () {",
741               "    pm.response.to.have.status(200);",
742               "});",
743               "",
744               "var jsonData = pm.response.json();",
745               "",
746               "tests[\"Distribution status is : \"+jsonData.distributionStatus] = jsonData.distributionStatus === \"DISTRIBUTION_APPROVED\";",
747               ""
748             ],
749             "type": "text/javascript"
750           }
751         }
752       ],
753       "request": {
754         "method": "POST",
755         "header": [
756           {
757             "key": "Content-Type",
758             "value": "application/json"
759           },
760           {
761             "key": "Accept",
762             "value": "application/json"
763           },
764           {
765             "key": "X-TransactionId",
766             "value": "ONAP-Test"
767           },
768           {
769             "key": "USER_ID",
770             "value": "gv0001"
771           },
772           {
773             "key": "X-FromAppId",
774             "value": "ONAP-Test"
775           },
776           {
777             "key": "Authorization",
778             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
779           },
780           {
781             "key": "x-ecomp-instanceid",
782             "value": "ONAP-Test"
783           }
784         ],
785         "body": {
786           "mode": "raw",
787           "raw": "{\"userRemarks\":\"ok\"}"
788         },
789         "url": {
790           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_new_unique_id}}/distribution-state/approve",
791           "host": [
792             "{{url-sdc2}}"
793           ],
794           "path": [
795             "sdc1",
796             "feProxy",
797             "rest",
798             "v1",
799             "catalog",
800             "services",
801             "{{auto_service_new_unique_id}}",
802             "distribution-state",
803             "approve"
804           ]
805         }
806       },
807       "response": []
808     },
809     {
810       "name": "Distribute service",
811       "event": [
812         {
813           "listen": "test",
814           "script": {
815             "id": "cf7fe737-3858-4235-88b8-73640775d871",
816             "exec": [
817               "pm.test(\"Status code is 200\", function () {",
818               "    pm.response.to.have.status(200);",
819               "});",
820               "",
821               "var jsonData = pm.response.json();",
822               "",
823               "tests[\"Distribution status is : \"+jsonData.distributionStatus] = jsonData.distributionStatus === \"DISTRIBUTED\";",
824               "",
825               "pm.environment.set(\"auto_vf_module_model_name\", \"\"+jsonData.componentInstances[0].groupInstances[0].groupName+\"\");",
826               "pm.environment.set(\"auto_vf_module_model_customization_name\", \"\"+jsonData.componentInstances[0].groupInstances[0].groupName+\"\");",
827               "pm.environment.set(\"auto_vf_module_model_uuid\", \"\"+jsonData.componentInstances[0].groupInstances[0].groupUUID+\"\");",
828               "pm.environment.set(\"auto_vf_module_model_invariant_uuid\", \"\"+jsonData.componentInstances[0].groupInstances[0].invariantUUID+\"\");",
829               "pm.environment.set(\"auto_vf_module_model_customization_uuid\", \"\"+jsonData.componentInstances[0].groupInstances[0].customizationUUID+\"\");",
830               ""
831             ],
832             "type": "text/javascript"
833           }
834         }
835       ],
836       "request": {
837         "method": "POST",
838         "header": [
839           {
840             "key": "Content-Type",
841             "value": "application/json"
842           },
843           {
844             "key": "Accept",
845             "value": "application/json"
846           },
847           {
848             "key": "X-TransactionId",
849             "value": "ONAP-Test"
850           },
851           {
852             "key": "USER_ID",
853             "value": "op0001"
854           },
855           {
856             "key": "X-FromAppId",
857             "value": "ONAP-Test"
858           },
859           {
860             "key": "Authorization",
861             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
862           },
863           {
864             "key": "x-ecomp-instanceid",
865             "value": "ONAP-Test"
866           }
867         ],
868         "body": {
869           "mode": "raw",
870           "raw": "{}"
871         },
872         "url": {
873           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_new_unique_id}}/distribution/PROD/activate",
874           "host": [
875             "{{url-sdc2}}"
876           ],
877           "path": [
878             "sdc1",
879             "feProxy",
880             "rest",
881             "v1",
882             "catalog",
883             "services",
884             "{{auto_service_new_unique_id}}",
885             "distribution",
886             "PROD",
887             "activate"
888           ]
889         }
890       },
891       "response": []
892     },
893     {
894       "name": "check distribution",
895       "event": [
896         {
897           "listen": "test",
898           "script": {
899             "id": "401f90b3-649f-4f3f-a2bd-ef996a54e47b",
900             "exec": [
901               "pm.test(\"Status code is 200\", function () {",
902               "    pm.response.to.have.status(200);",
903               "});",
904               "",
905               "var jsonData = pm.response.json();",
906               "var distrib_done = false;",
907               "for (var i = 0; i < jsonData.distributionStatusOfServiceList.length; i++) { ",
908               "   if (jsonData.distributionStatusOfServiceList[i].deployementStatus === \"Distributed\") {",
909               "       distrib_done = true;",
910               "       pm.environment.set(\"auto_distribution_id\", \"\"+jsonData.distributionStatusOfServiceList[i].distributionID+\"\");",
911               "",
912               "   }",
913               "}",
914               "if (distrib_done === false) {",
915               "    tests[pm.environment.get(\"service\")+\" not distributed, we stop the run\"] = false;",
916               "    postman.setNextRequest(null);",
917               "}",
918               "",
919               "else {",
920               "    tests[pm.environment.get(\"service\")+\" distributed\"] = true;",
921               "}"
922             ],
923             "type": "text/javascript"
924           }
925         }
926       ],
927       "request": {
928         "method": "GET",
929         "header": [
930           {
931             "key": "Content-Type",
932             "value": "application/json"
933           },
934           {
935             "key": "Accept",
936             "value": "application/json"
937           },
938           {
939             "key": "X-TransactionId",
940             "value": "ONAP-Test"
941           },
942           {
943             "key": "USER_ID",
944             "value": "op0001"
945           },
946           {
947             "key": "X-FromAppId",
948             "value": "ONAP-Test"
949           },
950           {
951             "key": "Authorization",
952             "value": "Basic YmVlcDpib29w"
953           },
954           {
955             "key": "x-ecomp-instanceid",
956             "value": "ONAP-Test"
957           }
958         ],
959         "body": {
960           "mode": "raw",
961           "raw": ""
962         },
963         "url": {
964           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_uuid}}/distribution",
965           "host": [
966             "{{url-sdc2}}"
967           ],
968           "path": [
969             "sdc1",
970             "feProxy",
971             "rest",
972             "v1",
973             "catalog",
974             "services",
975             "{{auto_service_uuid}}",
976             "distribution"
977           ]
978         }
979       },
980       "response": []
981     },
982     {
983       "name": "check distribution fully completed after 60s",
984       "event": [
985         {
986           "listen": "test",
987           "script": {
988             "id": "86932912-3b35-409d-bdbf-003550969f10",
989             "exec": [
990               "tests[\"Status code is 200\"] = responseCode.code === 200;",
991               "",
992               "var jsonData = pm.response.json();",
993               "var distrib_SO = false;",
994               "var distrib_AAI = false;",
995               "var distrib_SDNC = false;",
996               "var distrib_MultiCloud = false;",
997               "var distrib_CDS = false;",
998               "var distrib_policy = false;",
999               "",
1000               "for (var i = 0; i < jsonData.distributionStatusList.length; i++) { ",
1001               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"SO-COpenSource-Env11\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1002               "   {",
1003               "       distrib_SO = true;",
1004               "   }",
1005               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"aai-ml\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1006               "   {",
1007               "       distrib_AAI = true;",
1008               "   }",
1009               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"sdc-COpenSource-Env11-sdnc-dockero\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1010               "   {",
1011               "       distrib_SDNC = true;",
1012               "   }",
1013               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"multicloud-k8s-id\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1014               "   {",
1015               "       distrib_MultiCloud = true;",
1016               "   }",
1017               "    if ((jsonData.distributionStatusList[i].omfComponentID === \"cds\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1018               "   {",
1019               "       distrib_CDS = true;",
1020               "   }",
1021               "    if ((jsonData.distributionStatusList[i].omfComponentID === \"policy-id\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1022               "   {",
1023               "       distrib_policy = true;",
1024               "   } ",
1025               "}",
1026               "",
1027               "",
1028               "if (distrib_SO === false) {",
1029               "    tests[pm.globals.get(\"service\")+\" not distributed to SO\"] = false;",
1030               "}",
1031               "",
1032               "else {",
1033               "    tests[pm.environment.get(\"service\")+\" distributed to SO\"] = true;",
1034               "}",
1035               "",
1036               "if (distrib_AAI === false) {",
1037               "    tests[pm.environment.get(\"service\")+\" not distributed to AAI\"] = false;",
1038               "}",
1039               "",
1040               "else {",
1041               "    tests[pm.environment.get(\"service\")+\" distributed to AAI\"] = true;",
1042               "}",
1043               "",
1044               "if (distrib_SDNC === false) {",
1045               "    tests[pm.environment.get(\"service\")+\" not distributed to SDNC\"] = false;",
1046               "}",
1047               "",
1048               "else {",
1049               "    tests[pm.environment.get(\"service\")+\" distributed to SDNC\"] = true;",
1050               "}",
1051               "if (distrib_MultiCloud === false) {",
1052               "    tests[pm.environment.get(\"service\")+\" not distributed to MultiCloud\"] = false;",
1053               "}",
1054               "",
1055               "else {",
1056               "    tests[pm.environment.get(\"service\")+\" distributed to MultiCloud\"] = true;",
1057               "}",
1058               "if (distrib_CDS === false) {",
1059               "    tests[pm.environment.get(\"service\")+\" not distributed to CDS\"] = false;",
1060               "}",
1061               "",
1062               "else {",
1063               "    tests[pm.environment.get(\"service\")+\" distributed to CDS\"] = true;",
1064               "}",
1065               "if (distrib_policy === false) {",
1066               "    tests[pm.environment.get(\"service\")+\" not distributed to Policy\"] = false;",
1067               "}",
1068               "",
1069               "else {",
1070               "    tests[pm.environment.get(\"service\")+\" distributed to Policy\"] = true;",
1071               "}",
1072               ""
1073             ],
1074             "type": "text/javascript"
1075           }
1076         },
1077         {
1078           "listen": "prerequest",
1079           "script": {
1080             "id": "9a1093c2-5c2d-47f6-892e-1a049cff8931",
1081             "exec": [
1082               "  var date = new Date();",
1083               "  var curDate = null;",
1084               "  do {",
1085               "    curDate = new Date();",
1086               "  }",
1087               "  while (curDate - date < 10000);"
1088             ],
1089             "type": "text/javascript"
1090           }
1091         }
1092       ],
1093       "request": {
1094         "method": "GET",
1095         "header": [
1096           {
1097             "key": "Content-Type",
1098             "value": "application/json"
1099           },
1100           {
1101             "key": "Accept",
1102             "value": "application/json"
1103           },
1104           {
1105             "key": "X-TransactionId",
1106             "value": "ONAP-Test"
1107           },
1108           {
1109             "key": "USER_ID",
1110             "value": "op0001"
1111           },
1112           {
1113             "key": "X-FromAppId",
1114             "value": "ONAP-Test"
1115           },
1116           {
1117             "key": "Authorization",
1118             "value": "Basic YmVlcDpib29w"
1119           },
1120           {
1121             "key": "x-ecomp-instanceid",
1122             "value": "ONAP-Test"
1123           }
1124         ],
1125         "body": {
1126           "mode": "raw",
1127           "raw": ""
1128         },
1129         "url": {
1130           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/distribution/{{auto_distribution_id}}",
1131           "host": [
1132             "{{url-sdc2}}"
1133           ],
1134           "path": [
1135             "sdc1",
1136             "feProxy",
1137             "rest",
1138             "v1",
1139             "catalog",
1140             "services",
1141             "distribution",
1142             "{{auto_distribution_id}}"
1143           ]
1144         }
1145       },
1146       "response": []
1147     }
1148   ]
1149 }