Issue-ID: INT-1178
[integration.git] / test / postman / 02_Onboard_VSP_part1.postman_collection.json
1 {
2         "info": {
3                 "_postman_id": "e226e82c-74b6-42bc-a1e9-1168b860a234",
4                 "name": "02_Onboard_VSP_part1",
5                 "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
6         },
7         "item": [
8                 {
9                         "name": "check VSP exists",
10                         "event": [
11                                 {
12                                         "listen": "test",
13                                         "script": {
14                                                 "id": "dc866867-2909-4844-9072-01c9e2e4e856",
15                                                 "exec": [
16                                                         "pm.test(\"Status code is 200\", function () {",
17                                                         "    pm.response.to.have.status(200);",
18                                                         "});",
19                                                         "",
20                                                         "var jsonData = pm.response.json();",
21                                                         "var vsp_found = false;",
22                                                         "for (var i = 0; i < jsonData.results.length; i++) { ",
23                                                         "   if (jsonData.results[i].name === pm.globals.get(\"vsp_name\")) {",
24                                                         "       vsp_found = true;",
25                                                         "   }",
26                                                         "}",
27                                                         "",
28                                                         "if (vsp_found === false) {",
29                                                         "    tests[pm.globals.get(\"vsp_name\")+\" does not yet exist, we continue\"] = true;",
30                                                         "}",
31                                                         "",
32                                                         "else {",
33                                                         "    tests[pm.globals.get(\"vsp_name\")+\" already exists, we stop the run\"] = false;",
34                                                         "    postman.setNextRequest(null);",
35                                                         "}"
36                                                 ],
37                                                 "type": "text/javascript"
38                                         }
39                                 }
40                         ],
41                         "request": {
42                                 "method": "GET",
43                                 "header": [
44                                         {
45                                                 "key": "Content-Type",
46                                                 "value": "application/json"
47                                         },
48                                         {
49                                                 "key": "Accept",
50                                                 "value": "application/json"
51                                         },
52                                         {
53                                                 "key": "X-TransactionId",
54                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
55                                         },
56                                         {
57                                                 "key": "USER_ID",
58                                                 "value": "cs0008"
59                                         },
60                                         {
61                                                 "key": "X-FromAppId",
62                                                 "value": "robot-ete"
63                                         }
64                                 ],
65                                 "body": {
66                                         "mode": "raw",
67                                         "raw": ""
68                                 },
69                                 "url": {
70                                         "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
71                                         "host": [
72                                                 "{{url-sdc2}}"
73                                         ],
74                                         "path": [
75                                                 "sdc1",
76                                                 "feProxy",
77                                                 "onboarding-api",
78                                                 "v1.0",
79                                                 "vendor-software-products"
80                                         ]
81                                 }
82                         },
83                         "response": []
84                 },
85                 {
86                         "name": "Get Vendor infos",
87                         "event": [
88                                 {
89                                         "listen": "test",
90                                         "script": {
91                                                 "id": "dbd0ea7f-5f66-4431-8a51-2e5d757647a0",
92                                                 "exec": [
93                                                         "pm.test(\"Status code is 200\", function () {",
94                                                         "    pm.response.to.have.status(200);",
95                                                         "});",
96                                                         "",
97                                                         "",
98                                                         "var jsonData = pm.response.json();",
99                                                         "var vendor_found = false;",
100                                                         "for (var i = 0; i < jsonData.results.length; i++) { ",
101                                                         "   if (jsonData.results[i].name === pm.globals.get(\"vendor_name\")) {",
102                                                         "       vendor_found = true;",
103                                                         "       pm.globals.set(\"auto_vendor_id\", \"\"+jsonData.results[i].id+\"\");",
104                                                         "   }",
105                                                         "}",
106                                                         "if (vendor_found === false) {",
107                                                         "    tests[pm.globals.get(\"vendor_name\")+\" does not exists : we stop the run\"] = false;",
108                                                         "    postman.setNextRequest(null);",
109                                                         "}",
110                                                         "",
111                                                         "else {",
112                                                         "    tests[pm.globals.get(\"vendor_name\")+\" exists\"] = true;",
113                                                         "}",
114                                                         "",
115                                                         "",
116                                                         ""
117                                                 ],
118                                                 "type": "text/javascript"
119                                         }
120                                 }
121                         ],
122                         "request": {
123                                 "method": "GET",
124                                 "header": [
125                                         {
126                                                 "key": "Content-Type",
127                                                 "value": "application/json"
128                                         },
129                                         {
130                                                 "key": "Accept",
131                                                 "value": "application/json"
132                                         },
133                                         {
134                                                 "key": "X-TransactionId",
135                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
136                                         },
137                                         {
138                                                 "key": "USER_ID",
139                                                 "value": "cs0008"
140                                         },
141                                         {
142                                                 "key": "X-FromAppId",
143                                                 "value": "robot-ete"
144                                         }
145                                 ],
146                                 "body": {
147                                         "mode": "raw",
148                                         "raw": ""
149                                 },
150                                 "url": {
151                                         "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
152                                         "host": [
153                                                 "{{url-sdc2}}"
154                                         ],
155                                         "path": [
156                                                 "sdc1",
157                                                 "feProxy",
158                                                 "onboarding-api",
159                                                 "v1.0",
160                                                 "vendor-license-models"
161                                         ]
162                                 }
163                         },
164                         "response": []
165                 },
166                 {
167                         "name": "Create VSP",
168                         "event": [
169                                 {
170                                         "listen": "test",
171                                         "script": {
172                                                 "id": "739f040c-f4b1-4790-bfce-4f5dae60b637",
173                                                 "exec": [
174                                                         "pm.test(\"Status code is 200\", function () {",
175                                                         "    pm.response.to.have.status(200);",
176                                                         "});",
177                                                         "",
178                                                         "var jsonData = pm.response.json();",
179                                                         "pm.globals.set(\"auto_vsp_id\", \"\"+jsonData.itemId+\"\");",
180                                                         "pm.globals.set(\"auto_vsp_version_id\", \"\"+jsonData.version.id+\"\");",
181                                                         "pm.globals.set(\"auto_vsp_version_name\", \"\"+jsonData.version.name+\"\");",
182                                                         "",
183                                                         "tests[\"VSP version is : \"+jsonData.version.status] = jsonData.version.status === \"Draft\";"
184                                                 ],
185                                                 "type": "text/javascript"
186                                         }
187                                 }
188                         ],
189                         "request": {
190                                 "method": "POST",
191                                 "header": [
192                                         {
193                                                 "key": "Content-Type",
194                                                 "value": "application/json"
195                                         },
196                                         {
197                                                 "key": "Accept",
198                                                 "value": "application/json"
199                                         },
200                                         {
201                                                 "key": "X-TransactionId",
202                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
203                                         },
204                                         {
205                                                 "key": "USER_ID",
206                                                 "value": "cs0008"
207                                         },
208                                         {
209                                                 "key": "X-FromAppId",
210                                                 "value": "robot-ete"
211                                         }
212                                 ],
213                                 "body": {
214                                         "mode": "raw",
215                                         "raw": "{\r\n  \"name\": \"{{vsp_name}}\",\r\n  \"description\": \"vendor software product\",\r\n  \"icon\": \"icon\",\r\n  \"category\": \"resourceNewCategory.generic\",\r\n  \"subCategory\": \"resourceNewCategory.generic.abstract\",\r\n  \"vendorName\": \"{{vendor_name}}\",\r\n  \"vendorId\": \"{{auto_vendor_id}}\",\r\n  \"licensingData\": {},\r\n  \"onboardingMethod\": \"NetworkPackage\"\r\n}"
216                                 },
217                                 "url": {
218                                         "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
219                                         "host": [
220                                                 "{{url-sdc2}}"
221                                         ],
222                                         "path": [
223                                                 "sdc1",
224                                                 "feProxy",
225                                                 "onboarding-api",
226                                                 "v1.0",
227                                                 "vendor-software-products"
228                                         ]
229                                 }
230                         },
231                         "response": [
232                                 {
233                                         "name": "Create Vendor Software Product",
234                                         "originalRequest": {
235                                                 "method": "GET",
236                                                 "header": [],
237                                                 "body": {
238                                                         "mode": "raw",
239                                                         "raw": ""
240                                                 },
241                                                 "url": {
242                                                         "raw": ""
243                                                 }
244                                         },
245                                         "status": "OK",
246                                         "code": 200,
247                                         "_postman_previewlanguage": "json",
248                                         "header": [
249                                                 {
250                                                         "key": "access-control-allow-credentials",
251                                                         "value": "true",
252                                                         "name": "access-control-allow-credentials",
253                                                         "description": "Indicates whether or not the response to the request can be exposed when the credentials flag is true. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials."
254                                                 },
255                                                 {
256                                                         "key": "access-control-allow-origin",
257                                                         "value": "chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop",
258                                                         "name": "access-control-allow-origin",
259                                                         "description": "Specifies a URI that may access the resource. For requests without credentials, the server may specify '*' as a wildcard, thereby allowing any origin to access the resource."
260                                                 },
261                                                 {
262                                                         "key": "access-control-expose-headers",
263                                                         "value": "",
264                                                         "name": "access-control-expose-headers",
265                                                         "description": "Lets a server whitelist headers that browsers are allowed to access."
266                                                 },
267                                                 {
268                                                         "key": "content-type",
269                                                         "value": "application/json",
270                                                         "name": "content-type",
271                                                         "description": "The mime type of this content"
272                                                 },
273                                                 {
274                                                         "key": "date",
275                                                         "value": "Wed, 06 Jun 2018 15:02:46 GMT",
276                                                         "name": "date",
277                                                         "description": "The date and time that the message was sent"
278                                                 },
279                                                 {
280                                                         "key": "server",
281                                                         "value": "Jetty(9.3.21.v20170918)",
282                                                         "name": "server",
283                                                         "description": "A name for the server"
284                                                 },
285                                                 {
286                                                         "key": "transfer-encoding",
287                                                         "value": "chunked",
288                                                         "name": "transfer-encoding",
289                                                         "description": "The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity."
290                                                 }
291                                         ],
292                                         "cookie": [],
293                                         "body": "{\"vspId\":\"b3267b0aefbd4e2ea52be0e414139b1c\"}"
294                                 }
295                         ]
296                 },
297                 {
298                         "name": "Get VSP versions",
299                         "event": [
300                                 {
301                                         "listen": "test",
302                                         "script": {
303                                                 "id": "5e55115d-c797-4b34-bfaf-d2af24d62c01",
304                                                 "exec": [
305                                                         "pm.test(\"Status code is 200\", function () {",
306                                                         "    pm.response.to.have.status(200);",
307                                                         "});"
308                                                 ],
309                                                 "type": "text/javascript"
310                                         }
311                                 }
312                         ],
313                         "request": {
314                                 "method": "GET",
315                                 "header": [
316                                         {
317                                                 "key": "Content-Type",
318                                                 "value": "application/json"
319                                         },
320                                         {
321                                                 "key": "Accept",
322                                                 "value": "application/json"
323                                         },
324                                         {
325                                                 "key": "X-TransactionId",
326                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
327                                         },
328                                         {
329                                                 "key": "USER_ID",
330                                                 "value": "cs0008"
331                                         },
332                                         {
333                                                 "key": "X-FromAppId",
334                                                 "value": "robot-ete"
335                                         }
336                                 ],
337                                 "body": {
338                                         "mode": "raw",
339                                         "raw": ""
340                                 },
341                                 "url": {
342                                         "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions",
343                                         "host": [
344                                                 "{{url-sdc2}}"
345                                         ],
346                                         "path": [
347                                                 "sdc1",
348                                                 "feProxy",
349                                                 "onboarding-api",
350                                                 "v1.0",
351                                                 "items",
352                                                 "{{auto_vsp_id}}",
353                                                 "versions"
354                                         ]
355                                 }
356                         },
357                         "response": []
358                 },
359                 {
360                         "name": "Get VSP status",
361                         "event": [
362                                 {
363                                         "listen": "test",
364                                         "script": {
365                                                 "id": "2492d06b-4b31-4d93-aaf2-3417419c6e14",
366                                                 "exec": [
367                                                         "pm.test(\"Status code is 200\", function () {",
368                                                         "    pm.response.to.have.status(200);",
369                                                         "});",
370                                                         ""
371                                                 ],
372                                                 "type": "text/javascript"
373                                         }
374                                 }
375                         ],
376                         "request": {
377                                 "method": "GET",
378                                 "header": [
379                                         {
380                                                 "key": "Content-Type",
381                                                 "value": "application/json"
382                                         },
383                                         {
384                                                 "key": "Accept",
385                                                 "value": "application/json"
386                                         },
387                                         {
388                                                 "key": "X-TransactionId",
389                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a"
390                                         },
391                                         {
392                                                 "key": "USER_ID",
393                                                 "value": "cs0008"
394                                         },
395                                         {
396                                                 "key": "X-FromAppId",
397                                                 "value": "robot-ete"
398                                         }
399                                 ],
400                                 "body": {
401                                         "mode": "raw",
402                                         "raw": ""
403                                 },
404                                 "url": {
405                                         "raw": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions/{{auto_vsp_version_id}}",
406                                         "host": [
407                                                 "{{url-sdc2}}"
408                                         ],
409                                         "path": [
410                                                 "sdc1",
411                                                 "feProxy",
412                                                 "onboarding-api",
413                                                 "v1.0",
414                                                 "items",
415                                                 "{{auto_vsp_id}}",
416                                                 "versions",
417                                                 "{{auto_vsp_version_id}}"
418                                         ]
419                                 }
420                         },
421                         "response": []
422                 }
423         ]
424 }