207d35a6c374ff716d2d5d8d27e8ceabf511c81f
[integration.git] / test / postman / 02_Onboard_VSP_part1.postman_collection.json
1 {
2         "variables": [],
3         "info": {
4                 "name": "02_Onboard_VSP_part1",
5                 "_postman_id": "8c958074-e35a-6ae9-4ce4-2133b11d72b0",
6                 "description": "",
7                 "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
8         },
9         "item": [
10                 {
11                         "name": "check VSP exists",
12                         "event": [
13                                 {
14                                         "listen": "test",
15                                         "script": {
16                                                 "type": "text/javascript",
17                                                 "exec": [
18                                                         "tests[\"Status code is 200\"] = responseCode.code === 200;",
19                                                         "",
20                                                         "var jsonData = JSON.parse(responseBody);",
21                                                         "var vsp_found = false;",
22                                                         "for (var i = 0; i < jsonData['results'].length; i++) { ",
23                                                         "   if (jsonData['results'][i].name === postman.getGlobalVariable(\"vsp_name\")) {",
24                                                         "       vsp_found = true;",
25                                                         "   }",
26                                                         "}",
27                                                         "",
28                                                         "if (vsp_found === false) {",
29                                                         "    tests[postman.getGlobalVariable(\"vsp_name\")+\" does not exists, we continue\"] = true;",
30                                                         "}",
31                                                         "",
32                                                         "else {",
33                                                         "    tests[postman.getGlobalVariable(\"vsp_name\")+\" already exists, we stop the run\"] = true;",
34                                                         "    postman.setNextRequest(null);",
35                                                         "}"
36                                                 ]
37                                         }
38                                 }
39                         ],
40                         "request": {
41                                 "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
42                                 "method": "GET",
43                                 "header": [
44                                         {
45                                                 "key": "Content-Type",
46                                                 "value": "application/json",
47                                                 "description": ""
48                                         },
49                                         {
50                                                 "key": "Accept",
51                                                 "value": "application/json",
52                                                 "description": ""
53                                         },
54                                         {
55                                                 "key": "X-TransactionId",
56                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
57                                                 "description": ""
58                                         },
59                                         {
60                                                 "key": "USER_ID",
61                                                 "value": "cs0008",
62                                                 "description": ""
63                                         },
64                                         {
65                                                 "key": "X-FromAppId",
66                                                 "value": "robot-ete",
67                                                 "description": ""
68                                         }
69                                 ],
70                                 "body": {
71                                         "mode": "raw",
72                                         "raw": "{\"category\": \"resourceNewCategory.generic\", \"vendorId\": \"CE00625F0B334F7FBD7294293956649E\", \"subCategory\": \"resourceNewCategory.generic.abstract\", \"description\": \"vendor software product\", \"licensingVersion\": \"1.0\", \"licensingData\": {\"featureGroups\": [\"74F4A12BA9B5461CAF69C17AB4301889\"], \"licenseAgreement\": \"D738E60042A14FE0914B375F3FAE1BC8\"}, \"icon\": \"icon\", \"vendorName\": \"test-api-license-model\", \"name\": \"test-vsp\"}"
73                                 },
74                                 "description": ""
75                         },
76                         "response": []
77                 },
78                 {
79                         "name": "Get Vendor infos",
80                         "event": [
81                                 {
82                                         "listen": "test",
83                                         "script": {
84                                                 "type": "text/javascript",
85                                                 "exec": [
86                                                         "tests[\"Status code is 200\"] = responseCode.code === 200;",
87                                                         "",
88                                                         "var jsonData = JSON.parse(responseBody);",
89                                                         "var vendor_found = false;",
90                                                         "for (var i = 0; i < jsonData.results.length; i++) { ",
91                                                         "   if (jsonData.results[i][\"name\"] === postman.getGlobalVariable(\"vendor_name\")) {",
92                                                         "       vendor_found = true;",
93                                                         "       postman.setGlobalVariable(\"auto_vendor_id\", \"\"+jsonData.results[i][\"id\"]+\"\");",
94                                                         "   }",
95                                                         "}",
96                                                         "if (vendor_found === false) {",
97                                                         "    tests[postman.getGlobalVariable(\"vendor_name\")+\" does not exists : we stop the run\"] = false;",
98                                                         "    postman.setNextRequest(null);",
99                                                         "}",
100                                                         "",
101                                                         "else {",
102                                                         "    tests[postman.getGlobalVariable(\"vendor_name\")+\" exists\"] = true;",
103                                                         "}",
104                                                         "",
105                                                         "",
106                                                         ""
107                                                 ]
108                                         }
109                                 }
110                         ],
111                         "request": {
112                                 "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-license-models",
113                                 "method": "GET",
114                                 "header": [
115                                         {
116                                                 "key": "Content-Type",
117                                                 "value": "application/json",
118                                                 "description": ""
119                                         },
120                                         {
121                                                 "key": "Accept",
122                                                 "value": "application/json",
123                                                 "description": ""
124                                         },
125                                         {
126                                                 "key": "X-TransactionId",
127                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
128                                                 "description": ""
129                                         },
130                                         {
131                                                 "key": "USER_ID",
132                                                 "value": "cs0008",
133                                                 "description": ""
134                                         },
135                                         {
136                                                 "key": "X-FromAppId",
137                                                 "value": "robot-ete",
138                                                 "description": ""
139                                         }
140                                 ],
141                                 "body": {
142                                         "mode": "raw",
143                                         "raw": "{\"iconRef\": \"icon\", \"vendorName\": \"test-api-license-model\", \"description\": \"vendor license model\"}"
144                                 },
145                                 "description": ""
146                         },
147                         "response": []
148                 },
149                 {
150                         "name": "Create VSP",
151                         "event": [
152                                 {
153                                         "listen": "test",
154                                         "script": {
155                                                 "type": "text/javascript",
156                                                 "exec": [
157                                                         "tests[\"Status code is 200\"] = responseCode.code === 200;",
158                                                         "",
159                                                         "var jsonData = JSON.parse(responseBody);",
160                                                         "postman.setGlobalVariable(\"auto_vsp_id\", \"\"+jsonData[\"itemId\"]+\"\");",
161                                                         "postman.setGlobalVariable(\"auto_vsp_version_id\", \"\"+jsonData[\"version\"][\"id\"]+\"\");",
162                                                         "postman.setGlobalVariable(\"auto_vsp_version_name\", \"\"+jsonData[\"version\"][\"name\"]+\"\");",
163                                                         "",
164                                                         "tests[\"Vendor version is in Draft status\"] = jsonData[\"version\"][\"status\"] === \"Draft\";"
165                                                 ]
166                                         }
167                                 }
168                         ],
169                         "request": {
170                                 "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products",
171                                 "method": "POST",
172                                 "header": [
173                                         {
174                                                 "key": "Content-Type",
175                                                 "value": "application/json",
176                                                 "description": ""
177                                         },
178                                         {
179                                                 "key": "Accept",
180                                                 "value": "application/json",
181                                                 "description": ""
182                                         },
183                                         {
184                                                 "key": "X-TransactionId",
185                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
186                                                 "description": ""
187                                         },
188                                         {
189                                                 "key": "USER_ID",
190                                                 "value": "cs0008",
191                                                 "description": ""
192                                         },
193                                         {
194                                                 "key": "X-FromAppId",
195                                                 "value": "robot-ete",
196                                                 "description": ""
197                                         }
198                                 ],
199                                 "body": {
200                                         "mode": "raw",
201                                         "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}"
202                                 },
203                                 "description": ""
204                         },
205                         "response": [
206                                 {
207                                         "id": "ca88aaf4-ec1b-4d75-8834-85c628a10c50",
208                                         "name": "Create Vendor Software Product",
209                                         "originalRequest": {
210                                                 "url": "",
211                                                 "header": [],
212                                                 "body": {
213                                                         "mode": "raw",
214                                                         "raw": ""
215                                                 },
216                                                 "description": ""
217                                         },
218                                         "status": "OK",
219                                         "code": 200,
220                                         "_postman_previewlanguage": "json",
221                                         "_postman_previewtype": "text",
222                                         "header": [
223                                                 {
224                                                         "name": "access-control-allow-credentials",
225                                                         "key": "access-control-allow-credentials",
226                                                         "value": "true",
227                                                         "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."
228                                                 },
229                                                 {
230                                                         "name": "access-control-allow-origin",
231                                                         "key": "access-control-allow-origin",
232                                                         "value": "chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop",
233                                                         "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."
234                                                 },
235                                                 {
236                                                         "name": "access-control-expose-headers",
237                                                         "key": "access-control-expose-headers",
238                                                         "value": "",
239                                                         "description": "Lets a server whitelist headers that browsers are allowed to access."
240                                                 },
241                                                 {
242                                                         "name": "content-type",
243                                                         "key": "content-type",
244                                                         "value": "application/json",
245                                                         "description": "The mime type of this content"
246                                                 },
247                                                 {
248                                                         "name": "date",
249                                                         "key": "date",
250                                                         "value": "Wed, 06 Jun 2018 15:02:46 GMT",
251                                                         "description": "The date and time that the message was sent"
252                                                 },
253                                                 {
254                                                         "name": "server",
255                                                         "key": "server",
256                                                         "value": "Jetty(9.3.21.v20170918)",
257                                                         "description": "A name for the server"
258                                                 },
259                                                 {
260                                                         "name": "transfer-encoding",
261                                                         "key": "transfer-encoding",
262                                                         "value": "chunked",
263                                                         "description": "The form of encoding used to safely transfer the entity to the user. Currently defined methods are: chunked, compress, deflate, gzip, identity."
264                                                 }
265                                         ],
266                                         "cookie": [],
267                                         "responseTime": 82,
268                                         "body": "{\"vspId\":\"b3267b0aefbd4e2ea52be0e414139b1c\"}"
269                                 }
270                         ]
271                 },
272                 {
273                         "name": "Get VSP versions",
274                         "event": [
275                                 {
276                                         "listen": "test",
277                                         "script": {
278                                                 "type": "text/javascript",
279                                                 "exec": [
280                                                         "tests[\"Status code is 200\"] = responseCode.code === 200;"
281                                                 ]
282                                         }
283                                 }
284                         ],
285                         "request": {
286                                 "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions",
287                                 "method": "GET",
288                                 "header": [
289                                         {
290                                                 "key": "Content-Type",
291                                                 "value": "application/json",
292                                                 "description": ""
293                                         },
294                                         {
295                                                 "key": "Accept",
296                                                 "value": "application/json",
297                                                 "description": ""
298                                         },
299                                         {
300                                                 "key": "X-TransactionId",
301                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
302                                                 "description": ""
303                                         },
304                                         {
305                                                 "key": "USER_ID",
306                                                 "value": "cs0008",
307                                                 "description": ""
308                                         },
309                                         {
310                                                 "key": "X-FromAppId",
311                                                 "value": "robot-ete",
312                                                 "description": ""
313                                         }
314                                 ],
315                                 "body": {
316                                         "mode": "raw",
317                                         "raw": "{\"category\": \"resourceNewCategory.generic\", \"vendorId\": \"CE00625F0B334F7FBD7294293956649E\", \"subCategory\": \"resourceNewCategory.generic.abstract\", \"description\": \"vendor software product\", \"licensingVersion\": \"1.0\", \"licensingData\": {\"featureGroups\": [\"74F4A12BA9B5461CAF69C17AB4301889\"], \"licenseAgreement\": \"D738E60042A14FE0914B375F3FAE1BC8\"}, \"icon\": \"icon\", \"vendorName\": \"test-api-license-model\", \"name\": \"test-vsp\"}"
318                                 },
319                                 "description": ""
320                         },
321                         "response": []
322                 },
323                 {
324                         "name": "Get VSP status",
325                         "event": [
326                                 {
327                                         "listen": "test",
328                                         "script": {
329                                                 "type": "text/javascript",
330                                                 "exec": [
331                                                         "tests[\"Status code is 200\"] = responseCode.code === 200;"
332                                                 ]
333                                         }
334                                 }
335                         ],
336                         "request": {
337                                 "url": "{{url-sdc2}}/sdc1/feProxy/onboarding-api/v1.0/items/{{auto_vsp_id}}/versions/{{auto_vsp_version_id}}",
338                                 "method": "GET",
339                                 "header": [
340                                         {
341                                                 "key": "Content-Type",
342                                                 "value": "application/json",
343                                                 "description": ""
344                                         },
345                                         {
346                                                 "key": "Accept",
347                                                 "value": "application/json",
348                                                 "description": ""
349                                         },
350                                         {
351                                                 "key": "X-TransactionId",
352                                                 "value": "robot-ete-ba84612d-c1c6-4c53-9967-7b1dff276c7a",
353                                                 "description": ""
354                                         },
355                                         {
356                                                 "key": "USER_ID",
357                                                 "value": "cs0008",
358                                                 "description": ""
359                                         },
360                                         {
361                                                 "key": "X-FromAppId",
362                                                 "value": "robot-ete",
363                                                 "description": ""
364                                         }
365                                 ],
366                                 "body": {
367                                         "mode": "raw",
368                                         "raw": "{\"category\": \"resourceNewCategory.generic\", \"vendorId\": \"CE00625F0B334F7FBD7294293956649E\", \"subCategory\": \"resourceNewCategory.generic.abstract\", \"description\": \"vendor software product\", \"licensingVersion\": \"1.0\", \"licensingData\": {\"featureGroups\": [\"74F4A12BA9B5461CAF69C17AB4301889\"], \"licenseAgreement\": \"D738E60042A14FE0914B375F3FAE1BC8\"}, \"icon\": \"icon\", \"vendorName\": \"test-api-license-model\", \"name\": \"test-vsp\"}"
369                                 },
370                                 "description": ""
371                         },
372                         "response": []
373                 }
374         ]
375 }