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}}/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}}/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}}/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}}/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\";",
180 "if(jsonData.hasOwnProperty('orderItem.service.id')){",
181 " postman.setGlobalVariable(\"auto_service_instance_id\", \"\"+jsonData.orderItem.service.id+\"\");",
183 "postman.setGlobalVariable(\"auto_service_messageInformation\", \"\"+jsonData.orderMessage[0].messageInformation+\"\");",
190 "url": "{{url-nbi}}/serviceOrder/{{auto_service_order_id}}",
195 "value": "application/json",
199 "key": "Content-Type",
200 "value": "application/json",
206 "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}"
213 "name": "GET created service instance in inventory",
218 "type": "text/javascript",
221 "tests[\"Status code is 200\"] = responseCode.code === 200;",
230 "url": "{{url-nbi}}/service/{{auto_service_instance_id}}",
239 "name": "Delete service Instance via ServiceOrder API",
244 "type": "text/javascript",
246 "tests[\"Status code is 201\"] = responseCode.code === 201;",
248 "var jsonData = JSON.parse(responseBody);",
249 "postman.setGlobalVariable(\"auto_service_order_id\", jsonData.id);",
259 "url": "{{url-nbi}}/serviceOrder",
264 "value": "application/json",
268 "key": "Content-Type",
269 "value": "application/json",
275 "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}"
284 "url": "https://postman-echo.com/delay/10",
296 "name": "GET previous serviceOrder",
301 "type": "text/javascript",
304 "tests[\"Status code is 200\"] = responseCode.code === 200;",
306 "var jsonData = JSON.parse(responseBody);",
308 "tests[postman.getGlobalVariable(\"externalId\")+\" exists\"] = jsonData.externalId === postman.getGlobalVariable(\"externalId\");",
309 "tests[\"service_order_id exists\"] = jsonData.id === postman.getGlobalVariable(\"auto_service_order_id\");",
310 "tests[\"service Order state is COMPLETED\"] = jsonData.state === \"COMPLETED\";",
311 "tests[\"Service Instance state is ACTIVE\"] = jsonData.orderItem[0].service.serviceState === \"active\";",
312 "postman.setGlobalVariable(\"auto_service_instance_id\", \"\"+jsonData.orderItem[0].service.id+\"\");",
319 "url": "{{url-nbi}}/serviceOrder/{{auto_service_order_id}}",
324 "value": "application/json",
328 "key": "Content-Type",
329 "value": "application/json",
335 "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}"
342 "name": "GET service instance in inventory (should no longer exists)",
347 "type": "text/javascript",
350 "tests[\"Status code is 404\"] = responseCode.code === 404;",
359 "url": "{{url-nbi}}/service/{{auto_service_instance_id}}",
368 "name": "GET all service instance via ServiceInventory API",
373 "type": "text/javascript",
377 "tests[\"Status code is 200\"] = responseCode.code === 200;",
379 "var jsonData = JSON.parse(responseBody);",
380 "var service_instance_found = false;",
381 "for (var i = 0; i < jsonData.length; i++) { ",
382 " if (jsonData[i].name === postman.getGlobalVariable(\"service_instance_name\")) {",
383 " service_instance_found = true;",
386 "tests[postman.getGlobalVariable(\"service_instance_name\")+\" does not exist\"] = service_instance_found === false;"
393 "raw": "{{url-nbi}}/service?relatedParty.id={{customer_name}}",
405 "key": "relatedParty.id",
406 "value": "{{customer_name}}",
426 "type": "text/javascript",
428 "tests[\"Status code is 200\"] = responseCode.code === 200;",
435 "url": "{{url-nbi}}/hub",