4 "name": "10_Service Order",
5 "_postman_id": "28bdf2bb-4886-b8e7-45e3-eac832efc757",
7 "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
11 "name": "GET ExternalAPI-NBI component Status (HealthCheck)",
16 "type": "text/javascript",
18 "tests[\"Status code is 200\"] = responseCode.code === 200;",
21 "var jsonData = JSON.parse(responseBody);",
22 "tests[\"status\"] = jsonData.status === \"ok\";"
28 "url": "{{url-nbi}}/nbi/api/v3/status",
37 "name": "GET all service models from Service Catalog API",
42 "type": "text/javascript",
44 "tests[\"Status code is 200\"] = responseCode.code === 200;",
46 "var jsonData = JSON.parse(responseBody);",
47 "var service_found = false;",
48 "for (var i = 0; i < jsonData.length; i++) { ",
49 " if (jsonData[i].name === postman.getGlobalVariable(\"service\")) {",
50 " service_found = true;",
51 " postman.setGlobalVariable(\"auto_service_id\", \"\"+jsonData[i].id+\"\");",
54 "tests[postman.getGlobalVariable(\"service\")+\" exists\"] = service_found === true;",
61 "url": "{{url-nbi}}/nbi/api/v3/serviceSpecification",
70 "name": "GET all service instances via ServiceInventory API",
75 "type": "text/javascript",
77 "tests[\"Status code is 200\"] = responseCode.code === 200;",
79 "var jsonData = JSON.parse(responseBody);",
80 "var service_instance_found = false;",
81 "for (var i = 0; i < jsonData.length; i++) { ",
82 " if (jsonData[i].name === postman.getGlobalVariable(\"service_instance_name\")) {",
83 " service_instance_found = true;",
86 "tests[postman.getGlobalVariable(\"service_instance_name\")+\" does not exist\"] = service_instance_found === false;"
93 "raw": "{{url-nbi}}/nbi/api/v3/service?relatedParty.id={{customer_name}}",
105 "key": "relatedParty.id",
106 "value": "{{customer_name}}",
121 "name": "Add service instance via ServiceOrder API",
126 "type": "text/javascript",
128 "tests[\"Status code is 201\"] = responseCode.code === 201;",
130 "var jsonData = JSON.parse(responseBody);",
131 "tests[postman.getGlobalVariable(\"externalId\")+\" exists\"] = jsonData.externalId === postman.getGlobalVariable(\"externalId\");",
133 "postman.setGlobalVariable(\"auto_service_order_id\", jsonData.id);",
140 "url": "{{url-nbi}}/nbi/api/v3/serviceOrder",
145 "value": "application/json",
149 "key": "Content-Type",
150 "value": "application/json",
156 "raw": "{\n \"externalId\": \"{{externalId}}\",\n \"priority\": \"1\",\n \"description\": \"{{service}} order for 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\": \"add\",\n \"service\": {\n \"name\": \"{{service_instance_name}}\",\n \"serviceState\": \"active\",\n \"serviceSpecification\": {\n \"id\": \"{{auto_service_id}}\"\n }\n }\n }\n ]\n}"
163 "name": "GET previous serviceOrder",
168 "type": "text/javascript",
171 "tests[\"Status code is 200\"] = responseCode.code === 200;",
173 "var jsonData = JSON.parse(responseBody);",
175 "tests[postman.getGlobalVariable(\"externalId\")+\" exists\"] = jsonData.externalId === postman.getGlobalVariable(\"externalId\");",
176 "tests[\"service_order_id exists\"] = jsonData.id === postman.getGlobalVariable(\"auto_service_order_id\");",
177 "tests[\"service Order state is COMPLETED\"] = jsonData.state === \"COMPLETED\";",
178 "tests[\"Service Instance state is ACTIVE\"] = jsonData.orderItem[0].service.serviceState === \"active\";",
179 "postman.setGlobalVariable(\"auto_service_instance_id\", \"\"+jsonData.orderItem[0].service.id+\"\");",
186 "url": "{{url-nbi}}/nbi/api/v3/serviceOrder/{{auto_service_order_id}}",
191 "value": "application/json",
195 "key": "Content-Type",
196 "value": "application/json",
202 "raw": "{\n \"externalId\": \"NBI-SO002\",\n \"priority\": \"1\",\n \"description\": \"Firevall service ordering on customer not specified - added to generic customer\",\n \"category\": \"Consumer\",\n \"requestedStartDate\": \"2018-02-28T13:33:37.299Z\",\n \"requestedCompletionDate\": \"2018-02-28T13:33:37.299Z\",\n \"orderItem\": [\n {\n \"id\": \"1\",\n \"action\": \"add\",\n \"service\": {\n \"id\": \"vFW0002\",\n \"serviceState\": \"active\",\n \"serviceSpecification\": {\n \"id\": \"ff3c8594-499e-445c-8d14-758231f47799\"\n }\n }\n }\n ]\n}"
209 "name": "GET created service instance in inventory",
214 "type": "text/javascript",
217 "tests[\"Status code is 200\"] = responseCode.code === 200;",
227 "raw": "{{url-nbi}}/nbi/api/v3/service/{{auto_service_instance_id}}?relatedParty.id={{customer_name}}&serviceSpecification.name={{service}}",
236 "{{auto_service_instance_id}}"
240 "key": "relatedParty.id",
241 "value": "{{customer_name}}",
246 "key": "serviceSpecification.name",
247 "value": "{{service}}",
262 "name": "Delete service Instance via ServiceOrder API",
267 "type": "text/javascript",
269 "tests[\"Status code is 201\"] = responseCode.code === 201;",
271 "var jsonData = JSON.parse(responseBody);",
272 "postman.setGlobalVariable(\"auto_service_order_id\", jsonData.id);",
282 "url": "{{url-nbi}}/nbi/api/v3/serviceOrder",
287 "value": "application/json",
291 "key": "Content-Type",
292 "value": "application/json",
298 "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}"
307 "url": "https://postman-echo.com/delay/10",
319 "name": "GET previous serviceOrder",
324 "type": "text/javascript",
327 "tests[\"Status code is 200\"] = responseCode.code === 200;",
329 "var jsonData = JSON.parse(responseBody);",
331 "tests[postman.getGlobalVariable(\"externalId\")+\" exists\"] = jsonData.externalId === postman.getGlobalVariable(\"externalId\");",
332 "tests[\"service_order_id exists\"] = jsonData.id === postman.getGlobalVariable(\"auto_service_order_id\");",
333 "tests[\"service Order state is COMPLETED\"] = jsonData.state === \"COMPLETED\";",
334 "tests[\"Service Instance state is ACTIVE\"] = jsonData.orderItem[0].service.serviceState === \"active\";",
335 "postman.setGlobalVariable(\"auto_service_instance_id\", \"\"+jsonData.orderItem[0].service.id+\"\");",
342 "url": "{{url-nbi}}/nbi/api/v3/serviceOrder/{{auto_service_order_id}}",
347 "value": "application/json",
351 "key": "Content-Type",
352 "value": "application/json",
358 "raw": "{\n \"externalId\": \"NBI-SO002\",\n \"priority\": \"1\",\n \"description\": \"Firevall service ordering on customer not specified - added to generic customer\",\n \"category\": \"Consumer\",\n \"requestedStartDate\": \"2018-02-28T13:33:37.299Z\",\n \"requestedCompletionDate\": \"2018-02-28T13:33:37.299Z\",\n \"orderItem\": [\n {\n \"id\": \"1\",\n \"action\": \"add\",\n \"service\": {\n \"id\": \"vFW0002\",\n \"serviceState\": \"active\",\n \"serviceSpecification\": {\n \"id\": \"ff3c8594-499e-445c-8d14-758231f47799\"\n }\n }\n }\n ]\n}"
365 "name": "GET service instance in inventory (should no longer exists)",
370 "type": "text/javascript",
373 "tests[\"Status code is 200\"] = responseCode.code === 200;",
383 "raw": "{{url-nbi}}/nbi/api/v3/service/{{auto_service_instance_id}}?relatedParty.id={{customer_name}}&serviceSpecification.name={{service}}",
392 "{{auto_service_instance_id}}"
396 "key": "relatedParty.id",
397 "value": "{{customer_name}}",
402 "key": "serviceSpecification.name",
403 "value": "{{service}}",
418 "name": "GET all service instance via ServiceInventory API",
423 "type": "text/javascript",
427 "tests[\"Status code is 200\"] = responseCode.code === 200;",
429 "var jsonData = JSON.parse(responseBody);",
430 "var service_instance_found = false;",
431 "for (var i = 0; i < jsonData.length; i++) { ",
432 " if (jsonData[i].name === postman.getGlobalVariable(\"service_instance_name\")) {",
433 " service_instance_found = true;",
436 "tests[postman.getGlobalVariable(\"service_instance_name\")+\" does not exist\"] = service_instance_found === false;"
443 "raw": "{{url-nbi}}/nbi/api/v3/service?relatedParty.id={{customer_name}}",
455 "key": "relatedParty.id",
456 "value": "{{customer_name}}",
476 "type": "text/javascript",
478 "tests[\"Status code is 200\"] = responseCode.code === 200;",
485 "url": "{{url-nbi}}/nbi/api/v3/hub",