Issue-ID: INT-1178
[integration.git] / test / postman / 08_Declare_Customer_Service_Subscription_Cloud.postman_collection.json
1 {
2         "info": {
3                 "_postman_id": "f60d6e53-cb99-447c-b35d-37912228ee5e",
4                 "name": "08_Declare_Customer_Service_Subscription_Cloud",
5                 "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6         },
7         "item": [
8                 {
9                         "name": "List Customers",
10                         "event": [
11                                 {
12                                         "listen": "test",
13                                         "script": {
14                                                 "id": "5c0ee107-621b-4b01-9506-cd8628b01179",
15                                                 "exec": [
16                                                         "var customer_found = false;",
17                                                         "if (pm.response.code === 404) {",
18                                                         "    tests[pm.globals.get(\"customer_name\")+\" does not exists\"] = true;",
19                                                         "}",
20                                                         "else {",
21                                                         "    if (pm.response.code === 200) {",
22                                                         "        tests[\"Status code is 200\"] = pm.response.code === 200;",
23                                                         "        }",
24                                                         "    var jsonData = pm.response.json();",
25                                                         "    for (var i = 0; i < jsonData.customer.length; i++) { ",
26                                                         "       if (jsonData.customer[i][\"global-customer-id\"] === pm.globals.get(\"customer_name\")) {",
27                                                         "           customer_found = true;",
28                                                         "           pm.globals.set(\"auto_customer_id\", \"\"+jsonData.customer[i][\"global-customer-id\"]+\"\");",
29                                                         "       }",
30                                                         "    }",
31                                                         "    if (customer_found === false) {",
32                                                         "        tests[pm.globals.get(\"customer_name\")+\" does not exists\"] = true;",
33                                                         "    }",
34                                                         "    ",
35                                                         "    else {",
36                                                         "        tests[pm.globals.get(\"customer_name\")+\" already exists, we skip creation\"] = true;",
37                                                         "        postman.setNextRequest(\"List Services from SDC catalog\");",
38                                                         "    }",
39                                                         "}"
40                                                 ],
41                                                 "type": "text/javascript"
42                                         }
43                                 }
44                         ],
45                         "request": {
46                                 "method": "GET",
47                                 "header": [
48                                         {
49                                                 "key": "Authorization",
50                                                 "value": "Basic QUFJOkFBSQ=="
51                                         },
52                                         {
53                                                 "key": "X-FromAppId",
54                                                 "value": "AAI"
55                                         },
56                                         {
57                                                 "key": "Accept",
58                                                 "value": "application/json"
59                                         },
60                                         {
61                                                 "key": "Content-Type",
62                                                 "value": "application/json"
63                                         },
64                                         {
65                                                 "key": "X-TransactionId",
66                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
67                                         }
68                                 ],
69                                 "body": {
70                                         "mode": "raw",
71                                         "raw": ""
72                                 },
73                                 "url": {
74                                         "raw": "{{url-aai}}/aai/v16/business/customers",
75                                         "host": [
76                                                 "{{url-aai}}"
77                                         ],
78                                         "path": [
79                                                 "aai",
80                                                 "v16",
81                                                 "business",
82                                                 "customers"
83                                         ]
84                                 }
85                         },
86                         "response": []
87                 },
88                 {
89                         "name": "Declare a Customer",
90                         "event": [
91                                 {
92                                         "listen": "test",
93                                         "script": {
94                                                 "id": "3f8fbd67-36f6-4ae2-a2ab-d23f1f690133",
95                                                 "exec": [
96                                                         "pm.test(\"Status code is 201\", function () {",
97                                                         "    pm.response.to.have.status(201);",
98                                                         "});"
99                                                 ],
100                                                 "type": "text/javascript"
101                                         }
102                                 }
103                         ],
104                         "request": {
105                                 "method": "PUT",
106                                 "header": [
107                                         {
108                                                 "key": "Authorization",
109                                                 "value": "Basic QUFJOkFBSQ=="
110                                         },
111                                         {
112                                                 "key": "X-FromAppId",
113                                                 "value": "AAI"
114                                         },
115                                         {
116                                                 "key": "Accept",
117                                                 "value": "application/json"
118                                         },
119                                         {
120                                                 "key": "Content-Type",
121                                                 "value": "application/json"
122                                         },
123                                         {
124                                                 "key": "X-TransactionId",
125                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
126                                         }
127                                 ],
128                                 "body": {
129                                         "mode": "raw",
130                                         "raw": "{\n    \"global-customer-id\": \"{{customer_name}}\",\n    \"subscriber-name\": \"{{customer_name}}\",\n    \"subscriber-type\": \"INFRA\"\n}"
131                                 },
132                                 "url": {
133                                         "raw": "{{url-aai}}/aai/v16/business/customers/customer/{{customer_name}}",
134                                         "host": [
135                                                 "{{url-aai}}"
136                                         ],
137                                         "path": [
138                                                 "aai",
139                                                 "v16",
140                                                 "business",
141                                                 "customers",
142                                                 "customer",
143                                                 "{{customer_name}}"
144                                         ]
145                                 }
146                         },
147                         "response": []
148                 },
149                 {
150                         "name": "Check customer creation",
151                         "event": [
152                                 {
153                                         "listen": "test",
154                                         "script": {
155                                                 "id": "e459dbcf-bf32-4aef-a9b1-5d1adfb525fc",
156                                                 "exec": [
157                                                         "pm.test(\"Status code is 200\", function () {",
158                                                         "    pm.response.to.have.status(200);",
159                                                         "});",
160                                                         "",
161                                                         "var jsonData = pm.response.json();",
162                                                         "var customer_found = false;",
163                                                         "for (var i = 0; i < jsonData.customer.length; i++) { ",
164                                                         "   if (jsonData.customer[i][\"global-customer-id\"] === pm.globals.get(\"customer_name\")) {",
165                                                         "       customer_found = true;",
166                                                         "       pm.globals.set(\"auto_customer_id\", \"\"+jsonData.customer[i][\"global-customer-id\"]+\"\");",
167                                                         "   }",
168                                                         "}",
169                                                         "tests[pm.globals.get(\"customer_name\")+\" found\"] = customer_found === true;"
170                                                 ],
171                                                 "type": "text/javascript"
172                                         }
173                                 }
174                         ],
175                         "request": {
176                                 "method": "GET",
177                                 "header": [
178                                         {
179                                                 "key": "Authorization",
180                                                 "value": "Basic QUFJOkFBSQ=="
181                                         },
182                                         {
183                                                 "key": "X-FromAppId",
184                                                 "value": "AAI"
185                                         },
186                                         {
187                                                 "key": "Accept",
188                                                 "value": "application/json"
189                                         },
190                                         {
191                                                 "key": "Content-Type",
192                                                 "value": "application/json"
193                                         },
194                                         {
195                                                 "key": "X-TransactionId",
196                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
197                                         }
198                                 ],
199                                 "body": {
200                                         "mode": "raw",
201                                         "raw": ""
202                                 },
203                                 "url": {
204                                         "raw": "{{url-aai}}/aai/v16/business/customers",
205                                         "host": [
206                                                 "{{url-aai}}"
207                                         ],
208                                         "path": [
209                                                 "aai",
210                                                 "v16",
211                                                 "business",
212                                                 "customers"
213                                         ]
214                                 }
215                         },
216                         "response": []
217                 },
218                 {
219                         "name": "List Services from SDC catalog",
220                         "event": [
221                                 {
222                                         "listen": "test",
223                                         "script": {
224                                                 "id": "a496d4dc-e343-42d4-8377-6d18d3570c82",
225                                                 "exec": [
226                                                         "pm.test(\"Status code is 200\", function () {",
227                                                         "    pm.response.to.have.status(200);",
228                                                         "});",
229                                                         "",
230                                                         "var jsonData = pm.response.json();",
231                                                         "var service_found = false;",
232                                                         "for (var i = 0; i < jsonData.length; i++) { ",
233                                                         "   if (jsonData[i].name === pm.globals.get(\"service\")) {",
234                                                         "       service_found = true;",
235                                                         "       pm.globals.set(\"auto_service_invariantUUID\", \"\"+jsonData[i].invariantUUID+\"\");",
236                                                         "   }",
237                                                         "}",
238                                                         "",
239                                                         "if (service_found === false) {",
240                                                         "    tests[\"Service : \"+pm.globals.get(\"service\")+\" does not exist in SDC catalog, we stop the run\"] = true;",
241                                                         "    postman.setNextRequest(null);",
242                                                         "}",
243                                                         "",
244                                                         "else {",
245                                                         "    tests[\"Service : \"+pm.globals.get(\"service\")+\" exists in SDC catalog, we can continue the run\"] = true;",
246                                                         "}"
247                                                 ],
248                                                 "type": "text/javascript"
249                                         }
250                                 }
251                         ],
252                         "request": {
253                                 "method": "GET",
254                                 "header": [
255                                         {
256                                                 "key": "Content-Type",
257                                                 "value": "application/json"
258                                         },
259                                         {
260                                                 "key": "Accept",
261                                                 "value": "application/json"
262                                         },
263                                         {
264                                                 "key": "X-TransactionId",
265                                                 "value": "ONAP-Test"
266                                         },
267                                         {
268                                                 "key": "USER_ID",
269                                                 "value": "cs0008"
270                                         },
271                                         {
272                                                 "key": "X-FromAppId",
273                                                 "value": "ONAP-Test"
274                                         },
275                                         {
276                                                 "key": "Authorization",
277                                                 "value": "Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
278                                         },
279                                         {
280                                                 "key": "x-ecomp-instanceid",
281                                                 "value": "ONAP-Test"
282                                         }
283                                 ],
284                                 "body": {
285                                         "mode": "raw",
286                                         "raw": ""
287                                 },
288                                 "url": {
289                                         "raw": "{{url-sdc}}/sdc/v1/catalog/services",
290                                         "host": [
291                                                 "{{url-sdc}}"
292                                         ],
293                                         "path": [
294                                                 "sdc",
295                                                 "v1",
296                                                 "catalog",
297                                                 "services"
298                                         ]
299                                 }
300                         },
301                         "response": []
302                 },
303                 {
304                         "name": "Check Subscription in AAI",
305                         "event": [
306                                 {
307                                         "listen": "test",
308                                         "script": {
309                                                 "id": "654cc91a-920b-4b79-9177-15b622749cb4",
310                                                 "exec": [
311                                                         "var service_found = false;",
312                                                         "if (pm.response.code === 404) {",
313                                                         "    tests[pm.globals.get(\"service\")+\" does not exists in AAI\"] = true;",
314                                                         "}",
315                                                         "else {",
316                                                         "    if (pm.response.code === 200) {",
317                                                         "        tests[\"Status code is 200\"] = pm.response.code === 200;",
318                                                         "        }",
319                                                         "    var jsonData = pm.response.json();",
320                                                         "    for (var i = 0; i < jsonData.service.length; i++) { ",
321                                                         "       if (jsonData.service[i][\"service-description\"] === pm.globals.get(\"service\")) {",
322                                                         "           service_found = true;",
323                                                         "       }",
324                                                         "    }",
325                                                         "    ",
326                                                         "    if (service_found === false) {",
327                                                         "        tests[\"Service subscription : \"+pm.globals.get(\"service\")+\" does not exists in AAI\"] = true;",
328                                                         "    }",
329                                                         "    ",
330                                                         "    else {",
331                                                         "        tests[\"Service subscription : \"+pm.globals.get(\"service\")+\" already exists in AAI, we skip creation\"] = true;",
332                                                         "        postman.setNextRequest(\"check cloud-region exists\");",
333                                                         "    }",
334                                                         "}"
335                                                 ],
336                                                 "type": "text/javascript"
337                                         }
338                                 }
339                         ],
340                         "request": {
341                                 "method": "GET",
342                                 "header": [
343                                         {
344                                                 "key": "Accept",
345                                                 "value": "application/json"
346                                         },
347                                         {
348                                                 "key": "Content-Type",
349                                                 "value": "application/json"
350                                         },
351                                         {
352                                                 "key": "X-FromAppId",
353                                                 "value": "AAI"
354                                         },
355                                         {
356                                                 "key": "X-TransactionId",
357                                                 "value": "get_aai_subscr"
358                                         },
359                                         {
360                                                 "key": "Authorization",
361                                                 "value": "Basic QUFJOkFBSQ=="
362                                         }
363                                 ],
364                                 "body": {
365                                         "mode": "raw",
366                                         "raw": ""
367                                 },
368                                 "url": {
369                                         "raw": "{{url-aai}}/aai/v16/service-design-and-creation/services",
370                                         "host": [
371                                                 "{{url-aai}}"
372                                         ],
373                                         "path": [
374                                                 "aai",
375                                                 "v16",
376                                                 "service-design-and-creation",
377                                                 "services"
378                                         ]
379                                 }
380                         },
381                         "response": []
382                 },
383                 {
384                         "name": "Declare subscription in AAI",
385                         "event": [
386                                 {
387                                         "listen": "test",
388                                         "script": {
389                                                 "id": "c82062d1-c394-47d8-ab3d-14f777c32971",
390                                                 "exec": [
391                                                         "pm.test(\"Status code is 201\", function () {",
392                                                         "    pm.response.to.have.status(201);",
393                                                         "});"
394                                                 ],
395                                                 "type": "text/javascript"
396                                         }
397                                 }
398                         ],
399                         "request": {
400                                 "method": "PUT",
401                                 "header": [
402                                         {
403                                                 "key": "Authorization",
404                                                 "value": "Basic QUFJOkFBSQ=="
405                                         },
406                                         {
407                                                 "key": "X-FromAppId",
408                                                 "value": "AAI"
409                                         },
410                                         {
411                                                 "key": "Accept",
412                                                 "value": "application/json"
413                                         },
414                                         {
415                                                 "key": "X-TransactionId",
416                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
417                                         },
418                                         {
419                                                 "key": "Content-Type",
420                                                 "value": "application/json"
421                                         }
422                                 ],
423                                 "body": {
424                                         "mode": "raw",
425                                         "raw": "{\r\n\"service-id\": \"{{auto_service_invariantUUID}}\",\r\n\"service-description\": \"{{service}}\"\r\n}"
426                                 },
427                                 "url": {
428                                         "raw": "{{url-aai}}/aai/v16/service-design-and-creation/services/service/{{auto_service_invariantUUID}}",
429                                         "host": [
430                                                 "{{url-aai}}"
431                                         ],
432                                         "path": [
433                                                 "aai",
434                                                 "v16",
435                                                 "service-design-and-creation",
436                                                 "services",
437                                                 "service",
438                                                 "{{auto_service_invariantUUID}}"
439                                         ]
440                                 }
441                         },
442                         "response": []
443                 },
444                 {
445                         "name": "Check Subscription creation in AAI",
446                         "event": [
447                                 {
448                                         "listen": "test",
449                                         "script": {
450                                                 "id": "ddb1ab24-cbf4-4d50-a237-614143e66a66",
451                                                 "exec": [
452                                                         "pm.test(\"Status code is 200\", function () {",
453                                                         "    pm.response.to.have.status(200);",
454                                                         "});",
455                                                         "var jsonData = pm.response.json();",
456                                                         "var service_found = false;",
457                                                         "for (var i = 0; i < jsonData.service.length; i++) { ",
458                                                         "   if (jsonData.service[i][\"service-description\"] === pm.globals.get(\"service\")) {",
459                                                         "       service_found = true;",
460                                                         "       pm.globals.set(\"auto_service_resource_version\", \"\"+jsonData.service[i][\"resource-version\"]+\"\");",
461                                                         "   }",
462                                                         "}",
463                                                         "tests[\"Service subscription : \"+pm.globals.get(\"service\")+\" found in AAI\"] = service_found === true;"
464                                                 ],
465                                                 "type": "text/javascript"
466                                         }
467                                 }
468                         ],
469                         "request": {
470                                 "method": "GET",
471                                 "header": [
472                                         {
473                                                 "key": "Accept",
474                                                 "value": "application/json"
475                                         },
476                                         {
477                                                 "key": "Content-Type",
478                                                 "value": "application/json"
479                                         },
480                                         {
481                                                 "key": "X-FromAppId",
482                                                 "value": "AAI"
483                                         },
484                                         {
485                                                 "key": "X-TransactionId",
486                                                 "value": "get_aai_subscr"
487                                         },
488                                         {
489                                                 "key": "Authorization",
490                                                 "value": "Basic QUFJOkFBSQ=="
491                                         }
492                                 ],
493                                 "body": {
494                                         "mode": "raw",
495                                         "raw": ""
496                                 },
497                                 "url": {
498                                         "raw": "{{url-aai}}/aai/v16/service-design-and-creation/services",
499                                         "host": [
500                                                 "{{url-aai}}"
501                                         ],
502                                         "path": [
503                                                 "aai",
504                                                 "v16",
505                                                 "service-design-and-creation",
506                                                 "services"
507                                         ]
508                                 }
509                         },
510                         "response": []
511                 },
512                 {
513                         "name": "check complex exists",
514                         "event": [
515                                 {
516                                         "listen": "test",
517                                         "script": {
518                                                 "id": "12df16bd-e361-45ec-8663-b8a404bb13ce",
519                                                 "exec": [
520                                                         "var complex_found = false;",
521                                                         "if (pm.response.code === 404) {",
522                                                         "    tests[pm.globals.get(\"complex_name\")+\" does not exists in AAI\"] = true;",
523                                                         "}",
524                                                         "else {",
525                                                         "    if (pm.response.code === 200) {",
526                                                         "        tests[\"Status code is 200\"] = pm.response.code === 200;",
527                                                         "        }",
528                                                         "var jsonData = pm.response.json();",
529                                                         "for (var i = 0; i < jsonData[\"complex\"].length; i++) { ",
530                                                         "   if (jsonData[\"complex\"][i][\"complex-name\"] === pm.globals.get(\"complex_name\")) {",
531                                                         "       complex_found = true;",
532                                                         "   }",
533                                                         "}",
534                                                         "",
535                                                         "if (complex_found === false) {",
536                                                         "    tests[pm.globals.get(\"complex_name\")+\" does not exist yet\"] = true;",
537                                                         "}",
538                                                         "else {",
539                                                         "    tests[pm.globals.get(\"complex_name\")+\" already exists, we skip creation\"] = true;",
540                                                         "    postman.setNextRequest(\"check cloud-region exists\");",
541                                                         "}",
542                                                         "}"
543                                                 ],
544                                                 "type": "text/javascript"
545                                         }
546                                 }
547                         ],
548                         "request": {
549                                 "method": "GET",
550                                 "header": [
551                                         {
552                                                 "key": "Authorization",
553                                                 "value": "Basic QUFJOkFBSQ=="
554                                         },
555                                         {
556                                                 "key": "X-FromAppId",
557                                                 "value": "AAI"
558                                         },
559                                         {
560                                                 "key": "Accept",
561                                                 "value": "application/json"
562                                         },
563                                         {
564                                                 "key": "X-TransactionId",
565                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
566                                         }
567                                 ],
568                                 "body": {
569                                         "mode": "raw",
570                                         "raw": ""
571                                 },
572                                 "url": {
573                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/complexes",
574                                         "host": [
575                                                 "{{url-aai}}"
576                                         ],
577                                         "path": [
578                                                 "aai",
579                                                 "v16",
580                                                 "cloud-infrastructure",
581                                                 "complexes"
582                                         ]
583                                 }
584                         },
585                         "response": []
586                 },
587                 {
588                         "name": "create Complex",
589                         "event": [
590                                 {
591                                         "listen": "test",
592                                         "script": {
593                                                 "id": "c6021ddb-13b1-472b-acdd-55c4f550461f",
594                                                 "exec": [
595                                                         "pm.test(\"Status code is 201\", function () {",
596                                                         "    pm.response.to.have.status(201);",
597                                                         "});"
598                                                 ],
599                                                 "type": "text/javascript"
600                                         }
601                                 }
602                         ],
603                         "request": {
604                                 "method": "PUT",
605                                 "header": [
606                                         {
607                                                 "key": "Authorization",
608                                                 "value": "Basic QUFJOkFBSQ=="
609                                         },
610                                         {
611                                                 "key": "X-FromAppId",
612                                                 "value": "AAI"
613                                         },
614                                         {
615                                                 "key": "Accept",
616                                                 "value": "application/json"
617                                         },
618                                         {
619                                                 "key": "X-TransactionId",
620                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
621                                         },
622                                         {
623                                                 "key": "Content-Type",
624                                                 "value": "application/json"
625                                         }
626                                 ],
627                                 "body": {
628                                         "mode": "raw",
629                                         "raw": "{\n    \"physical-location-id\": \"{{complex_name}}\",\n    \"data-center-code\": \"\",\n    \"complex-name\": \"{{complex_name}}\",\n    \"identity-url\": \"\",\n    \"physical-location-type\": \"\",\n    \"street1\": \"\",\n    \"street2\": \"\",\n    \"city\": \"\",\n    \"state\": \"\",\n    \"postal-code\": \"\",\n    \"country\": \"\",\n    \"region\": \"\",\n    \"latitude\": \"\",\n    \"longitude\": \"\",\n    \"elevation\": \"\",\n    \"lata\": \"\"\n}"
630                                 },
631                                 "url": {
632                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/complexes/complex/{{complex_name}}",
633                                         "host": [
634                                                 "{{url-aai}}"
635                                         ],
636                                         "path": [
637                                                 "aai",
638                                                 "v16",
639                                                 "cloud-infrastructure",
640                                                 "complexes",
641                                                 "complex",
642                                                 "{{complex_name}}"
643                                         ]
644                                 }
645                         },
646                         "response": []
647                 },
648                 {
649                         "name": "Check complex creation",
650                         "event": [
651                                 {
652                                         "listen": "test",
653                                         "script": {
654                                                 "id": "eed67b4e-d3b5-4ba7-a254-6e8d44e10be0",
655                                                 "exec": [
656                                                         "pm.test(\"Status code is 200\", function () {",
657                                                         "    pm.response.to.have.status(200);",
658                                                         "});",
659                                                         "",
660                                                         "var jsonData = pm.response.json();",
661                                                         "var complex_found = false;",
662                                                         "for (var i = 0; i < jsonData[\"complex\"].length; i++) { ",
663                                                         "   if (jsonData[\"complex\"][i][\"complex-name\"] === pm.globals.get(\"complex_name\")) {",
664                                                         "       complex_found = true;",
665                                                         "   }",
666                                                         "}",
667                                                         "tests[\"Complex : \"+pm.globals.get(\"complex_name\")+\" found\"] = complex_found === true;",
668                                                         ""
669                                                 ],
670                                                 "type": "text/javascript"
671                                         }
672                                 }
673                         ],
674                         "request": {
675                                 "method": "GET",
676                                 "header": [
677                                         {
678                                                 "key": "Authorization",
679                                                 "value": "Basic QUFJOkFBSQ=="
680                                         },
681                                         {
682                                                 "key": "X-FromAppId",
683                                                 "value": "AAI"
684                                         },
685                                         {
686                                                 "key": "Accept",
687                                                 "value": "application/json"
688                                         },
689                                         {
690                                                 "key": "X-TransactionId",
691                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
692                                         }
693                                 ],
694                                 "body": {
695                                         "mode": "raw",
696                                         "raw": ""
697                                 },
698                                 "url": {
699                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/complexes",
700                                         "host": [
701                                                 "{{url-aai}}"
702                                         ],
703                                         "path": [
704                                                 "aai",
705                                                 "v16",
706                                                 "cloud-infrastructure",
707                                                 "complexes"
708                                         ]
709                                 }
710                         },
711                         "response": []
712                 },
713                 {
714                         "name": "check cloud-region exists",
715                         "event": [
716                                 {
717                                         "listen": "test",
718                                         "script": {
719                                                 "id": "705695aa-21b8-4b3f-9e00-4f46178f37d0",
720                                                 "exec": [
721                                                         "var region_found = false;",
722                                                         "if (pm.response.code === 404) {",
723                                                         "    tests[pm.globals.get(\"onap_cloud_region_id\")+\" does not exists in AAI\"] = true;",
724                                                         "}",
725                                                         "else {",
726                                                         "    if (pm.response.code === 200) {",
727                                                         "        tests[\"Status code is 200\"] = pm.response.code === 200;",
728                                                         "        }",
729                                                         "var jsonData = pm.response.json();",
730                                                         "for (var i = 0; i < jsonData[\"cloud-region\"].length; i++) { ",
731                                                         "   if ((jsonData[\"cloud-region\"][i][\"cloud-region-id\"] === pm.globals.get(\"onap_cloud_region_id\")) && (jsonData[\"cloud-region\"][i][\"cloud-owner\"] === pm.globals.get(\"cloud_owner_name\"))) {",
732                                                         "       region_found = true;",
733                                                         "   }",
734                                                         "}",
735                                                         "",
736                                                         "if (region_found === false) {",
737                                                         "    tests[pm.globals.get(\"onap_cloud_region_id\")+\" does not exist yet for cloudOwner \"+pm.globals.get(\"cloud_owner_name\")] = true;",
738                                                         "}",
739                                                         "else {",
740                                                         "    tests[pm.globals.get(\"onap_cloud_region_id\")+\" already exists, we skip creation\"] = true;",
741                                                         "    postman.setNextRequest(\"check tenant in cloud region\");",
742                                                         "}",
743                                                         "}"
744                                                 ],
745                                                 "type": "text/javascript"
746                                         }
747                                 }
748                         ],
749                         "request": {
750                                 "method": "GET",
751                                 "header": [
752                                         {
753                                                 "key": "Authorization",
754                                                 "value": "Basic QUFJOkFBSQ=="
755                                         },
756                                         {
757                                                 "key": "X-FromAppId",
758                                                 "value": "AAI"
759                                         },
760                                         {
761                                                 "key": "Accept",
762                                                 "value": "application/json"
763                                         },
764                                         {
765                                                 "key": "X-TransactionId",
766                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
767                                         }
768                                 ],
769                                 "body": {
770                                         "mode": "raw",
771                                         "raw": ""
772                                 },
773                                 "url": {
774                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions",
775                                         "host": [
776                                                 "{{url-aai}}"
777                                         ],
778                                         "path": [
779                                                 "aai",
780                                                 "v16",
781                                                 "cloud-infrastructure",
782                                                 "cloud-regions"
783                                         ]
784                                 }
785                         },
786                         "response": []
787                 },
788                 {
789                         "name": "create cloud-region",
790                         "event": [
791                                 {
792                                         "listen": "test",
793                                         "script": {
794                                                 "id": "41f77bea-f6cd-4bd9-961d-b02f42751db0",
795                                                 "exec": [
796                                                         "pm.test(\"Status code is 201\", function () {",
797                                                         "    pm.response.to.have.status(201);",
798                                                         "});"
799                                                 ],
800                                                 "type": "text/javascript"
801                                         }
802                                 }
803                         ],
804                         "request": {
805                                 "method": "PUT",
806                                 "header": [
807                                         {
808                                                 "key": "Authorization",
809                                                 "value": "Basic QUFJOkFBSQ=="
810                                         },
811                                         {
812                                                 "key": "X-FromAppId",
813                                                 "value": "AAI"
814                                         },
815                                         {
816                                                 "key": "Accept",
817                                                 "value": "application/json"
818                                         },
819                                         {
820                                                 "key": "X-TransactionId",
821                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
822                                         },
823                                         {
824                                                 "key": "Content-Type",
825                                                 "value": "application/json"
826                                         }
827                                 ],
828                                 "body": {
829                                         "mode": "raw",
830                                         "raw": "{\r\n    \"cloud-owner\": \"{{cloud_owner_name}}\",\r\n    \"cloud-region-id\": \"{{onap_cloud_region_id}}\",\r\n    \"cloud-type\": \"{{cloud_type}}\",\r\n    \"owner-defined-type\": \"\",\r\n    \"cloud-region-version\": \"{{cloud_region_version}}\",\r\n    \"cloud-zone\": \"\",\r\n    \"complex-name\": \"{{complex_name}}\",\r\n    \"identity-url\": \"WillBeUpdatedByMultiCloud\",\r\n    \"sriov-automation\": false,\r\n    \"cloud-extra-info\": \"{\\\"openstack-region-id\\\":\\\"{{openstack_region_id}}\\\"}\",\r\n    \"esr-system-info-list\": {\r\n    \t\"esr-system-info\": [\r\n            {\r\n            \"esr-system-info-id\": \"{{random_uuid}}\",\r\n            \"service-url\": \"{{keystone_url}}\",\r\n            \"user-name\": \"{{user_name}}\",\r\n            \"password\": \"{{keystone_password}}\",\r\n            \"system-type\": \"VIM\",\r\n            \"ssl-insecure\": true,\r\n            \"cloud-domain\": \"Default\",\r\n            \"default-tenant\": \"{{tenant_name}}\",\r\n            \"system-status\": \"active\"\r\n            }\r\n        ]\r\n    }\r\n}"
831                                 },
832                                 "url": {
833                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{{cloud_owner_name}}/{{onap_cloud_region_id}}",
834                                         "host": [
835                                                 "{{url-aai}}"
836                                         ],
837                                         "path": [
838                                                 "aai",
839                                                 "v16",
840                                                 "cloud-infrastructure",
841                                                 "cloud-regions",
842                                                 "cloud-region",
843                                                 "{{cloud_owner_name}}",
844                                                 "{{onap_cloud_region_id}}"
845                                         ]
846                                 }
847                         },
848                         "response": []
849                 },
850                 {
851                         "name": "Check Cloud-region creation",
852                         "event": [
853                                 {
854                                         "listen": "test",
855                                         "script": {
856                                                 "id": "a386bb95-c0fa-49b2-9837-efcdc6b40a86",
857                                                 "exec": [
858                                                         "pm.test(\"Status code is 200\", function () {",
859                                                         "    pm.response.to.have.status(200);",
860                                                         "});",
861                                                         "var jsonData = pm.response.json();",
862                                                         "var region_found = false;",
863                                                         "for (var i = 0; i < jsonData[\"cloud-region\"].length; i++) { ",
864                                                         "   if (jsonData[\"cloud-region\"][i][\"cloud-region-id\"] === pm.globals.get(\"onap_cloud_region_id\")) {",
865                                                         "       region_found = true;",
866                                                         "   }",
867                                                         "}",
868                                                         "tests[\"Cloud-Region : \"+pm.globals.get(\"onap_cloud_region_id\")+\" found\"] = region_found === true;",
869                                                         ""
870                                                 ],
871                                                 "type": "text/javascript"
872                                         }
873                                 }
874                         ],
875                         "request": {
876                                 "method": "GET",
877                                 "header": [
878                                         {
879                                                 "key": "Authorization",
880                                                 "value": "Basic QUFJOkFBSQ=="
881                                         },
882                                         {
883                                                 "key": "X-FromAppId",
884                                                 "value": "AAI"
885                                         },
886                                         {
887                                                 "key": "Accept",
888                                                 "value": "application/json"
889                                         },
890                                         {
891                                                 "key": "X-TransactionId",
892                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
893                                         }
894                                 ],
895                                 "body": {
896                                         "mode": "raw",
897                                         "raw": ""
898                                 },
899                                 "url": {
900                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions",
901                                         "host": [
902                                                 "{{url-aai}}"
903                                         ],
904                                         "path": [
905                                                 "aai",
906                                                 "v16",
907                                                 "cloud-infrastructure",
908                                                 "cloud-regions"
909                                         ]
910                                 }
911                         },
912                         "response": []
913                 },
914                 {
915                         "name": "associate Cloud-region to a complex",
916                         "event": [
917                                 {
918                                         "listen": "test",
919                                         "script": {
920                                                 "id": "ad16fc86-7954-434f-bc45-25710ebeee57",
921                                                 "exec": [
922                                                         "tests[\"Status code is 200 : cloud-region associated to complex\"] = pm.response.code === 200;",
923                                                         ""
924                                                 ],
925                                                 "type": "text/javascript"
926                                         }
927                                 }
928                         ],
929                         "request": {
930                                 "method": "PUT",
931                                 "header": [
932                                         {
933                                                 "key": "Authorization",
934                                                 "value": "Basic QUFJOkFBSQ=="
935                                         },
936                                         {
937                                                 "key": "X-FromAppId",
938                                                 "value": "AAI"
939                                         },
940                                         {
941                                                 "key": "Accept",
942                                                 "value": "application/json"
943                                         },
944                                         {
945                                                 "key": "X-TransactionId",
946                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
947                                         },
948                                         {
949                                                 "key": "Content-Type",
950                                                 "value": "application/json"
951                                         }
952                                 ],
953                                 "body": {
954                                         "mode": "raw",
955                                         "raw": "{\n    \"related-to\": \"complex\",\n    \"related-link\": \"/aai/v16/cloud-infrastructure/complexes/complex/{{complex_name}}\",\n    \"relationship-data\": [\n        {\n        \"relationship-key\": \"complex.physical-location-id\",\n        \"relationship-value\": \"{{complex_name}}\"\n        }\n        ]\n    }"
956                                 },
957                                 "url": {
958                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{{cloud_owner_name}}/{{onap_cloud_region_id}}/relationship-list/relationship",
959                                         "host": [
960                                                 "{{url-aai}}"
961                                         ],
962                                         "path": [
963                                                 "aai",
964                                                 "v16",
965                                                 "cloud-infrastructure",
966                                                 "cloud-regions",
967                                                 "cloud-region",
968                                                 "{{cloud_owner_name}}",
969                                                 "{{onap_cloud_region_id}}",
970                                                 "relationship-list",
971                                                 "relationship"
972                                         ]
973                                 }
974                         },
975                         "response": []
976                 },
977                 {
978                         "name": "check tenant in cloud region",
979                         "event": [
980                                 {
981                                         "listen": "test",
982                                         "script": {
983                                                 "id": "4367f5c4-0bf0-4e09-bc58-9a8bd6578685",
984                                                 "exec": [
985                                                         "var tenant_found = false;",
986                                                         "if (pm.response.code === 404) {",
987                                                         "    tests[pm.globals.get(\"tenant_name\")+\" does not exists in AAI\"] = true;",
988                                                         "}",
989                                                         "else {",
990                                                         "    if (pm.response.code === 200) {",
991                                                         "        tests[\"Status code is 200\"] = pm.response.code === 200;",
992                                                         "        }",
993                                                         "var jsonData = pm.response.json();",
994                                                         "",
995                                                         "if(jsonData.hasOwnProperty('tenant'))",
996                                                         "    {",
997                                                         "    for (var i = 0; i < jsonData.tenant.length; i++) ",
998                                                         "        { ",
999                                                         "        if (jsonData.tenant[i]['tenant-id'] === pm.globals.get(\"tenant_id\")) ",
1000                                                         "            {",
1001                                                         "            tenant_found = true;",
1002                                                         "            }",
1003                                                         "        }",
1004                                                         "    if (tenant_found === true) ",
1005                                                         "        {",
1006                                                         "        tests[pm.globals.get(\"tenant_name\")+\" already exists, we skip creation\"] = true;",
1007                                                         "        postman.setNextRequest(\"check customer-service-tenant relations\");",
1008                                                         "        }",
1009                                                         "",
1010                                                         "if (tenant_found === false)",
1011                                                         "    {",
1012                                                         "    tests[pm.globals.get(\"tenant_name\")+\" does not exists\"] = true;",
1013                                                         "    }",
1014                                                         "}",
1015                                                         "}"
1016                                                 ],
1017                                                 "type": "text/javascript"
1018                                         }
1019                                 }
1020                         ],
1021                         "request": {
1022                                 "method": "GET",
1023                                 "header": [
1024                                         {
1025                                                 "key": "Authorization",
1026                                                 "value": "Basic QUFJOkFBSQ=="
1027                                         },
1028                                         {
1029                                                 "key": "X-FromAppId",
1030                                                 "value": "AAI"
1031                                         },
1032                                         {
1033                                                 "key": "Accept",
1034                                                 "value": "application/json"
1035                                         },
1036                                         {
1037                                                 "key": "X-TransactionId",
1038                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
1039                                         },
1040                                         {
1041                                                 "key": "Content-Type",
1042                                                 "value": "application/json"
1043                                         }
1044                                 ],
1045                                 "body": {
1046                                         "mode": "raw",
1047                                         "raw": ""
1048                                 },
1049                                 "url": {
1050                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{{cloud_owner_name}}/{{onap_cloud_region_id}}/tenants",
1051                                         "host": [
1052                                                 "{{url-aai}}"
1053                                         ],
1054                                         "path": [
1055                                                 "aai",
1056                                                 "v16",
1057                                                 "cloud-infrastructure",
1058                                                 "cloud-regions",
1059                                                 "cloud-region",
1060                                                 "{{cloud_owner_name}}",
1061                                                 "{{onap_cloud_region_id}}",
1062                                                 "tenants"
1063                                         ]
1064                                 }
1065                         },
1066                         "response": []
1067                 },
1068                 {
1069                         "name": "add tenant to region",
1070                         "event": [
1071                                 {
1072                                         "listen": "test",
1073                                         "script": {
1074                                                 "id": "4d1eee0e-6afd-44e8-b1cc-269a1249232d",
1075                                                 "exec": [
1076                                                         "pm.test(\"Status code is 201\", function () {",
1077                                                         "    pm.response.to.have.status(201);",
1078                                                         "});"
1079                                                 ],
1080                                                 "type": "text/javascript"
1081                                         }
1082                                 }
1083                         ],
1084                         "request": {
1085                                 "method": "PUT",
1086                                 "header": [
1087                                         {
1088                                                 "key": "Authorization",
1089                                                 "value": "Basic QUFJOkFBSQ=="
1090                                         },
1091                                         {
1092                                                 "key": "X-FromAppId",
1093                                                 "value": "AAI"
1094                                         },
1095                                         {
1096                                                 "key": "Accept",
1097                                                 "value": "application/json"
1098                                         },
1099                                         {
1100                                                 "key": "X-TransactionId",
1101                                                 "value": "get_aai_subscr"
1102                                         },
1103                                         {
1104                                                 "key": "Content-Type",
1105                                                 "value": "application/json"
1106                                         }
1107                                 ],
1108                                 "body": {
1109                                         "mode": "raw",
1110                                         "raw": "{\n    \"tenant-id\": \"{{tenant_id}}\",\n    \"tenant-name\": \"{{tenant_name}}\"\n}"
1111                                 },
1112                                 "url": {
1113                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{{cloud_owner_name}}/{{onap_cloud_region_id}}/tenants/tenant/{{tenant_id}}",
1114                                         "host": [
1115                                                 "{{url-aai}}"
1116                                         ],
1117                                         "path": [
1118                                                 "aai",
1119                                                 "v16",
1120                                                 "cloud-infrastructure",
1121                                                 "cloud-regions",
1122                                                 "cloud-region",
1123                                                 "{{cloud_owner_name}}",
1124                                                 "{{onap_cloud_region_id}}",
1125                                                 "tenants",
1126                                                 "tenant",
1127                                                 "{{tenant_id}}"
1128                                         ]
1129                                 }
1130                         },
1131                         "response": []
1132                 },
1133                 {
1134                         "name": "check tenant creation",
1135                         "event": [
1136                                 {
1137                                         "listen": "test",
1138                                         "script": {
1139                                                 "id": "716f0a8a-37b3-412f-8d7b-acef34597bee",
1140                                                 "exec": [
1141                                                         "pm.test(\"Status code is 200\", function () {",
1142                                                         "    pm.response.to.have.status(200);",
1143                                                         "});",
1144                                                         "var jsonData = pm.response.json();",
1145                                                         "var tenant_found = false;",
1146                                                         "for (var i = 0; i < jsonData.tenant.length; i++) { ",
1147                                                         "   if (jsonData.tenant[i][\"tenant-id\"] === pm.globals.get(\"tenant_id\")) {",
1148                                                         "       tenant_found = true;",
1149                                                         "   }",
1150                                                         "}",
1151                                                         "tests[pm.globals.get(\"tenant_name\")+\" found\"] = tenant_found === true;",
1152                                                         ""
1153                                                 ],
1154                                                 "type": "text/javascript"
1155                                         }
1156                                 }
1157                         ],
1158                         "request": {
1159                                 "method": "GET",
1160                                 "header": [
1161                                         {
1162                                                 "key": "Authorization",
1163                                                 "value": "Basic QUFJOkFBSQ=="
1164                                         },
1165                                         {
1166                                                 "key": "X-FromAppId",
1167                                                 "value": "AAI"
1168                                         },
1169                                         {
1170                                                 "key": "Accept",
1171                                                 "value": "application/json"
1172                                         },
1173                                         {
1174                                                 "key": "X-TransactionId",
1175                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
1176                                         },
1177                                         {
1178                                                 "key": "Content-Type",
1179                                                 "value": "application/json"
1180                                         }
1181                                 ],
1182                                 "body": {
1183                                         "mode": "raw",
1184                                         "raw": ""
1185                                 },
1186                                 "url": {
1187                                         "raw": "{{url-aai}}/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{{cloud_owner_name}}/{{onap_cloud_region_id}}/tenants",
1188                                         "host": [
1189                                                 "{{url-aai}}"
1190                                         ],
1191                                         "path": [
1192                                                 "aai",
1193                                                 "v16",
1194                                                 "cloud-infrastructure",
1195                                                 "cloud-regions",
1196                                                 "cloud-region",
1197                                                 "{{cloud_owner_name}}",
1198                                                 "{{onap_cloud_region_id}}",
1199                                                 "tenants"
1200                                         ]
1201                                 }
1202                         },
1203                         "response": []
1204                 },
1205                 {
1206                         "name": "check customer-service-tenant relations",
1207                         "event": [
1208                                 {
1209                                         "listen": "test",
1210                                         "script": {
1211                                                 "id": "587ed4e3-e181-49c1-9f21-08d366a52587",
1212                                                 "exec": [
1213                                                         "var relation_found = false;",
1214                                                         "if (pm.response.code === 404) {",
1215                                                         "    tests[pm.globals.get(\"tenant_name\")+\" / \"+pm.globals.get(\"service\")+ \" relation does not exists\"] = true;",
1216                                                         "}",
1217                                                         "else {",
1218                                                         "    if (pm.response.code === 200) {",
1219                                                         "        tests[\"Status code is 200\"] = pm.response.code === 200;",
1220                                                         "        }",
1221                                                         "",
1222                                                         "var jsonData = pm.response.json();",
1223                                                         "for (var i = 0; i < jsonData[\"service-subscription\"].length; i++) { ",
1224                                                         "   if (jsonData[\"service-subscription\"][i][\"service-type\"] === pm.globals.get(\"service\")) {",
1225                                                         "       relation_found = true;",
1226                                                         "   }",
1227                                                         "}",
1228                                                         "",
1229                                                         "if (relation_found === false) {",
1230                                                         "    tests[pm.globals.get(\"tenant_name\")+\" / \"+pm.globals.get(\"service\")+ \" relation does not exists\"] = true;",
1231                                                         "}",
1232                                                         "",
1233                                                         "else {",
1234                                                         "    tests[pm.globals.get(\"tenant_name\")+\" / \"+pm.globals.get(\"service\")+ \" already exists, we skip relation creation\"] = true;",
1235                                                         "    postman.setNextRequest(\"check customer-service-tenant relation creation\");",
1236                                                         "}",
1237                                                         "}"
1238                                                 ],
1239                                                 "type": "text/javascript"
1240                                         }
1241                                 }
1242                         ],
1243                         "request": {
1244                                 "method": "GET",
1245                                 "header": [
1246                                         {
1247                                                 "key": "Authorization",
1248                                                 "value": "Basic QUFJOkFBSQ=="
1249                                         },
1250                                         {
1251                                                 "key": "X-FromAppId",
1252                                                 "value": "AAI"
1253                                         },
1254                                         {
1255                                                 "key": "Accept",
1256                                                 "value": "application/json"
1257                                         },
1258                                         {
1259                                                 "key": "Content-Type",
1260                                                 "value": "application/json"
1261                                         },
1262                                         {
1263                                                 "key": "X-TransactionId",
1264                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
1265                                         }
1266                                 ],
1267                                 "body": {
1268                                         "mode": "raw",
1269                                         "raw": ""
1270                                 },
1271                                 "url": {
1272                                         "raw": "{{url-aai}}/aai/v16/business/customers/customer/{{customer_name}}/service-subscriptions?depth=all",
1273                                         "host": [
1274                                                 "{{url-aai}}"
1275                                         ],
1276                                         "path": [
1277                                                 "aai",
1278                                                 "v16",
1279                                                 "business",
1280                                                 "customers",
1281                                                 "customer",
1282                                                 "{{customer_name}}",
1283                                                 "service-subscriptions"
1284                                         ],
1285                                         "query": [
1286                                                 {
1287                                                         "key": "depth",
1288                                                         "value": "all"
1289                                                 }
1290                                         ]
1291                                 }
1292                         },
1293                         "response": []
1294                 },
1295                 {
1296                         "name": "Add service to customer",
1297                         "event": [
1298                                 {
1299                                         "listen": "test",
1300                                         "script": {
1301                                                 "id": "9a9da50d-49ce-4f9e-ae18-6131dce516eb",
1302                                                 "exec": [
1303                                                         "pm.test(\"Status code is 201\", function () {",
1304                                                         "    pm.response.to.have.status(201);",
1305                                                         "});"
1306                                                 ],
1307                                                 "type": "text/javascript"
1308                                         }
1309                                 }
1310                         ],
1311                         "request": {
1312                                 "method": "PUT",
1313                                 "header": [
1314                                         {
1315                                                 "key": "Authorization",
1316                                                 "value": "Basic QUFJOkFBSQ=="
1317                                         },
1318                                         {
1319                                                 "key": "X-FromAppId",
1320                                                 "value": "AAI"
1321                                         },
1322                                         {
1323                                                 "key": "Accept",
1324                                                 "value": "application/json"
1325                                         },
1326                                         {
1327                                                 "key": "Content-Type",
1328                                                 "value": "application/json"
1329                                         },
1330                                         {
1331                                                 "key": "X-TransactionId",
1332                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
1333                                         }
1334                                 ],
1335                                 "body": {
1336                                         "mode": "raw",
1337                                         "raw": "{\n    \"service-id\": \"{{auto_service_id}}\"\n}"
1338                                 },
1339                                 "url": {
1340                                         "raw": "{{url-aai}}/aai/v16/business/customers/customer/{{customer_name}}/service-subscriptions/service-subscription/{{service}}",
1341                                         "host": [
1342                                                 "{{url-aai}}"
1343                                         ],
1344                                         "path": [
1345                                                 "aai",
1346                                                 "v16",
1347                                                 "business",
1348                                                 "customers",
1349                                                 "customer",
1350                                                 "{{customer_name}}",
1351                                                 "service-subscriptions",
1352                                                 "service-subscription",
1353                                                 "{{service}}"
1354                                         ]
1355                                 }
1356                         },
1357                         "response": []
1358                 },
1359                 {
1360                         "name": "Add tenant to service-customer",
1361                         "event": [
1362                                 {
1363                                         "listen": "test",
1364                                         "script": {
1365                                                 "id": "9a9da50d-49ce-4f9e-ae18-6131dce516eb",
1366                                                 "exec": [
1367                                                         "pm.test(\"Status code is 201\", function () {",
1368                                                         "    pm.response.to.have.status(201);",
1369                                                         "});"
1370                                                 ],
1371                                                 "type": "text/javascript"
1372                                         }
1373                                 }
1374                         ],
1375                         "request": {
1376                                 "method": "PUT",
1377                                 "header": [
1378                                         {
1379                                                 "key": "Authorization",
1380                                                 "value": "Basic QUFJOkFBSQ=="
1381                                         },
1382                                         {
1383                                                 "key": "X-FromAppId",
1384                                                 "value": "AAI"
1385                                         },
1386                                         {
1387                                                 "key": "Accept",
1388                                                 "value": "application/json"
1389                                         },
1390                                         {
1391                                                 "key": "Content-Type",
1392                                                 "value": "application/json"
1393                                         },
1394                                         {
1395                                                 "key": "X-TransactionId",
1396                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
1397                                         }
1398                                 ],
1399                                 "body": {
1400                                         "mode": "raw",
1401                                         "raw": "{\n    \"related-to\": \"tenant\",\n    \"related-link\": \"/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/{{cloud_owner_name}}/{{onap_cloud_region_id}}/tenants/tenant/{{tenant_id}}\",\n    \"relationship-data\": [\n        {\n            \"relationship-key\": \"cloud-region.cloud-owner\",\n            \"relationship-value\": \"{{cloud_owner_name}}\"\n        },\n        {\n            \"relationship-key\": \"cloud-region.cloud-region-id\",\n            \"relationship-value\": \"{{onap_cloud_region_id}}\"\n        },\n        {\n            \"relationship-key\": \"tenant.tenant-id\",\n            \"relationship-value\": \"{{tenant_id}}\"\n        }\n    ],\n    \"related-to-property\": [\n        {\n            \"property-key\": \"tenant.tenant-name\",\n            \"property-value\": \"{{tenant_name}}\"\n        }\n    ]\n}"
1402                                 },
1403                                 "url": {
1404                                         "raw": "{{url-aai}}/aai/v16/business/customers/customer/{{customer_name}}/service-subscriptions/service-subscription/{{service}}/relationship-list/relationship",
1405                                         "host": [
1406                                                 "{{url-aai}}"
1407                                         ],
1408                                         "path": [
1409                                                 "aai",
1410                                                 "v16",
1411                                                 "business",
1412                                                 "customers",
1413                                                 "customer",
1414                                                 "{{customer_name}}",
1415                                                 "service-subscriptions",
1416                                                 "service-subscription",
1417                                                 "{{service}}",
1418                                                 "relationship-list",
1419                                                 "relationship"
1420                                         ]
1421                                 }
1422                         },
1423                         "response": []
1424                 },
1425                 {
1426                         "name": "check customer-service-tenant relation creation",
1427                         "event": [
1428                                 {
1429                                         "listen": "test",
1430                                         "script": {
1431                                                 "id": "10e61ec5-243b-4ce6-b9b8-a29054df2504",
1432                                                 "exec": [
1433                                                         "tests[\"Status code is 200\"] = responseCode.code === 200;",
1434                                                         "",
1435                                                         "var jsonData = pm.response.json();",
1436                                                         "var service_found = false;",
1437                                                         "for (var i = 0; i < jsonData[\"service-subscription\"].length; i++) { ",
1438                                                         "   if (jsonData[\"service-subscription\"][i][\"service-type\"] === pm.globals.get(\"service\")) {",
1439                                                         "       service_found = true;",
1440                                                         "   }",
1441                                                         "}",
1442                                                         "tests[\"Service subscription : \"+pm.globals.get(\"service\")+\" found for customer : \"+pm.globals.get(\"customer_name\")] = service_found === true;",
1443                                                         ""
1444                                                 ],
1445                                                 "type": "text/javascript"
1446                                         }
1447                                 }
1448                         ],
1449                         "request": {
1450                                 "method": "GET",
1451                                 "header": [
1452                                         {
1453                                                 "key": "Authorization",
1454                                                 "value": "Basic QUFJOkFBSQ=="
1455                                         },
1456                                         {
1457                                                 "key": "X-FromAppId",
1458                                                 "value": "AAI"
1459                                         },
1460                                         {
1461                                                 "key": "Accept",
1462                                                 "value": "application/json"
1463                                         },
1464                                         {
1465                                                 "key": "Content-Type",
1466                                                 "value": "application/json"
1467                                         },
1468                                         {
1469                                                 "key": "X-TransactionId",
1470                                                 "value": "808b54e3-e563-4144-a1b9-e24e2ed93d4f"
1471                                         }
1472                                 ],
1473                                 "body": {
1474                                         "mode": "raw",
1475                                         "raw": ""
1476                                 },
1477                                 "url": {
1478                                         "raw": "{{url-aai}}/aai/v16/business/customers/customer/{{customer_name}}/service-subscriptions?depth=all",
1479                                         "host": [
1480                                                 "{{url-aai}}"
1481                                         ],
1482                                         "path": [
1483                                                 "aai",
1484                                                 "v16",
1485                                                 "business",
1486                                                 "customers",
1487                                                 "customer",
1488                                                 "{{customer_name}}",
1489                                                 "service-subscriptions"
1490                                         ],
1491                                         "query": [
1492                                                 {
1493                                                         "key": "depth",
1494                                                         "value": "all"
1495                                                 }
1496                                         ]
1497                                 }
1498                         },
1499                         "response": []
1500                 }
1501         ]
1502 }