Rene_Robert | 0ebd04f | 2019-07-30 17:11:26 +0200 | [diff] [blame] | 1 | { |
Bartek Grzybowski | 2ab4281 | 2020-02-26 15:07:39 +0100 | [diff] [blame] | 2 | "info": { |
| 3 | "_postman_id": "7e53b9c4-273b-4012-81f3-0634173626c2", |
| 4 | "name": "11_delete_instances", |
| 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" |
| 6 | }, |
| 7 | "item": [ |
| 8 | { |
| 9 | "name": "SO Delete vf-module", |
| 10 | "event": [ |
| 11 | { |
| 12 | "listen": "test", |
| 13 | "script": { |
| 14 | "id": "2c20c606-a034-47e0-8a66-fc4f1b8ed1c8", |
| 15 | "exec": [ |
| 16 | "pm.test(\"Status code is 202\", function () {", |
| 17 | " pm.response.to.have.status(202);", |
| 18 | "});", |
| 19 | "", |
| 20 | "var jsonData = pm.response.json();", |
| 21 | "", |
| 22 | "pm.environment.set(\"auto_so_request_id\", \"\"+jsonData.requestReferences.requestId+\"\");", |
| 23 | "" |
| 24 | ], |
| 25 | "type": "text/javascript" |
| 26 | } |
| 27 | } |
| 28 | ], |
| 29 | "request": { |
| 30 | "method": "DELETE", |
| 31 | "header": [ |
| 32 | { |
| 33 | "key": "Accept", |
| 34 | "value": "application/json", |
| 35 | "type": "text" |
| 36 | }, |
| 37 | { |
| 38 | "key": "Content-Type", |
| 39 | "value": "application/json", |
| 40 | "type": "text" |
| 41 | }, |
| 42 | { |
| 43 | "key": "Authorization", |
| 44 | "value": "Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", |
| 45 | "type": "text" |
| 46 | }, |
| 47 | { |
| 48 | "key": "X-ONAP-PartnerName", |
| 49 | "value": "NBI", |
| 50 | "type": "text" |
| 51 | } |
| 52 | ], |
| 53 | "body": { |
| 54 | "mode": "raw", |
| 55 | "raw": "{\n \"requestDetails\": {\n \"requestInfo\": {\n \"source\": \"VID\",\n \"requestorId\": \"test\"\n },\n \"modelInfo\": {\n \"modelType\": \"vfModule\",\n \"modelInvariantId\": \"{{auto_vf_module_model_invariant_uuid}}\",\n \"modelVersionId\": \"{{auto_vf_module_model_uuid}}\",\n \"modelName\": \"{{auto_vf_module_model_name}}\",\n \"modelVersion\": \"1\",\n \"modelCustomizationId\": \"{{auto_vf_module_model_customization_uuid}}\",\n \"modelCustomizationName\": \"{{auto_vf_module_model_name}}\"\n },\n \"requestParameters\": {\n \"testApi\": \"VNF_API\"\n },\n \"cloudConfiguration\": {\n \"cloudOwner\": \"{{cloud_owner_name}}\",\n \"lcpCloudRegionId\": \"{{onap_cloud_region_id}}\",\n \"tenantId\": \"{{tenant_id}}\"\n }\n }\n}" |
| 56 | }, |
| 57 | "url": { |
| 58 | "raw": "{{url-so}}/onap/so/infra/serviceInstantiation/v7/serviceInstances/{{auto_service_instance_id}}/vnfs/{{auto_vnf_instance_id}}/vfModules/{{auto_vfmodule_instance_id}}", |
| 59 | "host": [ |
| 60 | "{{url-so}}" |
| 61 | ], |
| 62 | "path": [ |
| 63 | "onap", |
| 64 | "so", |
| 65 | "infra", |
| 66 | "serviceInstantiation", |
| 67 | "v7", |
| 68 | "serviceInstances", |
| 69 | "{{auto_service_instance_id}}", |
| 70 | "vnfs", |
| 71 | "{{auto_vnf_instance_id}}", |
| 72 | "vfModules", |
| 73 | "{{auto_vfmodule_instance_id}}" |
| 74 | ] |
| 75 | } |
| 76 | }, |
| 77 | "response": [] |
| 78 | }, |
| 79 | { |
| 80 | "name": "SO orchestrationRequests after 30s", |
| 81 | "event": [ |
| 82 | { |
| 83 | "listen": "test", |
| 84 | "script": { |
| 85 | "id": "2ca20cdd-fbb0-46a3-b6af-eb36d388448c", |
| 86 | "exec": [ |
| 87 | "", |
| 88 | "pm.test(\"Status code is 200\", function () {", |
| 89 | " pm.response.to.have.status(200);", |
| 90 | "});", |
| 91 | "var jsonData = pm.response.json();", |
| 92 | "", |
| 93 | "tests[\"requestState is : \"+jsonData.request.requestStatus.requestState] = jsonData.request.requestStatus.requestState === \"COMPLETE\";", |
| 94 | "", |
| 95 | "tests[\"statusMessage is : \"+jsonData.request.requestStatus.statusMessage] = jsonData.request.requestStatus.statusMessage === \"Vf Module has been deleted successfully.\";" |
| 96 | ], |
| 97 | "type": "text/javascript" |
| 98 | } |
| 99 | }, |
| 100 | { |
| 101 | "listen": "prerequest", |
| 102 | "script": { |
| 103 | "id": "0fc6bd97-ca45-4caa-bdc5-346d661a5409", |
| 104 | "exec": [ |
| 105 | " var date = new Date();", |
| 106 | " var curDate = null;", |
| 107 | " do {", |
| 108 | " curDate = new Date();", |
| 109 | " }", |
| 110 | " while (curDate - date < 10000);" |
| 111 | ], |
| 112 | "type": "text/javascript" |
| 113 | } |
| 114 | } |
| 115 | ], |
| 116 | "request": { |
| 117 | "method": "GET", |
| 118 | "header": [ |
| 119 | { |
| 120 | "key": "Accept", |
| 121 | "value": "application/json" |
| 122 | }, |
| 123 | { |
| 124 | "key": "Content-Type", |
| 125 | "value": "application/json" |
| 126 | }, |
| 127 | { |
| 128 | "key": "X-FromAppId", |
| 129 | "value": "AAI" |
| 130 | }, |
| 131 | { |
| 132 | "key": "X-TransactionId", |
| 133 | "value": "get_aai_subscr" |
| 134 | }, |
| 135 | { |
| 136 | "key": "Authorization", |
| 137 | "value": "Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==" |
| 138 | } |
| 139 | ], |
| 140 | "body": { |
| 141 | "mode": "raw", |
| 142 | "raw": "" |
| 143 | }, |
| 144 | "url": { |
| 145 | "raw": "{{url-so}}/onap/so/infra/orchestrationRequests/v7/{{auto_so_request_id}}", |
| 146 | "host": [ |
| 147 | "{{url-so}}" |
| 148 | ], |
| 149 | "path": [ |
| 150 | "onap", |
| 151 | "so", |
| 152 | "infra", |
| 153 | "orchestrationRequests", |
| 154 | "v7", |
| 155 | "{{auto_so_request_id}}" |
| 156 | ] |
| 157 | } |
| 158 | }, |
| 159 | "response": [] |
| 160 | }, |
| 161 | { |
| 162 | "name": "check vfmodule instance in inventory via AAI request", |
| 163 | "event": [ |
| 164 | { |
| 165 | "listen": "test", |
| 166 | "script": { |
| 167 | "id": "6244395e-23bd-4d4b-9f31-cd9b1e4102f6", |
| 168 | "exec": [ |
| 169 | "", |
| 170 | "var jsonData = pm.response.json();", |
| 171 | "", |
| 172 | "", |
| 173 | "var vfmodule_instance_found = false;", |
| 174 | "", |
| 175 | "if (pm.response.code === 200){", |
| 176 | " for (var i = 0; i < jsonData[\"vf-module\"].length; i++) { ", |
| 177 | " if (jsonData[\"vf-module\"][i][\"vf-module-name\"] === pm.environment.get(\"vfmodule_instance_name\")) {", |
| 178 | " vfmodule_instance_found = true;", |
| 179 | " }", |
| 180 | " }", |
| 181 | "}", |
| 182 | "", |
| 183 | "", |
| 184 | "tests[\"vfmodule Instance : \"+ pm.environment.get(\"vfmodule_instance_name\") +\" no longer exists in AAI inventory\"] = vfmodule_instance_found === false;" |
| 185 | ], |
| 186 | "type": "text/javascript" |
| 187 | } |
| 188 | } |
| 189 | ], |
| 190 | "request": { |
| 191 | "method": "GET", |
| 192 | "header": [ |
| 193 | { |
| 194 | "key": "Authorization", |
| 195 | "value": "Basic QUFJOkFBSQ==" |
| 196 | }, |
| 197 | { |
| 198 | "key": "X-FromAppId", |
| 199 | "value": "AAI" |
| 200 | }, |
| 201 | { |
| 202 | "key": "Accept", |
| 203 | "value": "application/json" |
| 204 | }, |
| 205 | { |
| 206 | "key": "X-TransactionId", |
| 207 | "value": "get_aai_subscr" |
| 208 | }, |
| 209 | { |
| 210 | "key": "Content-Type", |
| 211 | "value": "application/json" |
| 212 | } |
| 213 | ], |
| 214 | "body": { |
| 215 | "mode": "raw", |
| 216 | "raw": "" |
| 217 | }, |
| 218 | "url": { |
| 219 | "raw": "{{url-aai}}/aai/v16/network/generic-vnfs/generic-vnf/{{auto_vnf_instance_id}}/vf-modules", |
| 220 | "host": [ |
| 221 | "{{url-aai}}" |
| 222 | ], |
| 223 | "path": [ |
| 224 | "aai", |
| 225 | "v16", |
| 226 | "network", |
| 227 | "generic-vnfs", |
| 228 | "generic-vnf", |
| 229 | "{{auto_vnf_instance_id}}", |
| 230 | "vf-modules" |
| 231 | ] |
| 232 | } |
| 233 | }, |
| 234 | "response": [] |
| 235 | }, |
| 236 | { |
| 237 | "name": "SO Delete vnf_instance", |
| 238 | "event": [ |
| 239 | { |
| 240 | "listen": "test", |
| 241 | "script": { |
| 242 | "id": "eab54e34-7898-452e-ad8e-6ac68c3efd36", |
| 243 | "exec": [ |
| 244 | "pm.test(\"Status code is 202\", function () {", |
| 245 | " pm.response.to.have.status(202);", |
| 246 | "});", |
| 247 | "var jsonData = pm.response.json();", |
| 248 | "", |
| 249 | "pm.environment.set(\"auto_so_request_id\", \"\"+jsonData.requestReferences.requestId+\"\");", |
| 250 | "" |
| 251 | ], |
| 252 | "type": "text/javascript" |
| 253 | } |
| 254 | } |
| 255 | ], |
| 256 | "request": { |
| 257 | "method": "DELETE", |
| 258 | "header": [ |
| 259 | { |
| 260 | "key": "Accept", |
| 261 | "value": "application/json", |
| 262 | "type": "text" |
| 263 | }, |
| 264 | { |
| 265 | "key": "Content-Type", |
| 266 | "value": "application/json", |
| 267 | "type": "text" |
| 268 | }, |
| 269 | { |
| 270 | "key": "Authorization", |
| 271 | "value": "Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", |
| 272 | "type": "text" |
| 273 | }, |
| 274 | { |
| 275 | "key": "X-ONAP-PartnerName", |
| 276 | "value": "NBI", |
| 277 | "type": "text" |
| 278 | } |
| 279 | ], |
| 280 | "body": { |
| 281 | "mode": "raw", |
| 282 | "raw": "{\n\t\"requestDetails\": {\n\t\t\"requestInfo\": {\n\t\t\t\"source\": \"VID\",\n\t\t\t\"requestorId\": \"test\"\n\t\t},\n\t\t\"modelInfo\": {\n\t\t\t\"modelType\": \"vnf\",\n\t\t\t\"modelInvariantId\": \"{{auto_vf_invariant_uuid}}\",\n\t\t\t\"modelVersionId\": \"{{auto_vf_uuid}}\",\n\t\t\t\"modelName\": \"{{vf_name}}\",\n\t\t\t\"modelVersion\": \"1.0\",\n\t\t\t\"modelCustomizationId\": \"{{auto_vf_customization_id}}\",\n\t\t\t\"modelCustomizationName\": \"{{vf_name}} 0\"\n\t\t},\n\t\t\"requestParameters\": {\n\t\t\t\"testApi\": \"VNF_API\"\n\t\t},\n \"cloudConfiguration\": {\n \"cloudOwner\": \"{{cloud_owner_name}}\",\n \"lcpCloudRegionId\": \"{{onap_cloud_region_id}}\",\n \"tenantId\": \"{{tenant_id}}\"\n }\n\t}\n}\n\n" |
| 283 | }, |
| 284 | "url": { |
| 285 | "raw": "{{url-so}}/onap/so/infra/serviceInstantiation/v7/serviceInstances/{{auto_service_instance_id}}/vnfs/{{auto_vnf_instance_id}}", |
| 286 | "host": [ |
| 287 | "{{url-so}}" |
| 288 | ], |
| 289 | "path": [ |
| 290 | "onap", |
| 291 | "so", |
| 292 | "infra", |
| 293 | "serviceInstantiation", |
| 294 | "v7", |
| 295 | "serviceInstances", |
| 296 | "{{auto_service_instance_id}}", |
| 297 | "vnfs", |
| 298 | "{{auto_vnf_instance_id}}" |
| 299 | ] |
| 300 | } |
| 301 | }, |
| 302 | "response": [] |
| 303 | }, |
| 304 | { |
| 305 | "name": "SO Delete network", |
| 306 | "event": [ |
| 307 | { |
| 308 | "listen": "test", |
| 309 | "script": { |
| 310 | "id": "eab54e34-7898-452e-ad8e-6ac68c3efd36", |
| 311 | "exec": [ |
| 312 | "" |
| 313 | ], |
| 314 | "type": "text/javascript" |
| 315 | } |
| 316 | } |
| 317 | ], |
| 318 | "request": { |
| 319 | "method": "DELETE", |
| 320 | "header": [ |
| 321 | { |
| 322 | "key": "Accept", |
| 323 | "value": "application/json", |
| 324 | "type": "text" |
| 325 | }, |
| 326 | { |
| 327 | "key": "Content-Type", |
| 328 | "value": "application/json", |
| 329 | "type": "text" |
| 330 | }, |
| 331 | { |
| 332 | "key": "Authorization", |
| 333 | "value": "Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==", |
| 334 | "type": "text" |
| 335 | }, |
| 336 | { |
| 337 | "key": "X-ONAP-PartnerName", |
| 338 | "value": "NBI", |
| 339 | "type": "text" |
| 340 | } |
| 341 | ], |
| 342 | "body": { |
| 343 | "mode": "raw", |
| 344 | "raw": " {\n \t\"requestDetails\": {\n \t\t\"modelInfo\": {\n \t\t\t\"modelType\": \"network\"\n \t\t},\n \t\t\"requestInfo\": {\n \t\t\t\"source\": \"VID\",\n \t\t\t\"requestorId\": \"demo\"\n \t\t},\n \t\t\"requestParameters\": {\n \t\t\t\"testApi\": \"VNF_API\"\n \t\t},\n \"cloudConfiguration\": {\n \"cloudOwner\": \"{{cloud_owner_name}}\",\n \"lcpCloudRegionId\": \"{{onap_cloud_region_id}}\",\n \"tenantId\": \"{{tenant_id}}\"\n }\n\t}\n}\n\n" |
| 345 | }, |
| 346 | "url": { |
| 347 | "raw": "{{url-so}}/onap/so/infra/serviceInstantiation/v7/serviceInstances/{{auto_service_instance_id}}/networks/{{auto_virtual_link_instance_id}}", |
| 348 | "host": [ |
| 349 | "{{url-so}}" |
| 350 | ], |
| 351 | "path": [ |
| 352 | "onap", |
| 353 | "so", |
| 354 | "infra", |
| 355 | "serviceInstantiation", |
| 356 | "v7", |
| 357 | "serviceInstances", |
| 358 | "{{auto_service_instance_id}}", |
| 359 | "networks", |
| 360 | "{{auto_virtual_link_instance_id}}" |
| 361 | ] |
| 362 | } |
| 363 | }, |
| 364 | "response": [] |
| 365 | }, |
| 366 | { |
| 367 | "name": "SO orchestrationRequests after 10s", |
| 368 | "event": [ |
| 369 | { |
| 370 | "listen": "test", |
| 371 | "script": { |
| 372 | "id": "68a5392d-2904-416b-9cf0-a89c971aa341", |
| 373 | "exec": [ |
| 374 | "pm.test(\"Status code is 200\", function () {", |
| 375 | " pm.response.to.have.status(200);", |
| 376 | "});", |
| 377 | "", |
| 378 | "var jsonData = pm.response.json();", |
| 379 | "", |
| 380 | "tests[\"requestState is : \"+jsonData.request.requestStatus.requestState] = jsonData.request.requestStatus.requestState === \"COMPLETE\";", |
| 381 | "", |
| 382 | "tests[\"statusMessage is : \"+jsonData.request.requestStatus.statusMessage] = jsonData.request.requestStatus.statusMessage === \"Vnf has been deleted successfully.\";" |
| 383 | ], |
| 384 | "type": "text/javascript" |
| 385 | } |
| 386 | }, |
| 387 | { |
| 388 | "listen": "prerequest", |
| 389 | "script": { |
| 390 | "id": "0f9f067e-d8d4-4b69-a7eb-71f1e73b8196", |
| 391 | "exec": [ |
| 392 | " var date = new Date();", |
| 393 | " var curDate = null;", |
| 394 | " do {", |
| 395 | " curDate = new Date();", |
| 396 | " }", |
| 397 | " while (curDate - date < 10000);" |
| 398 | ], |
| 399 | "type": "text/javascript" |
| 400 | } |
| 401 | } |
| 402 | ], |
| 403 | "request": { |
| 404 | "method": "GET", |
| 405 | "header": [ |
| 406 | { |
| 407 | "key": "Accept", |
| 408 | "value": "application/json" |
| 409 | }, |
| 410 | { |
| 411 | "key": "Content-Type", |
| 412 | "value": "application/json" |
| 413 | }, |
| 414 | { |
| 415 | "key": "X-FromAppId", |
| 416 | "value": "AAI" |
| 417 | }, |
| 418 | { |
| 419 | "key": "X-TransactionId", |
| 420 | "value": "get_aai_subscr" |
| 421 | }, |
| 422 | { |
| 423 | "key": "Authorization", |
| 424 | "value": "Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==" |
| 425 | } |
| 426 | ], |
| 427 | "body": { |
| 428 | "mode": "raw", |
| 429 | "raw": "" |
| 430 | }, |
| 431 | "url": { |
| 432 | "raw": "{{url-so}}/onap/so/infra/orchestrationRequests/v7/{{auto_so_request_id}}", |
| 433 | "host": [ |
| 434 | "{{url-so}}" |
| 435 | ], |
| 436 | "path": [ |
| 437 | "onap", |
| 438 | "so", |
| 439 | "infra", |
| 440 | "orchestrationRequests", |
| 441 | "v7", |
| 442 | "{{auto_so_request_id}}" |
| 443 | ] |
| 444 | } |
| 445 | }, |
| 446 | "response": [] |
| 447 | }, |
| 448 | { |
| 449 | "name": "check vnf instance in inventory via AAI request", |
| 450 | "event": [ |
| 451 | { |
| 452 | "listen": "test", |
| 453 | "script": { |
| 454 | "id": "851c2dff-10fb-4f6a-a346-4bab48868d3a", |
| 455 | "exec": [ |
| 456 | "", |
| 457 | "var jsonData = pm.response.json();", |
| 458 | "", |
| 459 | "var vnf_instance_found = false;", |
| 460 | "", |
| 461 | "if (pm.response.code === 200){", |
| 462 | "for (var i = 0; i < jsonData[\"generic-vnf\"].length; i++) { ", |
| 463 | " if (jsonData[\"generic-vnf\"][i][\"vnf-name\"] === pm.environment.get(\"vnf_instance_name\")) {", |
| 464 | " vnf_instance_found = true;", |
| 465 | " }", |
| 466 | "}", |
| 467 | "}", |
| 468 | "tests[\"VNF Instance : \"+ pm.environment.get(\"vnf_instance_name\") +\" no longer exists in AAI inventory\"] = vnf_instance_found === false;" |
| 469 | ], |
| 470 | "type": "text/javascript" |
| 471 | } |
| 472 | } |
| 473 | ], |
| 474 | "request": { |
| 475 | "method": "GET", |
| 476 | "header": [ |
| 477 | { |
| 478 | "key": "Authorization", |
| 479 | "value": "Basic QUFJOkFBSQ==" |
| 480 | }, |
| 481 | { |
| 482 | "key": "X-FromAppId", |
| 483 | "value": "AAI" |
| 484 | }, |
| 485 | { |
| 486 | "key": "Accept", |
| 487 | "value": "application/json" |
| 488 | }, |
| 489 | { |
| 490 | "key": "X-TransactionId", |
| 491 | "value": "get_aai_subscr" |
| 492 | }, |
| 493 | { |
| 494 | "key": "Content-Type", |
| 495 | "value": "application/json" |
| 496 | } |
| 497 | ], |
| 498 | "body": { |
| 499 | "mode": "raw", |
| 500 | "raw": "" |
| 501 | }, |
| 502 | "url": { |
| 503 | "raw": "{{url-aai}}/aai/v16/network/generic-vnfs", |
| 504 | "host": [ |
| 505 | "{{url-aai}}" |
| 506 | ], |
| 507 | "path": [ |
| 508 | "aai", |
| 509 | "v16", |
| 510 | "network", |
| 511 | "generic-vnfs" |
| 512 | ] |
| 513 | } |
| 514 | }, |
| 515 | "response": [] |
| 516 | }, |
| 517 | { |
| 518 | "name": "Delete service Instance via ServiceOrder API", |
| 519 | "event": [ |
| 520 | { |
| 521 | "listen": "test", |
| 522 | "script": { |
| 523 | "id": "764a92a8-efb5-48f8-999a-2cf34d9364b2", |
| 524 | "exec": [ |
| 525 | "pm.test(\"Status code is 201\", function () {", |
| 526 | " pm.response.to.have.status(201);", |
| 527 | "});", |
| 528 | "", |
| 529 | "var jsonData = pm.response.json();", |
| 530 | "pm.environment.set(\"auto_service_order_id\", jsonData.id);", |
| 531 | "", |
| 532 | "", |
| 533 | "", |
| 534 | "" |
| 535 | ], |
| 536 | "type": "text/javascript" |
| 537 | } |
| 538 | } |
| 539 | ], |
| 540 | "request": { |
| 541 | "method": "POST", |
| 542 | "header": [ |
| 543 | { |
| 544 | "key": "Accept", |
| 545 | "value": "application/json" |
| 546 | }, |
| 547 | { |
| 548 | "key": "Content-Type", |
| 549 | "value": "application/json" |
| 550 | } |
| 551 | ], |
| 552 | "body": { |
| 553 | "mode": "raw", |
| 554 | "raw": "{\n \"externalId\": \"{{externalId}}\",\n \"priority\": \"1\",\n \"description\": \"{{service}} ordering on generic customer via Postman\",\n \"category\": \"Consumer\",\n \"requestedStartDate\": \"2018-04-26T08:33:37.299Z\",\n \"requestedCompletionDate\": \"2018-04-26T08:33:37.299Z\",\n \"relatedParty\": [\n {\n \"id\": \"{{customer_name}}\",\n \"role\": \"ONAPcustomer\",\n \"name\": \"{{customer_name}}\"\n }\n ],\n \"orderItem\": [\n {\n \"id\": \"1\",\n \"action\": \"delete\",\n \"service\": {\n \"id\": \"{{auto_service_instance_id}}\",\n \"serviceState\": \"active\",\n \"serviceSpecification\": {\n \"id\": \"{{auto_service_id}}\"\n }\n }\n }\n ]\n}" |
| 555 | }, |
| 556 | "url": { |
| 557 | "raw": "{{url-nbi}}/nbi/api/v4/serviceOrder", |
| 558 | "host": [ |
| 559 | "{{url-nbi}}" |
| 560 | ], |
| 561 | "path": [ |
| 562 | "nbi", |
| 563 | "api", |
| 564 | "v4", |
| 565 | "serviceOrder" |
| 566 | ] |
| 567 | } |
| 568 | }, |
| 569 | "response": [] |
| 570 | }, |
| 571 | { |
| 572 | "name": "GET previous serviceOrder after 10s", |
| 573 | "event": [ |
| 574 | { |
| 575 | "listen": "test", |
| 576 | "script": { |
| 577 | "id": "de2c349d-b58d-42ae-8454-3afc1084cef1", |
| 578 | "exec": [ |
| 579 | "pm.test(\"Status code is 200\", function () {", |
| 580 | " pm.response.to.have.status(200);", |
| 581 | "});", |
| 582 | "", |
| 583 | "var jsonData = pm.response.json();", |
| 584 | "", |
| 585 | "tests[pm.environment.get(\"externalId\")+\" exists\"] = jsonData.externalId === pm.environment.get(\"externalId\");", |
| 586 | "tests[\"service_order_id exists\"] = jsonData.id === pm.environment.get(\"auto_service_order_id\");", |
| 587 | "tests[\"service Order state is : \"+jsonData.state] = jsonData.state === \"completed\";", |
| 588 | "tests[\"Service Instance state is : \"+jsonData.orderItem[0].service.serviceState] = jsonData.orderItem[0].service.serviceState === \"active\";", |
| 589 | "", |
| 590 | "", |
| 591 | "if(jsonData.state == \"completed\"){", |
| 592 | " pm.environment.set(\"auto_service_instance_id\", \"\"+jsonData.orderItem[0].service.id+\"\");", |
| 593 | "}", |
| 594 | "if (jsonData.orderMessage !== null){", |
| 595 | " tests[\"order message is : \" +jsonData.orderMessage[0].messageInformation] = jsonData.orderMessage[0].messageInformation === \"\";", |
| 596 | " pm.environment.set(\"auto_service_messageInformation\", \"\"+jsonData.orderMessage[0].messageInformation+\"\");", |
| 597 | " }", |
| 598 | "", |
| 599 | "" |
| 600 | ], |
| 601 | "type": "text/javascript" |
| 602 | } |
| 603 | }, |
| 604 | { |
| 605 | "listen": "prerequest", |
| 606 | "script": { |
| 607 | "id": "b9cdde4f-bf25-4922-a8c0-b378bb0b9535", |
| 608 | "exec": [ |
| 609 | " var date = new Date();", |
| 610 | " var curDate = null;", |
| 611 | " do {", |
| 612 | " curDate = new Date();", |
| 613 | " }", |
| 614 | " while (curDate - date < 10000);" |
| 615 | ], |
| 616 | "type": "text/javascript" |
| 617 | } |
| 618 | } |
| 619 | ], |
| 620 | "request": { |
| 621 | "method": "GET", |
| 622 | "header": [ |
| 623 | { |
| 624 | "key": "Accept", |
| 625 | "value": "application/json" |
| 626 | }, |
| 627 | { |
| 628 | "key": "Content-Type", |
| 629 | "value": "application/json" |
| 630 | } |
| 631 | ], |
| 632 | "body": { |
| 633 | "mode": "raw", |
| 634 | "raw": "" |
| 635 | }, |
| 636 | "url": { |
| 637 | "raw": "{{url-nbi}}/nbi/api/v4/serviceOrder/{{auto_service_order_id}}", |
| 638 | "host": [ |
| 639 | "{{url-nbi}}" |
| 640 | ], |
| 641 | "path": [ |
| 642 | "nbi", |
| 643 | "api", |
| 644 | "v4", |
| 645 | "serviceOrder", |
| 646 | "{{auto_service_order_id}}" |
| 647 | ] |
| 648 | } |
| 649 | }, |
| 650 | "response": [] |
| 651 | }, |
| 652 | { |
| 653 | "name": "GET all service instance via ServiceInventory API", |
| 654 | "event": [ |
| 655 | { |
| 656 | "listen": "test", |
| 657 | "script": { |
| 658 | "id": "c7353dda-5afc-4c1c-a9d2-06036a9c984c", |
| 659 | "exec": [ |
| 660 | "var jsonData = pm.response.json();", |
| 661 | "", |
| 662 | "var service_instance_found = false;", |
| 663 | "", |
| 664 | "if (pm.response.code === 200){", |
| 665 | "for (var i = 0; i < jsonData.length; i++) { ", |
| 666 | " if (jsonData[i].name === pm.environment.get(\"service_instance_name\")) {", |
| 667 | " service_instance_found = true;", |
| 668 | " }", |
| 669 | "}", |
| 670 | "}", |
| 671 | "tests[pm.environment.get(\"service_instance_name\")+\" no longer in list\"] = service_instance_found === false;" |
| 672 | ], |
| 673 | "type": "text/javascript" |
| 674 | } |
| 675 | } |
| 676 | ], |
| 677 | "request": { |
| 678 | "method": "GET", |
| 679 | "header": [], |
| 680 | "body": { |
| 681 | "mode": "raw", |
| 682 | "raw": "" |
| 683 | }, |
| 684 | "url": { |
| 685 | "raw": "{{url-nbi}}/nbi/api/v4/service?relatedParty.id={{customer_name}}", |
| 686 | "host": [ |
| 687 | "{{url-nbi}}" |
| 688 | ], |
| 689 | "path": [ |
| 690 | "nbi", |
| 691 | "api", |
| 692 | "v4", |
| 693 | "service" |
| 694 | ], |
| 695 | "query": [ |
| 696 | { |
| 697 | "key": "relatedParty.id", |
| 698 | "value": "{{customer_name}}" |
| 699 | } |
| 700 | ] |
| 701 | } |
| 702 | }, |
| 703 | "response": [] |
| 704 | }, |
| 705 | { |
| 706 | "name": "DELETE Virtual Link", |
| 707 | "request": { |
| 708 | "method": "DELETE", |
| 709 | "header": [ |
| 710 | { |
| 711 | "key": "Accept", |
| 712 | "value": "application/json" |
| 713 | }, |
| 714 | { |
| 715 | "key": "Content-Type", |
| 716 | "value": "application/json" |
| 717 | }, |
| 718 | { |
| 719 | "key": "X-FromAppId", |
| 720 | "value": "AAI" |
| 721 | }, |
| 722 | { |
| 723 | "key": "X-TransactionId", |
| 724 | "value": "get_aai_subscr" |
| 725 | }, |
| 726 | { |
| 727 | "key": "Authorization", |
| 728 | "value": "Basic QUFJOkFBSQ==" |
| 729 | } |
| 730 | ], |
| 731 | "body": { |
| 732 | "mode": "raw", |
| 733 | "raw": "" |
| 734 | }, |
| 735 | "url": { |
| 736 | "raw": "{{url-aai}}/aai/v16/network/l3-networks/l3-network/{{auto_virtual_link_instance_id}}?resource-version=1564496333018", |
| 737 | "host": [ |
| 738 | "{{url-aai}}" |
| 739 | ], |
| 740 | "path": [ |
| 741 | "aai", |
| 742 | "v16", |
| 743 | "network", |
| 744 | "l3-networks", |
| 745 | "l3-network", |
| 746 | "{{auto_virtual_link_instance_id}}" |
| 747 | ], |
| 748 | "query": [ |
| 749 | { |
| 750 | "key": "resource-version", |
| 751 | "value": "1564496333018" |
| 752 | } |
| 753 | ] |
| 754 | } |
| 755 | }, |
| 756 | "response": [] |
| 757 | } |
| 758 | ] |
| 759 | } |