Create shared postman collections
[cps.git] / postman-collections / NCMP Register CmHandle and Query.postman_collection.json
1 {
2     "info": {
3         "_postman_id": "4e232e66-914a-4b5e-8f7f-f9ae0d476f54",
4         "name": "NCMP Register CmHandle and Query",
5         "description": "A collection to register a cmHandle then query. There are \"Valid Queries\" and \"Invalid Queries\" sub-folders containing examples. These are by no means exhaustive.",
6         "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
7         "_exporter_id": "17907116"
8     },
9     "item": [
10         {
11             "name": "Valid Queries",
12             "item": [
13                 {
14                     "name": "search cmHandles without conditions",
15                     "request": {
16                         "method": "POST",
17                         "header": [],
18                         "body": {
19                             "mode": "raw",
20                             "raw": "{}",
21                             "options": {
22                                 "raw": {
23                                     "language": "json"
24                                 }
25                             }
26                         },
27                         "url": {
28                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
29                             "protocol": "http",
30                             "host": [
31                                 "{{CPS_HOST}}"
32                             ],
33                             "port": "{{CPS_PORT}}",
34                             "path": [
35                                 "ncmp",
36                                 "v1",
37                                 "ch",
38                                 "searches"
39                             ]
40                         }
41                     },
42                     "response": []
43                 },
44                 {
45                     "name": "search cmHandles with modules query",
46                     "request": {
47                         "method": "POST",
48                         "header": [],
49                         "body": {
50                             "mode": "raw",
51                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllModules\",\n            \"conditionParameters\": [ {\"moduleName\": \"notifications\"} ]\n        }\n    ]\n}",
52                             "options": {
53                                 "raw": {
54                                     "language": "json"
55                                 }
56                             }
57                         },
58                         "url": {
59                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
60                             "protocol": "http",
61                             "host": [
62                                 "{{CPS_HOST}}"
63                             ],
64                             "port": "{{CPS_PORT}}",
65                             "path": [
66                                 "ncmp",
67                                 "v1",
68                                 "ch",
69                                 "searches"
70                             ]
71                         }
72                     },
73                     "response": []
74                 },
75                 {
76                     "name": "search cmHandles with public properties",
77                     "request": {
78                         "method": "POST",
79                         "header": [],
80                         "body": {
81                             "mode": "raw",
82                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllProperties\",\n            \"conditionParameters\": [ {\"Color\": \"yellow\"} ]\n        }\n    ]\n}",
83                             "options": {
84                                 "raw": {
85                                     "language": "json"
86                                 }
87                             }
88                         },
89                         "url": {
90                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
91                             "protocol": "http",
92                             "host": [
93                                 "{{CPS_HOST}}"
94                             ],
95                             "port": "{{CPS_PORT}}",
96                             "path": [
97                                 "ncmp",
98                                 "v1",
99                                 "ch",
100                                 "searches"
101                             ]
102                         }
103                     },
104                     "response": []
105                 },
106                 {
107                     "name": "search cmHandles with multiple public properties",
108                     "request": {
109                         "method": "POST",
110                         "header": [],
111                         "body": {
112                             "mode": "raw",
113                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllProperties\",\n            \"conditionParameters\": [ {\"Color\": \"yellow\"}, {\"Size\": \"small\"} ]\n        }\n    ]\n}",
114                             "options": {
115                                 "raw": {
116                                     "language": "json"
117                                 }
118                             }
119                         },
120                         "url": {
121                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
122                             "protocol": "http",
123                             "host": [
124                                 "{{CPS_HOST}}"
125                             ],
126                             "port": "{{CPS_PORT}}",
127                             "path": [
128                                 "ncmp",
129                                 "v1",
130                                 "ch",
131                                 "searches"
132                             ]
133                         }
134                     },
135                     "response": []
136                 },
137                 {
138                     "name": "search cmHandles with modules & pubprop query",
139                     "request": {
140                         "method": "POST",
141                         "header": [],
142                         "body": {
143                             "mode": "raw",
144                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllModules\",\n            \"conditionParameters\": [ {\"moduleName\": \"notifications\"} ]\n        },\n        {\n            \"conditionName\": \"hasAllProperties\",\n            \"conditionParameters\": [ {\"Color\": \"yellow\"} ]\n        }\n    ]\n}",
145                             "options": {
146                                 "raw": {
147                                     "language": "json"
148                                 }
149                             }
150                         },
151                         "url": {
152                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
153                             "protocol": "http",
154                             "host": [
155                                 "{{CPS_HOST}}"
156                             ],
157                             "port": "{{CPS_PORT}}",
158                             "path": [
159                                 "ncmp",
160                                 "v1",
161                                 "ch",
162                                 "searches"
163                             ]
164                         }
165                     },
166                     "response": []
167                 }
168             ]
169         },
170         {
171             "name": "Invalid Queries",
172             "item": [
173                 {
174                     "name": "get cmHandles with wrong condition name",
175                     "request": {
176                         "method": "POST",
177                         "header": [],
178                         "body": {
179                             "mode": "raw",
180                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"wrong\",\n            \"conditionParameters\": [ {\"Color\": \"yellow\"} ]\n        }\n    ]\n}",
181                             "options": {
182                                 "raw": {
183                                     "language": "json"
184                                 }
185                             }
186                         },
187                         "url": {
188                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
189                             "protocol": "http",
190                             "host": [
191                                 "{{CPS_HOST}}"
192                             ],
193                             "port": "{{CPS_PORT}}",
194                             "path": [
195                                 "ncmp",
196                                 "v1",
197                                 "ch",
198                                 "searches"
199                             ]
200                         }
201                     },
202                     "response": []
203                 },
204                 {
205                     "name": "get cmHandles with empty condition name",
206                     "request": {
207                         "method": "POST",
208                         "header": [],
209                         "body": {
210                             "mode": "raw",
211                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"\",\n            \"conditionParameters\": [ {\"Color\": \"yellow\"} ]\n        }\n    ]\n}",
212                             "options": {
213                                 "raw": {
214                                     "language": "json"
215                                 }
216                             }
217                         },
218                         "url": {
219                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
220                             "protocol": "http",
221                             "host": [
222                                 "{{CPS_HOST}}"
223                             ],
224                             "port": "{{CPS_PORT}}",
225                             "path": [
226                                 "ncmp",
227                                 "v1",
228                                 "ch",
229                                 "searches"
230                             ]
231                         }
232                     },
233                     "response": []
234                 },
235                 {
236                     "name": "get cmHandles with null condition name",
237                     "request": {
238                         "method": "POST",
239                         "header": [],
240                         "body": {
241                             "mode": "raw",
242                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionParameters\": [ {\"Color\": \"yellow\"} ]\n        }\n    ]\n}",
243                             "options": {
244                                 "raw": {
245                                     "language": "json"
246                                 }
247                             }
248                         },
249                         "url": {
250                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
251                             "protocol": "http",
252                             "host": [
253                                 "{{CPS_HOST}}"
254                             ],
255                             "port": "{{CPS_PORT}}",
256                             "path": [
257                                 "ncmp",
258                                 "v1",
259                                 "ch",
260                                 "searches"
261                             ]
262                         }
263                     },
264                     "response": []
265                 },
266                 {
267                     "name": "get cmHandles with empty key",
268                     "request": {
269                         "method": "POST",
270                         "header": [],
271                         "body": {
272                             "mode": "raw",
273                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllProperties\",\n            \"conditionParameters\": [ {\"\": \"yellow\"} ]\n        }\n    ]\n}",
274                             "options": {
275                                 "raw": {
276                                     "language": "json"
277                                 }
278                             }
279                         },
280                         "url": {
281                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
282                             "protocol": "http",
283                             "host": [
284                                 "{{CPS_HOST}}"
285                             ],
286                             "port": "{{CPS_PORT}}",
287                             "path": [
288                                 "ncmp",
289                                 "v1",
290                                 "ch",
291                                 "searches"
292                             ]
293                         }
294                     },
295                     "response": []
296                 },
297                 {
298                     "name": "get cmHandles with empty condition",
299                     "request": {
300                         "method": "POST",
301                         "header": [],
302                         "body": {
303                             "mode": "raw",
304                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllProperties\",\n            \"conditionParameters\": [ {} ]\n        }\n    ]\n}",
305                             "options": {
306                                 "raw": {
307                                     "language": "json"
308                                 }
309                             }
310                         },
311                         "url": {
312                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
313                             "protocol": "http",
314                             "host": [
315                                 "{{CPS_HOST}}"
316                             ],
317                             "port": "{{CPS_PORT}}",
318                             "path": [
319                                 "ncmp",
320                                 "v1",
321                                 "ch",
322                                 "searches"
323                             ]
324                         }
325                     },
326                     "response": []
327                 },
328                 {
329                     "name": "get cmHandles with empty condition list",
330                     "request": {
331                         "method": "POST",
332                         "header": [],
333                         "body": {
334                             "mode": "raw",
335                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllProperties\",\n            \"conditionParameters\": [ ]\n        }\n    ]\n}",
336                             "options": {
337                                 "raw": {
338                                     "language": "json"
339                                 }
340                             }
341                         },
342                         "url": {
343                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
344                             "protocol": "http",
345                             "host": [
346                                 "{{CPS_HOST}}"
347                             ],
348                             "port": "{{CPS_PORT}}",
349                             "path": [
350                                 "ncmp",
351                                 "v1",
352                                 "ch",
353                                 "searches"
354                             ]
355                         }
356                     },
357                     "response": []
358                 },
359                 {
360                     "name": "get cmHandles with null condition list",
361                     "request": {
362                         "method": "POST",
363                         "header": [],
364                         "body": {
365                             "mode": "raw",
366                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllProperties\"\n        }\n    ]\n}",
367                             "options": {
368                                 "raw": {
369                                     "language": "json"
370                                 }
371                             }
372                         },
373                         "url": {
374                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
375                             "protocol": "http",
376                             "host": [
377                                 "{{CPS_HOST}}"
378                             ],
379                             "port": "{{CPS_PORT}}",
380                             "path": [
381                                 "ncmp",
382                                 "v1",
383                                 "ch",
384                                 "searches"
385                             ]
386                         }
387                     },
388                     "response": []
389                 },
390                 {
391                     "name": "get cmHandles with empty module value",
392                     "request": {
393                         "method": "POST",
394                         "header": [],
395                         "body": {
396                             "mode": "raw",
397                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllModules\",\n            \"conditionParameters\": [ {\"moduleName\": \"\"} ]\n        }\n    ]\n}",
398                             "options": {
399                                 "raw": {
400                                     "language": "json"
401                                 }
402                             }
403                         },
404                         "url": {
405                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
406                             "protocol": "http",
407                             "host": [
408                                 "{{CPS_HOST}}"
409                             ],
410                             "port": "{{CPS_PORT}}",
411                             "path": [
412                                 "ncmp",
413                                 "v1",
414                                 "ch",
415                                 "searches"
416                             ]
417                         }
418                     },
419                     "response": []
420                 },
421                 {
422                     "name": "get cmHandles with wrong module name",
423                     "request": {
424                         "method": "POST",
425                         "header": [],
426                         "body": {
427                             "mode": "raw",
428                             "raw": "{\n    \"cmHandleQueryParameters\": [\n        {\n            \"conditionName\": \"hasAllModules\",\n            \"conditionParameters\": [ {\"moduleName2\": \"mudule-1\"} ]\n        }\n    ]\n}",
429                             "options": {
430                                 "raw": {
431                                     "language": "json"
432                                 }
433                             }
434                         },
435                         "url": {
436                             "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/searches",
437                             "protocol": "http",
438                             "host": [
439                                 "{{CPS_HOST}}"
440                             ],
441                             "port": "{{CPS_PORT}}",
442                             "path": [
443                                 "ncmp",
444                                 "v1",
445                                 "ch",
446                                 "searches"
447                             ]
448                         }
449                     },
450                     "response": []
451                 }
452             ]
453         },
454         {
455             "name": "Register cmHandle for Node",
456             "request": {
457                 "method": "POST",
458                 "header": [],
459                 "body": {
460                     "mode": "raw",
461                     "raw": "{\n    \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\n    \"createdCmHandles\": [\n        {\n            \"cmHandle\": \"CmHandle0\",\n            \"cmHandleProperties\": {\n                \"Books\": \"Sci-Fi Book\"\n            },\n            \"publicCmHandleProperties\": {\n                \"Color\": \"yellow\",\n                \"Size\": \"small\",\n                \"Shape\": \"cube\"\n            }\n        }\n    ]\n}",
462                     "options": {
463                         "raw": {
464                             "language": "json"
465                         }
466                     }
467                 },
468                 "url": {
469                     "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch",
470                     "protocol": "http",
471                     "host": [
472                         "{{CPS_HOST}}"
473                     ],
474                     "port": "{{CPS_PORT}}",
475                     "path": [
476                         "ncmpInventory",
477                         "v1",
478                         "ch"
479                     ]
480                 }
481             },
482             "response": []
483         },
484         {
485             "name": "get cmHandle",
486             "protocolProfileBehavior": {
487                 "disableBodyPruning": true
488             },
489             "request": {
490                 "method": "GET",
491                 "header": [],
492                 "body": {
493                     "mode": "raw",
494                     "raw": "",
495                     "options": {
496                         "raw": {
497                             "language": "json"
498                         }
499                     }
500                 },
501                 "url": {
502                     "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/CmHandle0",
503                     "protocol": "http",
504                     "host": [
505                         "{{CPS_HOST}}"
506                     ],
507                     "port": "{{CPS_PORT}}",
508                     "path": [
509                         "ncmp",
510                         "v1",
511                         "ch",
512                         "CmHandle0"
513                     ]
514                 }
515             },
516             "response": []
517         },
518         {
519             "name": "get modules for cmHandle",
520             "protocolProfileBehavior": {
521                 "disableBodyPruning": true
522             },
523             "request": {
524                 "method": "GET",
525                 "header": [],
526                 "body": {
527                     "mode": "raw",
528                     "raw": "",
529                     "options": {
530                         "raw": {
531                             "language": "json"
532                         }
533                     }
534                 },
535                 "url": {
536                     "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/CmHandle0/modules",
537                     "protocol": "http",
538                     "host": [
539                         "{{CPS_HOST}}"
540                     ],
541                     "port": "{{CPS_PORT}}",
542                     "path": [
543                         "ncmp",
544                         "v1",
545                         "ch",
546                         "CmHandle0",
547                         "modules"
548                     ]
549                 }
550             },
551             "response": []
552         },
553         {
554             "name": "Update cmHandle for Node",
555             "request": {
556                 "method": "POST",
557                 "header": [],
558                 "body": {
559                     "mode": "raw",
560                     "raw": "{\n    \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\n    \"updatedCmHandles\": [\n        {\n            \"cmHandle\": \"CmHandle0\",\n            \"cmHandleProperties\": {\n                \"Books\": \"Sci-Fi Book\",\n                \"Some property\": \"Some value\"\n            },\n            \"publicCmHandleProperties\": {\n                \"Color\": \"yellow\",\n                \"Size\": \"small\",\n                \"Shape\": \"cube\",\n                \"Some public property\": \"Some public value\"\n            }\n        }\n    ]\n}",
561                     "options": {
562                         "raw": {
563                             "language": "json"
564                         }
565                     }
566                 },
567                 "url": {
568                     "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch",
569                     "protocol": "http",
570                     "host": [
571                         "{{CPS_HOST}}"
572                     ],
573                     "port": "{{CPS_PORT}}",
574                     "path": [
575                         "ncmpInventory",
576                         "v1",
577                         "ch"
578                     ]
579                 }
580             },
581             "response": []
582         },
583         {
584             "name": "De-register cmHandle for Node",
585             "request": {
586                 "method": "POST",
587                 "header": [],
588                 "body": {
589                     "mode": "raw",
590                     "raw": "{\n    \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\n    \"removedCmHandles\": [\n        \"CmHandle0\"\n    ]\n}",
591                     "options": {
592                         "raw": {
593                             "language": "json"
594                         }
595                     }
596                 },
597                 "url": {
598                     "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch",
599                     "protocol": "http",
600                     "host": [
601                         "{{CPS_HOST}}"
602                     ],
603                     "port": "{{CPS_PORT}}",
604                     "path": [
605                         "ncmpInventory",
606                         "v1",
607                         "ch"
608                     ]
609                 }
610             },
611             "response": []
612         }
613     ],
614     "auth": {
615         "type": "basic",
616         "basic": [
617             {
618                 "key": "password",
619                 "value": "cpsr0cks!",
620                 "type": "string"
621             },
622             {
623                 "key": "username",
624                 "value": "cpsuser",
625                 "type": "string"
626             }
627         ]
628     },
629     "event": [
630         {
631             "listen": "prerequest",
632             "script": {
633                 "type": "text/javascript",
634                 "exec": [
635                     ""
636                 ]
637             }
638         },
639         {
640             "listen": "test",
641             "script": {
642                 "type": "text/javascript",
643                 "exec": [
644                     ""
645                 ]
646             }
647         }
648     ]
649 }