Update documentation
[integration.git] / test / postman / 06_Onboard_Service.postman_collection.json
1 {
2   "info": {
3     "_postman_id": "dcfc4671-1cb4-453a-8fef-97a0ba533daa",
4     "name": "06_Onboard_Service",
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\")) {",
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\")+\" does not exist yet, we continue the run\"] = true;",
31               "}",
32               "",
33               "else {",
34               "    tests[pm.environment.get(\"service\")+\" 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 an aLaCarte Service",
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}}\",\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}"
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": "Get Generic Neutron Virtual Link infos",
422       "event": [
423         {
424           "listen": "test",
425           "script": {
426             "id": "8bc90be4-f039-44cb-af75-7f3addd63bdd",
427             "exec": [
428               "var vl_found = false;",
429               "if (pm.response.code === 404) {",
430               "    tests[pm.environment.get(\"virtual_link_type\")+\" does not exists\"] = true;",
431               "}",
432               "else {",
433               "    if (pm.response.code === 200) {",
434               "        tests[\"Status code is 200\"] = pm.response.code === 200;",
435               "        }",
436               "    var jsonData = pm.response.json();",
437               "    for (var i = 0; i < jsonData.length; i++) { ",
438               "       if (jsonData[i].name === pm.environment.get(\"virtual_link_type\")) {",
439               "           vl_found = true;",
440               "           pm.environment.set(\"auto_virtual_link_uuid\", \"\"+jsonData[i].uuid+\"\");",
441               "           pm.environment.set(\"auto_virtual_link_invariant_uuid\", \"\"+jsonData[i].invariantUUID+\"\");",
442               "       }",
443               "    }",
444               "    if (vl_found === false) {",
445               "        tests[pm.environment.get(\"virtual_link_type\")+\" does not exists, we stop the run\"] = false;",
446               "        postman.setNextRequest(null);",
447               "    }",
448               "    ",
449               "    else {",
450               "        tests[pm.environment.get(\"virtual_link_type\")+\" exists, we continue the run\"] = true;",
451               "    }",
452               "}"
453             ],
454             "type": "text/javascript"
455           }
456         }
457       ],
458       "request": {
459         "method": "GET",
460         "header": [
461           {
462             "key": "Content-Type",
463             "value": "application/json"
464           },
465           {
466             "key": "Accept",
467             "value": "application/json"
468           },
469           {
470             "key": "X-TransactionId",
471             "value": "ONAP-Test"
472           },
473           {
474             "key": "USER_ID",
475             "value": "cs0008"
476           },
477           {
478             "key": "X-FromAppId",
479             "value": "ONAP-Test"
480           },
481           {
482             "key": "Authorization",
483             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
484           },
485           {
486             "key": "x-ecomp-instanceid",
487             "value": "ONAP-Test"
488           }
489         ],
490         "body": {
491           "mode": "raw",
492           "raw": ""
493         },
494         "url": {
495           "raw": "{{url-sdc}}/sdc/v1/catalog/resources?resourceType=VL",
496           "host": [
497             "{{url-sdc}}"
498           ],
499           "path": [
500             "sdc",
501             "v1",
502             "catalog",
503             "resources"
504           ],
505           "query": [
506             {
507               "key": "resourceType",
508               "value": "VL"
509             }
510           ]
511         }
512       },
513       "response": []
514     },
515     {
516       "name": "Get Generic Neutron Virtual Link uniqueId",
517       "event": [
518         {
519           "listen": "test",
520           "script": {
521             "id": "d906fb7e-04f9-445e-be5a-9644520171e1",
522             "exec": [
523               "pm.test(\"Status code is 200\", function () {",
524               "    pm.response.to.have.status(200);",
525               "});",
526               "",
527               "var jsonData = pm.response.json();",
528               "var vl_found = false;",
529               "for (var i = 0; i < jsonData.resources.length; i++) { ",
530               "   if (jsonData.resources[i].name === pm.environment.get(\"virtual_link_type\")) {",
531               "       vl_found = true;",
532               "       pm.environment.set(\"auto_virtual_link_unique_id\", \"\"+jsonData.resources[i].uniqueId+\"\");",
533               "       tests[\"Virtual Link : \"+pm.environment.get(\"virtual_link_type\")+\" found in SDC catalog with uniqueId = \"+pm.environment.get(\"auto_virtual_link_unique_id\")] = true;",
534               "   }",
535               "}",
536               ""
537             ],
538             "type": "text/javascript"
539           }
540         }
541       ],
542       "request": {
543         "method": "GET",
544         "header": [
545           {
546             "key": "Content-Type",
547             "value": "application/json"
548           },
549           {
550             "key": "Accept",
551             "value": "application/json"
552           },
553           {
554             "key": "X-TransactionId",
555             "value": "ONAP-Test"
556           },
557           {
558             "key": "USER_ID",
559             "value": "cs0008"
560           },
561           {
562             "key": "X-FromAppId",
563             "value": "ONAP-Test"
564           },
565           {
566             "key": "Authorization",
567             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
568           },
569           {
570             "key": "x-ecomp-instanceid",
571             "value": "ONAP-Test"
572           }
573         ],
574         "body": {
575           "mode": "raw",
576           "raw": ""
577         },
578         "url": {
579           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/screen?excludeTypes=VFCMT&excludeTypes=Configuration",
580           "host": [
581             "{{url-sdc2}}"
582           ],
583           "path": [
584             "sdc1",
585             "feProxy",
586             "rest",
587             "v1",
588             "screen"
589           ],
590           "query": [
591             {
592               "key": "excludeTypes",
593               "value": "VFCMT"
594             },
595             {
596               "key": "excludeTypes",
597               "value": "Configuration"
598             }
599           ]
600         }
601       },
602       "response": []
603     },
604     {
605       "name": "Add a Generic Neutron VirtualLink to Service",
606       "event": [
607         {
608           "listen": "test",
609           "script": {
610             "id": "0f07c2d5-49a1-4bf8-a3b5-6502674821af",
611             "exec": [
612               "pm.test(\"Status code is 201\", function () {",
613               "    pm.response.to.have.status(201);",
614               "});",
615               "",
616               "var jsonData = pm.response.json();",
617               "pm.environment.set(\"auto_virtual_link_customization_uuid\", \"\"+jsonData.customizationUUID+\"\");",
618               "pm.environment.set(\"auto_virtual_link_name_for_model\", \"\"+jsonData.name+\"\");",
619               "",
620               ""
621             ],
622             "type": "text/javascript"
623           }
624         }
625       ],
626       "request": {
627         "method": "POST",
628         "header": [
629           {
630             "key": "Content-Type",
631             "value": "application/json"
632           },
633           {
634             "key": "Accept",
635             "value": "application/json"
636           },
637           {
638             "key": "X-TransactionId",
639             "value": "ONAP-Test"
640           },
641           {
642             "key": "USER_ID",
643             "value": "cs0008"
644           },
645           {
646             "key": "X-FromAppId",
647             "value": "ONAP-Test"
648           },
649           {
650             "key": "Authorization",
651             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
652           },
653           {
654             "key": "x-ecomp-instanceid",
655             "value": "ONAP-Test"
656           }
657         ],
658         "body": {
659           "mode": "raw",
660           "raw": "{\r\n\t\"name\": \"{{virtual_link_type}}\",\r\n\t\"componentVersion\": \"1.0\",\r\n\t\"posY\": 200,\r\n\t\"posX\": 300,\r\n\t\"uniqueId\": \"{{auto_virtual_link_unique_id}}\",\r\n\t\"originType\": \"VL\",\r\n\t\"componentUid\": \"{{auto_virtual_link_unique_id}}\",\r\n\t\"icon\": \"defaulticon\"\r\n}\r\n"
661         },
662         "url": {
663           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/resourceInstance",
664           "host": [
665             "{{url-sdc2}}"
666           ],
667           "path": [
668             "sdc1",
669             "feProxy",
670             "rest",
671             "v1",
672             "catalog",
673             "services",
674             "{{auto_service_unique_id}}",
675             "resourceInstance"
676           ]
677         }
678       },
679       "response": []
680     },
681     {
682       "name": "Submit for testing",
683       "event": [
684         {
685           "listen": "test",
686           "script": {
687             "id": "f3215da0-5a6c-474c-9cc2-6733b36f1347",
688             "exec": [
689               "pm.test(\"Status code is 200\", function () {",
690               "    pm.response.to.have.status(200);",
691               "});",
692               "",
693               "var jsonData = pm.response.json();",
694               "",
695               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"READY_FOR_CERTIFICATION\";",
696               ""
697             ],
698             "type": "text/javascript"
699           }
700         }
701       ],
702       "request": {
703         "method": "POST",
704         "header": [
705           {
706             "key": "Content-Type",
707             "value": "application/json"
708           },
709           {
710             "key": "Accept",
711             "value": "application/json"
712           },
713           {
714             "key": "X-TransactionId",
715             "value": "ONAP-Test"
716           },
717           {
718             "key": "USER_ID",
719             "value": "cs0008"
720           },
721           {
722             "key": "X-FromAppId",
723             "value": "ONAP-Test"
724           },
725           {
726             "key": "Authorization",
727             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
728           },
729           {
730             "key": "x-ecomp-instanceid",
731             "value": "ONAP-Test"
732           }
733         ],
734         "body": {
735           "mode": "raw",
736           "raw": "{\"userRemarks\":\"please test\"}"
737         },
738         "url": {
739           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/certificationRequest",
740           "host": [
741             "{{url-sdc2}}"
742           ],
743           "path": [
744             "sdc1",
745             "feProxy",
746             "rest",
747             "v1",
748             "catalog",
749             "services",
750             "{{auto_service_unique_id}}",
751             "lifecycleState",
752             "certificationRequest"
753           ]
754         }
755       },
756       "response": []
757     },
758     {
759       "name": "Start Certification",
760       "event": [
761         {
762           "listen": "test",
763           "script": {
764             "id": "e9143951-e32e-4d93-b970-20b54ea64fd4",
765             "exec": [
766               "pm.test(\"Status code is 200\", function () {",
767               "    pm.response.to.have.status(200);",
768               "});",
769               "",
770               "var jsonData = pm.response.json();",
771               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"CERTIFICATION_IN_PROGRESS\";"
772             ],
773             "type": "text/javascript"
774           }
775         }
776       ],
777       "request": {
778         "method": "POST",
779         "header": [
780           {
781             "key": "Content-Type",
782             "value": "application/json"
783           },
784           {
785             "key": "Accept",
786             "value": "application/json"
787           },
788           {
789             "key": "X-TransactionId",
790             "value": "ONAP-Test"
791           },
792           {
793             "key": "USER_ID",
794             "value": "jm0007"
795           },
796           {
797             "key": "X-FromAppId",
798             "value": "ONAP-Test"
799           },
800           {
801             "key": "Authorization",
802             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
803           },
804           {
805             "key": "x-ecomp-instanceid",
806             "value": "ONAP-Test"
807           }
808         ],
809         "body": {
810           "mode": "raw",
811           "raw": "{}"
812         },
813         "url": {
814           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/startCertification",
815           "host": [
816             "{{url-sdc2}}"
817           ],
818           "path": [
819             "sdc1",
820             "feProxy",
821             "rest",
822             "v1",
823             "catalog",
824             "services",
825             "{{auto_service_unique_id}}",
826             "lifecycleState",
827             "startCertification"
828           ]
829         }
830       },
831       "response": []
832     },
833     {
834       "name": "Certify",
835       "event": [
836         {
837           "listen": "test",
838           "script": {
839             "id": "2ca11efa-040f-4927-b30f-e58912f0db83",
840             "exec": [
841               "pm.test(\"Status code is 200\", function () {",
842               "    pm.response.to.have.status(200);",
843               "});",
844               "",
845               "var jsonData = pm.response.json();",
846               "",
847               "tests[\"Service status is : \"+jsonData.lifecycleState] = jsonData.lifecycleState === \"CERTIFIED\";",
848               "",
849               "pm.environment.set(\"auto_service_new_unique_id\", \"\"+jsonData.uniqueId+\"\");",
850               ""
851             ],
852             "type": "text/javascript"
853           }
854         }
855       ],
856       "request": {
857         "method": "POST",
858         "header": [
859           {
860             "key": "Content-Type",
861             "value": "application/json"
862           },
863           {
864             "key": "Accept",
865             "value": "application/json"
866           },
867           {
868             "key": "X-TransactionId",
869             "value": "ONAP-Test"
870           },
871           {
872             "key": "USER_ID",
873             "value": "jm0007"
874           },
875           {
876             "key": "X-FromAppId",
877             "value": "ONAP-Test"
878           },
879           {
880             "key": "Authorization",
881             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
882           },
883           {
884             "key": "x-ecomp-instanceid",
885             "value": "ONAP-Test"
886           }
887         ],
888         "body": {
889           "mode": "raw",
890           "raw": "{\"userRemarks\":\"ok\"}"
891         },
892         "url": {
893           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/lifecycleState/certify",
894           "host": [
895             "{{url-sdc2}}"
896           ],
897           "path": [
898             "sdc1",
899             "feProxy",
900             "rest",
901             "v1",
902             "catalog",
903             "services",
904             "{{auto_service_unique_id}}",
905             "lifecycleState",
906             "certify"
907           ]
908         }
909       },
910       "response": []
911     },
912     {
913       "name": "Get Service infos by uniqueID to get new_service_unique_id",
914       "event": [
915         {
916           "listen": "test",
917           "script": {
918             "id": "cecdbf68-2176-4dc1-8321-6285d57a2e8f",
919             "exec": [
920               "pm.test(\"Status code is 200\", function () {",
921               "    pm.response.to.have.status(200);",
922               "});",
923               "",
924               "var jsonData = pm.response.json();",
925               "pm.environment.set(\"auto_service_new_unique_id\", \"\"+jsonData[\"metadata\"][\"allVersions\"][\"1.0\"]+\"\");",
926               ""
927             ],
928             "type": "text/javascript"
929           }
930         }
931       ],
932       "request": {
933         "method": "GET",
934         "header": [
935           {
936             "key": "Content-Type",
937             "value": "application/json"
938           },
939           {
940             "key": "Accept",
941             "value": "application/json"
942           },
943           {
944             "key": "X-TransactionId",
945             "value": "ONAP-Test"
946           },
947           {
948             "key": "USER_ID",
949             "value": "cs0008"
950           },
951           {
952             "key": "X-FromAppId",
953             "value": "ONAP-Test"
954           },
955           {
956             "key": "Authorization",
957             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
958           },
959           {
960             "key": "x-ecomp-instanceid",
961             "value": "ONAP-Test"
962           }
963         ],
964         "body": {
965           "mode": "raw",
966           "raw": ""
967         },
968         "url": {
969           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_unique_id}}/filteredDataByParams?include=metadata",
970           "host": [
971             "{{url-sdc2}}"
972           ],
973           "path": [
974             "sdc1",
975             "feProxy",
976             "rest",
977             "v1",
978             "catalog",
979             "services",
980             "{{auto_service_unique_id}}",
981             "filteredDataByParams"
982           ],
983           "query": [
984             {
985               "key": "include",
986               "value": "metadata"
987             }
988           ]
989         }
990       },
991       "response": []
992     },
993     {
994       "name": "Approve distribution",
995       "event": [
996         {
997           "listen": "test",
998           "script": {
999             "id": "ef5105ec-e9ea-454a-954a-3398364ecb89",
1000             "exec": [
1001               "pm.test(\"Status code is 200\", function () {",
1002               "    pm.response.to.have.status(200);",
1003               "});",
1004               "",
1005               "var jsonData = pm.response.json();",
1006               "",
1007               "tests[\"Distribution status is : \"+jsonData.distributionStatus] = jsonData.distributionStatus === \"DISTRIBUTION_APPROVED\";",
1008               ""
1009             ],
1010             "type": "text/javascript"
1011           }
1012         }
1013       ],
1014       "request": {
1015         "method": "POST",
1016         "header": [
1017           {
1018             "key": "Content-Type",
1019             "value": "application/json"
1020           },
1021           {
1022             "key": "Accept",
1023             "value": "application/json"
1024           },
1025           {
1026             "key": "X-TransactionId",
1027             "value": "ONAP-Test"
1028           },
1029           {
1030             "key": "USER_ID",
1031             "value": "gv0001"
1032           },
1033           {
1034             "key": "X-FromAppId",
1035             "value": "ONAP-Test"
1036           },
1037           {
1038             "key": "Authorization",
1039             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
1040           },
1041           {
1042             "key": "x-ecomp-instanceid",
1043             "value": "ONAP-Test"
1044           }
1045         ],
1046         "body": {
1047           "mode": "raw",
1048           "raw": "{\"userRemarks\":\"ok\"}"
1049         },
1050         "url": {
1051           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_new_unique_id}}/distribution-state/approve",
1052           "host": [
1053             "{{url-sdc2}}"
1054           ],
1055           "path": [
1056             "sdc1",
1057             "feProxy",
1058             "rest",
1059             "v1",
1060             "catalog",
1061             "services",
1062             "{{auto_service_new_unique_id}}",
1063             "distribution-state",
1064             "approve"
1065           ]
1066         }
1067       },
1068       "response": []
1069     },
1070     {
1071       "name": "Distribute service",
1072       "event": [
1073         {
1074           "listen": "test",
1075           "script": {
1076             "id": "cf7fe737-3858-4235-88b8-73640775d871",
1077             "exec": [
1078               "pm.test(\"Status code is 200\", function () {",
1079               "    pm.response.to.have.status(200);",
1080               "});",
1081               "",
1082               "var jsonData = pm.response.json();",
1083               "",
1084               "tests[\"Distribution status is : \"+jsonData.distributionStatus] = jsonData.distributionStatus === \"DISTRIBUTED\";",
1085               "",
1086               "pm.environment.set(\"auto_vf_module_model_name\", \"\"+jsonData.componentInstances[0].groupInstances[0].groupName+\"\");",
1087               "pm.environment.set(\"auto_vf_module_model_customization_name\", \"\"+jsonData.componentInstances[0].groupInstances[0].groupName+\"\");",
1088               "pm.environment.set(\"auto_vf_module_model_uuid\", \"\"+jsonData.componentInstances[0].groupInstances[0].groupUUID+\"\");",
1089               "pm.environment.set(\"auto_vf_module_model_invariant_uuid\", \"\"+jsonData.componentInstances[0].groupInstances[0].invariantUUID+\"\");",
1090               "pm.environment.set(\"auto_vf_module_model_customization_uuid\", \"\"+jsonData.componentInstances[0].groupInstances[0].customizationUUID+\"\");",
1091               "pm.environment.set(\"auto_virtual_link_model_customization_uuid\", \"\"+jsonData.componentInstances[1].customizationUUID+\"\");"
1092             ],
1093             "type": "text/javascript"
1094           }
1095         }
1096       ],
1097       "request": {
1098         "method": "POST",
1099         "header": [
1100           {
1101             "key": "Content-Type",
1102             "value": "application/json"
1103           },
1104           {
1105             "key": "Accept",
1106             "value": "application/json"
1107           },
1108           {
1109             "key": "X-TransactionId",
1110             "value": "ONAP-Test"
1111           },
1112           {
1113             "key": "USER_ID",
1114             "value": "op0001"
1115           },
1116           {
1117             "key": "X-FromAppId",
1118             "value": "ONAP-Test"
1119           },
1120           {
1121             "key": "Authorization",
1122             "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
1123           },
1124           {
1125             "key": "x-ecomp-instanceid",
1126             "value": "ONAP-Test"
1127           }
1128         ],
1129         "body": {
1130           "mode": "raw",
1131           "raw": "{}"
1132         },
1133         "url": {
1134           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_new_unique_id}}/distribution/PROD/activate",
1135           "host": [
1136             "{{url-sdc2}}"
1137           ],
1138           "path": [
1139             "sdc1",
1140             "feProxy",
1141             "rest",
1142             "v1",
1143             "catalog",
1144             "services",
1145             "{{auto_service_new_unique_id}}",
1146             "distribution",
1147             "PROD",
1148             "activate"
1149           ]
1150         }
1151       },
1152       "response": []
1153     },
1154     {
1155       "name": "check distribution",
1156       "event": [
1157         {
1158           "listen": "test",
1159           "script": {
1160             "id": "401f90b3-649f-4f3f-a2bd-ef996a54e47b",
1161             "exec": [
1162               "pm.test(\"Status code is 200\", function () {",
1163               "    pm.response.to.have.status(200);",
1164               "});",
1165               "",
1166               "var jsonData = pm.response.json();",
1167               "var distrib_done = false;",
1168               "for (var i = 0; i < jsonData.distributionStatusOfServiceList.length; i++) { ",
1169               "   if (jsonData.distributionStatusOfServiceList[i].deployementStatus === \"Distributed\") {",
1170               "       distrib_done = true;",
1171               "       pm.environment.set(\"auto_distribution_id\", \"\"+jsonData.distributionStatusOfServiceList[i].distributionID+\"\");",
1172               "",
1173               "   }",
1174               "}",
1175               "if (distrib_done === false) {",
1176               "    tests[pm.environment.get(\"service\")+\" not distributed, we stop the run\"] = false;",
1177               "    postman.setNextRequest(null);",
1178               "}",
1179               "",
1180               "else {",
1181               "    tests[pm.environment.get(\"service\")+\" distributed\"] = true;",
1182               "}"
1183             ],
1184             "type": "text/javascript"
1185           }
1186         }
1187       ],
1188       "request": {
1189         "method": "GET",
1190         "header": [
1191           {
1192             "key": "Content-Type",
1193             "value": "application/json"
1194           },
1195           {
1196             "key": "Accept",
1197             "value": "application/json"
1198           },
1199           {
1200             "key": "X-TransactionId",
1201             "value": "ONAP-Test"
1202           },
1203           {
1204             "key": "USER_ID",
1205             "value": "op0001"
1206           },
1207           {
1208             "key": "X-FromAppId",
1209             "value": "ONAP-Test"
1210           },
1211           {
1212             "key": "Authorization",
1213             "value": "Basic YmVlcDpib29w"
1214           },
1215           {
1216             "key": "x-ecomp-instanceid",
1217             "value": "ONAP-Test"
1218           }
1219         ],
1220         "body": {
1221           "mode": "raw",
1222           "raw": ""
1223         },
1224         "url": {
1225           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/{{auto_service_uuid}}/distribution",
1226           "host": [
1227             "{{url-sdc2}}"
1228           ],
1229           "path": [
1230             "sdc1",
1231             "feProxy",
1232             "rest",
1233             "v1",
1234             "catalog",
1235             "services",
1236             "{{auto_service_uuid}}",
1237             "distribution"
1238           ]
1239         }
1240       },
1241       "response": []
1242     },
1243     {
1244       "name": "check distribution fully completed after 60s",
1245       "event": [
1246         {
1247           "listen": "test",
1248           "script": {
1249             "id": "86932912-3b35-409d-bdbf-003550969f10",
1250             "exec": [
1251               "tests[\"Status code is 200\"] = responseCode.code === 200;",
1252               "",
1253               "var jsonData = pm.response.json();",
1254               "var distrib_SO = false;",
1255               "var distrib_AAI = false;",
1256               "var distrib_SDNC = false;",
1257               "var distrib_MultiCloud = false;",
1258               "var distrib_CDS = false;",
1259               "var distrib_policy = false;",
1260               "",
1261               "for (var i = 0; i < jsonData.distributionStatusList.length; i++) { ",
1262               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"SO-COpenSource-Env11\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1263               "   {",
1264               "       distrib_SO = true;",
1265               "   }",
1266               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"aai-ml\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1267               "   {",
1268               "       distrib_AAI = true;",
1269               "   }",
1270               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"sdc-COpenSource-Env11-sdnc-dockero\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1271               "   {",
1272               "       distrib_SDNC = true;",
1273               "   }",
1274               "   if ((jsonData.distributionStatusList[i].omfComponentID === \"multicloud-k8s-id\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1275               "   {",
1276               "       distrib_MultiCloud = true;",
1277               "   }",
1278               "    if ((jsonData.distributionStatusList[i].omfComponentID === \"cds\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1279               "   {",
1280               "       distrib_CDS = true;",
1281               "   }",
1282               "    if ((jsonData.distributionStatusList[i].omfComponentID === \"policy-id\") && (jsonData.distributionStatusList[i].status === \"DOWNLOAD_OK\"))",
1283               "   {",
1284               "       distrib_policy = true;",
1285               "   } ",
1286               "}",
1287               "",
1288               "",
1289               "if (distrib_SO === false) {",
1290               "    tests[pm.globals.get(\"service\")+\" not distributed to SO\"] = false;",
1291               "}",
1292               "",
1293               "else {",
1294               "    tests[pm.environment.get(\"service\")+\" distributed to SO\"] = true;",
1295               "}",
1296               "",
1297               "if (distrib_AAI === false) {",
1298               "    tests[pm.environment.get(\"service\")+\" not distributed to AAI\"] = false;",
1299               "}",
1300               "",
1301               "else {",
1302               "    tests[pm.environment.get(\"service\")+\" distributed to AAI\"] = true;",
1303               "}",
1304               "",
1305               "if (distrib_SDNC === false) {",
1306               "    tests[pm.environment.get(\"service\")+\" not distributed to SDNC\"] = false;",
1307               "}",
1308               "",
1309               "else {",
1310               "    tests[pm.environment.get(\"service\")+\" distributed to SDNC\"] = true;",
1311               "}",
1312               "if (distrib_MultiCloud === false) {",
1313               "    tests[pm.environment.get(\"service\")+\" not distributed to MultiCloud\"] = false;",
1314               "}",
1315               "",
1316               "else {",
1317               "    tests[pm.environment.get(\"service\")+\" distributed to MultiCloud\"] = true;",
1318               "}",
1319               "if (distrib_CDS === false) {",
1320               "    tests[pm.environment.get(\"service\")+\" not distributed to CDS\"] = false;",
1321               "}",
1322               "",
1323               "else {",
1324               "    tests[pm.environment.get(\"service\")+\" distributed to CDS\"] = true;",
1325               "}",
1326               "if (distrib_policy === false) {",
1327               "    tests[pm.environment.get(\"service\")+\" not distributed to Policy\"] = false;",
1328               "}",
1329               "",
1330               "else {",
1331               "    tests[pm.environment.get(\"service\")+\" distributed to Policy\"] = true;",
1332               "}",
1333               ""
1334             ],
1335             "type": "text/javascript"
1336           }
1337         },
1338         {
1339           "listen": "prerequest",
1340           "script": {
1341             "id": "9a1093c2-5c2d-47f6-892e-1a049cff8931",
1342             "exec": [
1343               "  var date = new Date();",
1344               "  var curDate = null;",
1345               "  do {",
1346               "    curDate = new Date();",
1347               "  }",
1348               "  while (curDate - date < 10000);"
1349             ],
1350             "type": "text/javascript"
1351           }
1352         }
1353       ],
1354       "request": {
1355         "method": "GET",
1356         "header": [
1357           {
1358             "key": "Content-Type",
1359             "value": "application/json"
1360           },
1361           {
1362             "key": "Accept",
1363             "value": "application/json"
1364           },
1365           {
1366             "key": "X-TransactionId",
1367             "value": "ONAP-Test"
1368           },
1369           {
1370             "key": "USER_ID",
1371             "value": "op0001"
1372           },
1373           {
1374             "key": "X-FromAppId",
1375             "value": "ONAP-Test"
1376           },
1377           {
1378             "key": "Authorization",
1379             "value": "Basic YmVlcDpib29w"
1380           },
1381           {
1382             "key": "x-ecomp-instanceid",
1383             "value": "ONAP-Test"
1384           }
1385         ],
1386         "body": {
1387           "mode": "raw",
1388           "raw": ""
1389         },
1390         "url": {
1391           "raw": "{{url-sdc2}}/sdc1/feProxy/rest/v1/catalog/services/distribution/{{auto_distribution_id}}",
1392           "host": [
1393             "{{url-sdc2}}"
1394           ],
1395           "path": [
1396             "sdc1",
1397             "feProxy",
1398             "rest",
1399             "v1",
1400             "catalog",
1401             "services",
1402             "distribution",
1403             "{{auto_distribution_id}}"
1404           ]
1405         }
1406       },
1407       "response": []
1408     }
1409   ]
1410 }