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