@itentialopensource/adapter-selector_ai 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +19 -0
  3. package/.jshintrc +3 -0
  4. package/AUTH.md +39 -0
  5. package/BROKER.md +211 -0
  6. package/CALLS.md +405 -0
  7. package/CODE_OF_CONDUCT.md +43 -0
  8. package/CONTRIBUTING.md +13 -0
  9. package/ENHANCE.md +69 -0
  10. package/LICENSE +201 -0
  11. package/PROPERTIES.md +661 -0
  12. package/README.md +344 -0
  13. package/SUMMARY.md +9 -0
  14. package/SYSTEMINFO.md +14 -0
  15. package/TAB1.md +8 -0
  16. package/TAB2.md +314 -0
  17. package/TROUBLESHOOT.md +56 -0
  18. package/UTILITIES.md +473 -0
  19. package/adapter.js +4039 -0
  20. package/adapterBase.js +1488 -0
  21. package/entities/.generic/action.json +214 -0
  22. package/entities/.generic/schema.json +28 -0
  23. package/entities/.system/action.json +50 -0
  24. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  25. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  26. package/entities/.system/schema.json +19 -0
  27. package/entities/.system/schemaTokenReq.json +53 -0
  28. package/entities/.system/schemaTokenResp.json +53 -0
  29. package/entities/InventorySchemaCreation/action.json +24 -0
  30. package/entities/InventorySchemaCreation/schema.json +19 -0
  31. package/entities/InventorySchemaDelete/action.json +24 -0
  32. package/entities/InventorySchemaDelete/schema.json +19 -0
  33. package/entities/InventorySchemaDeleteType/action.json +24 -0
  34. package/entities/InventorySchemaDeleteType/schema.json +19 -0
  35. package/entities/InventorySchemaFileDownload/action.json +24 -0
  36. package/entities/InventorySchemaFileDownload/schema.json +19 -0
  37. package/entities/InventorySchemaFileUpload/action.json +24 -0
  38. package/entities/InventorySchemaFileUpload/schema.json +19 -0
  39. package/entities/InventorySchemaUpdate/action.json +24 -0
  40. package/entities/InventorySchemaUpdate/schema.json +19 -0
  41. package/entities/InventoryV2SchemaDeleteAll/action.json +24 -0
  42. package/entities/InventoryV2SchemaDeleteAll/schema.json +19 -0
  43. package/entities/InventoryV2SchemaDeleteType/action.json +24 -0
  44. package/entities/InventoryV2SchemaDeleteType/schema.json +19 -0
  45. package/entities/InventoryV2SchemaUpdate/action.json +24 -0
  46. package/entities/InventoryV2SchemaUpdate/schema.json +19 -0
  47. package/entities/InventoryV2SchemaUpload/action.json +24 -0
  48. package/entities/InventoryV2SchemaUpload/schema.json +19 -0
  49. package/entities/MetastoreInventoryBulkDataUpload/action.json +24 -0
  50. package/entities/MetastoreInventoryBulkDataUpload/schema.json +19 -0
  51. package/entities/MetastoreInventoryCSVDataUpload/action.json +24 -0
  52. package/entities/MetastoreInventoryCSVDataUpload/schema.json +19 -0
  53. package/entities/MetastoreInventoryCsvFileExport/action.json +25 -0
  54. package/entities/MetastoreInventoryCsvFileExport/schema.json +19 -0
  55. package/entities/MetastoreInventoryDataDelete/action.json +24 -0
  56. package/entities/MetastoreInventoryDataDelete/schema.json +19 -0
  57. package/entities/MetastoreInventoryDataDownload/action.json +46 -0
  58. package/entities/MetastoreInventoryDataDownload/schema.json +20 -0
  59. package/entities/MetastoreInventoryDataEdit/action.json +24 -0
  60. package/entities/MetastoreInventoryDataEdit/schema.json +19 -0
  61. package/entities/MetastoreInventoryDataUpload/action.json +24 -0
  62. package/entities/MetastoreInventoryDataUpload/schema.json +19 -0
  63. package/entities/MetastoreInventoryFilesExport/action.json +24 -0
  64. package/entities/MetastoreInventoryFilesExport/schema.json +19 -0
  65. package/entities/MetastoreInventoryFilesImport/action.json +24 -0
  66. package/entities/MetastoreInventoryFilesImport/schema.json +30 -0
  67. package/entities/MetastoreInventoryItems/action.json +25 -0
  68. package/entities/MetastoreInventoryItems/schema.json +19 -0
  69. package/entities/MetastoreInventoryNameDelete/action.json +24 -0
  70. package/entities/MetastoreInventoryNameDelete/schema.json +19 -0
  71. package/entities/MetastoreInventoryNameUpdate/action.json +24 -0
  72. package/entities/MetastoreInventoryNameUpdate/schema.json +19 -0
  73. package/entities/MetastoreInventoryNameUpload/action.json +24 -0
  74. package/entities/MetastoreInventoryNameUpload/schema.json +19 -0
  75. package/entities/MetastoreInventoryNamesDownload/action.json +25 -0
  76. package/entities/MetastoreInventoryNamesDownload/schema.json +19 -0
  77. package/entities/MetastoreInventorySchemaGet/action.json +25 -0
  78. package/entities/MetastoreInventorySchemaGet/schema.json +19 -0
  79. package/entities/MetastoreInventorySystem/action.json +130 -0
  80. package/entities/MetastoreInventorySystem/schema.json +24 -0
  81. package/entities/MetastoreV2InventorySchemaGet/action.json +25 -0
  82. package/entities/MetastoreV2InventorySchemaGet/schema.json +19 -0
  83. package/error.json +190 -0
  84. package/metadata.json +58 -0
  85. package/package.json +77 -0
  86. package/pronghorn.json +2508 -0
  87. package/propertiesDecorators.json +14 -0
  88. package/propertiesSchema.json +1635 -0
  89. package/report/adapterInfo.json +10 -0
  90. package/report/auto-adapter-openapi.json +1330 -0
  91. package/report/creationReport.json +765 -0
  92. package/report/metastore-inventory-manager.yaml-OpenApi3Json.json +2366 -0
  93. package/sampleProperties.json +260 -0
  94. package/test/integration/adapterTestBasicGet.js +117 -0
  95. package/test/integration/adapterTestConnectivity.js +117 -0
  96. package/test/integration/adapterTestIntegration.js +1295 -0
  97. package/test/unit/adapterBaseTestUnit.js +1626 -0
  98. package/test/unit/adapterTestUnit.js +2288 -0
  99. package/utils/adapterInfo.js +156 -0
  100. package/utils/argParser.js +44 -0
  101. package/utils/checkMigrate.js +102 -0
  102. package/utils/entitiesToDB.js +190 -0
  103. package/utils/findPath.js +74 -0
  104. package/utils/logger.js +26 -0
  105. package/utils/methodDocumentor.js +273 -0
  106. package/utils/modify.js +153 -0
  107. package/utils/mongoDbConnection.js +79 -0
  108. package/utils/mongoUtils.js +162 -0
  109. package/utils/pre-commit.sh +32 -0
  110. package/utils/removeHooks.js +20 -0
  111. package/utils/setup.js +33 -0
  112. package/utils/taskMover.js +308 -0
  113. package/utils/tbScript.js +103 -0
  114. package/utils/tbUtils.js +347 -0
  115. package/utils/testRunner.js +298 -0
  116. package/utils/troubleshootingAdapter.js +177 -0
  117. package/utils/updateAdapterConfig.js +158 -0
@@ -0,0 +1,1635 @@
1
+ {
2
+ "$id": "adapter-selector_ai",
3
+ "type": "object",
4
+ "$schema": "http://json-schema.org/draft-07/schema#",
5
+ "properties": {
6
+ "host": {
7
+ "type": "string",
8
+ "description": "hostname of the server",
9
+ "default": "",
10
+ "examples": [
11
+ "systemx.customer.com"
12
+ ]
13
+ },
14
+ "port": {
15
+ "type": "integer",
16
+ "description": "port on which to connect to the server",
17
+ "default": 443,
18
+ "minimum": 1,
19
+ "maximum": 65535
20
+ },
21
+ "choosepath": {
22
+ "type": "string",
23
+ "description": "choose the path to use -- requires entityPath choices",
24
+ "default": ""
25
+ },
26
+ "base_path": {
27
+ "type": "string",
28
+ "description": "a base path that is consistent across api calls",
29
+ "default": "",
30
+ "examples": [
31
+ "/system/api"
32
+ ]
33
+ },
34
+ "version": {
35
+ "type": "string",
36
+ "description": "api version this adapter integrates with",
37
+ "default": "",
38
+ "examples": [
39
+ "v1",
40
+ "v2.6",
41
+ "4.5.1"
42
+ ]
43
+ },
44
+ "cache_location": {
45
+ "type": "string",
46
+ "description": "Where cache of information should be located redis or local memory",
47
+ "default": "none",
48
+ "enum": [
49
+ "redis",
50
+ "local",
51
+ "none"
52
+ ]
53
+ },
54
+ "encode_pathvars": {
55
+ "type": "boolean",
56
+ "description": "When true the path variables are encoded in the url",
57
+ "default": true
58
+ },
59
+ "encode_queryvars": {
60
+ "type": "boolean",
61
+ "description": "When true the query parameters are encoded in the url",
62
+ "default": true
63
+ },
64
+ "save_metric": {
65
+ "type": [
66
+ "boolean",
67
+ "string"
68
+ ],
69
+ "description": "When true the metrics collected by the adapter will be stored in mongo or on the filesystem",
70
+ "default": false
71
+ },
72
+ "stub": {
73
+ "type": "boolean",
74
+ "description": "When true will not connect to the remote server, but will use a static object for all responses",
75
+ "default": false
76
+ },
77
+ "protocol": {
78
+ "type": "string",
79
+ "description": "the protocol to use to connect to server",
80
+ "default": "http",
81
+ "enum": [
82
+ "http",
83
+ "https"
84
+ ]
85
+ },
86
+ "service" : {
87
+ "type" : "string",
88
+ "description": "Service we are integrating with -- used with AWS Authentication",
89
+ "examples" : [
90
+ "ec2",
91
+ "route53"
92
+ ]
93
+ },
94
+ "authentication": {
95
+ "$ref": "#/definitions/authentication"
96
+ },
97
+ "healthcheck": {
98
+ "$ref": "#/definitions/healthcheck"
99
+ },
100
+ "throttle": {
101
+ "$ref": "#/definitions/throttle"
102
+ },
103
+ "request": {
104
+ "$ref": "#/definitions/request"
105
+ },
106
+ "proxy": {
107
+ "$ref": "#/definitions/proxy"
108
+ },
109
+ "ssl": {
110
+ "$ref": "#/definitions/ssl"
111
+ },
112
+ "mongo": {
113
+ "$ref": "#/definitions/mongo"
114
+ },
115
+ "devicebroker": {
116
+ "$ref": "#/definitions/devicebroker"
117
+ },
118
+ "cache": {
119
+ "$ref": "#/definitions/cache"
120
+ }
121
+ },
122
+ "required": [
123
+ "host",
124
+ "port",
125
+ "authentication",
126
+ "healthcheck"
127
+ ],
128
+ "definitions": {
129
+ "authentication": {
130
+ "type": "object",
131
+ "properties": {
132
+ "auth_method": {
133
+ "type": "string",
134
+ "description": "The authentication method for requests",
135
+ "default": "basic user_password",
136
+ "enum": [
137
+ "basic user_password",
138
+ "static_token",
139
+ "jwt_token",
140
+ "request_token",
141
+ "no_authentication",
142
+ "multi_step_authentication",
143
+ "aws_authentication"
144
+ ]
145
+ },
146
+ "username": {
147
+ "type": "string",
148
+ "description": "The username used for requests",
149
+ "default": "",
150
+ "examples": [
151
+ "username"
152
+ ]
153
+ },
154
+ "password": {
155
+ "type": "string",
156
+ "description": "The password used for requests. If it was retrieved through the encrypt password call, use the exact return including the {code} or {crypt}",
157
+ "default": "",
158
+ "examples": [
159
+ "password",
160
+ "{code}password",
161
+ "{crypt}password"
162
+ ]
163
+ },
164
+ "token": {
165
+ "type": "string",
166
+ "description": "The token used for requests",
167
+ "default": "",
168
+ "examples": [
169
+ "sdadafdsf_dummytoken_adfkdhfkajd"
170
+ ]
171
+ },
172
+ "token_user_field": {
173
+ "type": "string",
174
+ "description": "The field to send the user credential when getting a token",
175
+ "default": "username",
176
+ "examples": [
177
+ "username"
178
+ ]
179
+ },
180
+ "token_password_field": {
181
+ "type": "string",
182
+ "description": "The field to send the password credential when getting a token",
183
+ "default": "password",
184
+ "examples": [
185
+ "password"
186
+ ]
187
+ },
188
+ "token_result_field": {
189
+ "type": "string",
190
+ "description": "The field to pull the result from when getting a token",
191
+ "default": "token",
192
+ "examples": [
193
+ "token"
194
+ ]
195
+ },
196
+ "token_URI_path": {
197
+ "type": "string",
198
+ "description": "The path used to retrieve a token",
199
+ "default": "",
200
+ "examples": [
201
+ "/api/version/authenticate"
202
+ ]
203
+ },
204
+ "invalid_token_error": {
205
+ "type": "integer",
206
+ "description": "http error status number which defines an invalid token",
207
+ "default": 401,
208
+ "minimum": 0,
209
+ "maximum": 1000
210
+ },
211
+ "token_timeout": {
212
+ "type": "integer",
213
+ "description": "How long a token is valid (in milliseconds), -1 (always get token), 0 use expiration returned with token",
214
+ "default": -1,
215
+ "minimum": -1,
216
+ "maximum": 3600000
217
+ },
218
+ "token_cache": {
219
+ "type": "string",
220
+ "description": "Whether tokens should be stored in redis or local memory",
221
+ "default": "local",
222
+ "enum": [
223
+ "redis",
224
+ "local"
225
+ ]
226
+ },
227
+ "auth_field": {
228
+ "type": [
229
+ "string",
230
+ "array"
231
+ ],
232
+ "description": "The field in which to pass the token",
233
+ "default": "header.headers.X-AUTH-TOKEN",
234
+ "examples": [
235
+ "header.headers.X-AUTH-TOKEN",
236
+ "header.headers.Authorization",
237
+ "header.auth",
238
+ "body.token",
239
+ "url"
240
+ ]
241
+ },
242
+ "auth_field_format": {
243
+ "type": [
244
+ "string",
245
+ "array"
246
+ ],
247
+ "description": "The format used to pass the authentication -- variables {token}, {username}, {password} will be replaced with the proper values. {b64}...{/b64} will base64 encode everything between the start and end tag.",
248
+ "default": "{token}",
249
+ "examples": [
250
+ "{token}",
251
+ "Token {token}",
252
+ "{username}:{password}",
253
+ "Basic {b64}{username}:{password}{/b64}",
254
+ "token={token}"
255
+ ]
256
+ },
257
+ "auth_logging": {
258
+ "type": "boolean",
259
+ "description": "This property turns on logging of Authentication Information and should only be true when debugging authentication and connectivity",
260
+ "default": false
261
+ },
262
+ "client_id": {
263
+ "type": "string",
264
+ "description": "The client id for OAuth requests - can also use username depending on schema",
265
+ "default": ""
266
+ },
267
+ "client_secret": {
268
+ "type": "string",
269
+ "description": "The client secret for OAuth requests - can also use password depending on schema",
270
+ "default": ""
271
+ },
272
+ "grant_type": {
273
+ "type": "string",
274
+ "description": "The grant type for OAuth requests - can also provide in schema",
275
+ "default": ""
276
+ },
277
+ "sensitive": {
278
+ "type": "array",
279
+ "description": "List of sensitive keys to search and hide values from being logged",
280
+ "default": [],
281
+ "items": {
282
+ "type": "string"
283
+ }
284
+ },
285
+ "sso": {
286
+ "type": "object",
287
+ "properties": {
288
+ "protocol": {
289
+ "type": "string",
290
+ "description": "the protocol to request token from system",
291
+ "default": "",
292
+ "enum": [
293
+ "http", "https", ""
294
+ ]
295
+ },
296
+ "host": {
297
+ "type": "string",
298
+ "description": "hostname of the authentication system",
299
+ "default": "",
300
+ "examples": [
301
+ "systemx.customer.com"
302
+ ]
303
+ },
304
+ "port": {
305
+ "type": "integer",
306
+ "description": "port on which to connect to the authentication system",
307
+ "default": 0,
308
+ "minimum": 0,
309
+ "maximum": 65535
310
+ }
311
+ }
312
+ },
313
+ "multiStepAuthCalls": {
314
+ "type": "array",
315
+ "items": {
316
+ "type": "object",
317
+ "properties": {
318
+ "name": {
319
+ "type": "string",
320
+ "description": "Id of the step call",
321
+ "examples": [
322
+ "getAccessToken"
323
+ ]
324
+ },
325
+ "requestFields": {
326
+ "type": "object",
327
+ "description": "The fields set in step request"
328
+ },
329
+ "responseFields": {
330
+ "type": "object",
331
+ "description": "The fields from the step result"
332
+ },
333
+ "successfullResponseCode": {
334
+ "type": "integer",
335
+ "description": "Expected response code for given step, if not set any successfull http response is accepted",
336
+ "examples": [
337
+ 200
338
+ ]
339
+ }
340
+ }
341
+ }
342
+ }
343
+ },
344
+ "required": [
345
+ "auth_method"
346
+ ],
347
+ "allOf": [
348
+ {
349
+ "if": {
350
+ "properties": {
351
+ "auth_method": {
352
+ "enum": [
353
+ "basic user_password"
354
+ ]
355
+ }
356
+ }
357
+ },
358
+ "then": {
359
+ "required": [
360
+ "username",
361
+ "password",
362
+ "auth_field",
363
+ "auth_field_format"
364
+ ]
365
+ }
366
+ },
367
+ {
368
+ "if": {
369
+ "properties": {
370
+ "auth_method": {
371
+ "enum": [
372
+ "request_token"
373
+ ]
374
+ }
375
+ }
376
+ },
377
+ "then": {
378
+ "required": [
379
+ "username",
380
+ "password",
381
+ "auth_field",
382
+ "auth_field_format"
383
+ ]
384
+ }
385
+ },
386
+ {
387
+ "if": {
388
+ "properties": {
389
+ "auth_method": {
390
+ "enum": [
391
+ "static_token"
392
+ ]
393
+ }
394
+ }
395
+ },
396
+ "then": {
397
+ "required": [
398
+ "token",
399
+ "auth_field",
400
+ "auth_field_format"
401
+ ]
402
+ }
403
+ }
404
+ ]
405
+ },
406
+ "healthcheck": {
407
+ "type": "object",
408
+ "properties": {
409
+ "type": {
410
+ "type": "string",
411
+ "description": "The type of healthcheck to run",
412
+ "default": "intermittent",
413
+ "enum": [
414
+ "none",
415
+ "startup",
416
+ "intermittent"
417
+ ]
418
+ },
419
+ "frequency": {
420
+ "type": "integer",
421
+ "description": "How often the healthcheck should run (in milliseconds).",
422
+ "default": 300000,
423
+ "minimum": 60000,
424
+ "maximum": 3600000
425
+ },
426
+ "protocol": {
427
+ "type": "string",
428
+ "description": "The protocol used to check the health of the system",
429
+ "default": "REST",
430
+ "enum": [
431
+ "REST"
432
+ ]
433
+ },
434
+ "URI_Path": {
435
+ "type": "string",
436
+ "description": "The path used to check the health of the system",
437
+ "default": "",
438
+ "examples": [
439
+ "/api/version/ping"
440
+ ]
441
+ },
442
+ "query_object": {
443
+ "type": "object",
444
+ "description": "Query object { device: xxxxx } to be placed into the healthcheck, will be converted to query string by the adapter",
445
+ "default": {}
446
+ },
447
+ "addlHeaders": {
448
+ "type": "object",
449
+ "description": "headers that will be appended to the headers for the call",
450
+ "default": {}
451
+ }
452
+ },
453
+ "required": [
454
+ "type"
455
+ ],
456
+ "allOf": [
457
+ {
458
+ "if": {
459
+ "properties": {
460
+ "type": {
461
+ "enum": [
462
+ "intermittent"
463
+ ]
464
+ }
465
+ }
466
+ },
467
+ "then": {
468
+ "required": [
469
+ "frequency"
470
+ ]
471
+ }
472
+ }
473
+ ]
474
+ },
475
+ "throttle": {
476
+ "type": "object",
477
+ "properties": {
478
+ "throttle_enabled": {
479
+ "type": "boolean",
480
+ "description": "Whether to use throttling",
481
+ "default": false
482
+ },
483
+ "number_pronghorns": {
484
+ "type": "integer",
485
+ "description": "whether the throttling is being done in a single Pronghorn instance or whether requests are being throttled across multiple pronghorns",
486
+ "default": 1,
487
+ "minimum": 1,
488
+ "maximum": 20
489
+ },
490
+ "sync_async": {
491
+ "type": "string",
492
+ "description": "should the queue handle request synchronously or asynchronously",
493
+ "default": "sync",
494
+ "examples": [
495
+ "async",
496
+ "sync"
497
+ ]
498
+ },
499
+ "max_in_queue": {
500
+ "type": "integer",
501
+ "description": "the maximum number of requests that Pronghorn should allow into the queue before rejecting requests",
502
+ "default": 1000,
503
+ "minimum": 1,
504
+ "maximum": 5000
505
+ },
506
+ "concurrent_max": {
507
+ "type": "integer",
508
+ "description": "defines the number of request that Pronghorn can send selector_ai at one time",
509
+ "default": 1,
510
+ "minimum": 0,
511
+ "maximum": 1000
512
+ },
513
+ "expire_timeout": {
514
+ "type": "integer",
515
+ "description": "After the request has completed, Pronghorn will wait the additional expire timeout time (in milliseconds) prior to sending in the next request.",
516
+ "default": 0,
517
+ "minimum": 0,
518
+ "maximum": 60000
519
+ },
520
+ "avg_runtime": {
521
+ "type": "integer",
522
+ "description": "an approximate average of how long it takes selector_ai to handle each request",
523
+ "default": 200,
524
+ "minimum": 50,
525
+ "maximum": 60000
526
+ },
527
+ "priorities": {
528
+ "type": "array",
529
+ "description": "define your priorities here",
530
+ "default": [],
531
+ "items": {
532
+ "type": "object",
533
+ "properties": {
534
+ "value": {
535
+ "type": "number",
536
+ "description": "Defines a priority - this number is what is passed in on a priority request"
537
+ },
538
+ "percent": {
539
+ "type": "number",
540
+ "description": "this is the percent of the queue that comes before the priority request (0 is front of queue, 100 is last in queue)"
541
+ }
542
+ }
543
+ }
544
+ }
545
+ },
546
+ "required": [
547
+ "throttle_enabled"
548
+ ],
549
+ "allOf": [
550
+ {
551
+ "if": {
552
+ "properties": {
553
+ "throttle_enabled": {
554
+ "enum": [
555
+ true
556
+ ]
557
+ }
558
+ }
559
+ },
560
+ "then": {
561
+ "required": [
562
+ "number_pronghorns",
563
+ "sync_async",
564
+ "max_in_queue",
565
+ "concurrent_max",
566
+ "expire_timeout",
567
+ "avg_runtime"
568
+ ]
569
+ }
570
+ }
571
+ ]
572
+ },
573
+ "request": {
574
+ "type": "object",
575
+ "properties": {
576
+ "number_redirects": {
577
+ "type": "integer",
578
+ "description": "how many redirects before it gives up on the request",
579
+ "default": 0,
580
+ "minimum": 0,
581
+ "maximum": 20
582
+ },
583
+ "number_retries": {
584
+ "type": "integer",
585
+ "description": "how many attempt to make before it gives up on the request",
586
+ "default": 3,
587
+ "minimum": 0,
588
+ "maximum": 20
589
+ },
590
+ "limit_retry_error": {
591
+ "type": [
592
+ "integer",
593
+ "array"
594
+ ],
595
+ "description": "http error status number which defines that no capacity was available and thus after waiting a short interval the adapter can retry the request. Supports an array of numbers or strings including a range provided as '###-###'",
596
+ "default": 0
597
+ },
598
+ "failover_codes": {
599
+ "type": "array",
600
+ "description": "An array of codes where it is ok to try another method",
601
+ "default": [],
602
+ "items": {
603
+ "type": "integer"
604
+ }
605
+ },
606
+ "attempt_timeout": {
607
+ "type": "integer",
608
+ "description": "how long Pronghorn should wait before aborting the attempt",
609
+ "default": 5000,
610
+ "minimum": 1000,
611
+ "maximum": 3600000
612
+ },
613
+ "global_request": {
614
+ "type": "object",
615
+ "description": "Global Request data that is overriden by the request object",
616
+ "properties": {
617
+ "payload": {
618
+ "type": "object",
619
+ "description": "payload fields that will be appended to the provided payload (excluding GET calls)",
620
+ "default": {}
621
+ },
622
+ "uriOptions": {
623
+ "type": "object",
624
+ "description": "options that will be appended to all GET calls",
625
+ "default": {}
626
+ },
627
+ "addlHeaders": {
628
+ "type": "object",
629
+ "description": "headers that will be appended to the headers for the call",
630
+ "default": {}
631
+ },
632
+ "authData": {
633
+ "type": "object",
634
+ "description": "authentication data that will be appended to the payload for authentication calls",
635
+ "default": {}
636
+ }
637
+ }
638
+ },
639
+ "healthcheck_on_timeout": {
640
+ "type": "boolean",
641
+ "description": "Should the system run a healthcheck on timeout",
642
+ "default": false
643
+ },
644
+ "return_raw": {
645
+ "type": "boolean",
646
+ "description": "Will include the raw response with the data that is returned",
647
+ "default": false
648
+ },
649
+ "archiving": {
650
+ "type": "boolean",
651
+ "description": "Archives each request/response and corresponding metrics",
652
+ "default": false
653
+ },
654
+ "return_request": {
655
+ "type": "boolean",
656
+ "description": "This property turns on returning the response information - need to be carefull in case credentials are in the path",
657
+ "default": false
658
+ }
659
+ },
660
+ "required": [
661
+ "number_retries",
662
+ "limit_retry_error",
663
+ "attempt_timeout",
664
+ "healthcheck_on_timeout"
665
+ ]
666
+ },
667
+ "proxy": {
668
+ "type": "object",
669
+ "properties": {
670
+ "enabled": {
671
+ "type": "boolean",
672
+ "description": "Whether or not there is a proxy for the Server",
673
+ "default": false
674
+ },
675
+ "host": {
676
+ "type": "string",
677
+ "description": "hostname of the proxy for the server",
678
+ "default": "",
679
+ "examples": [
680
+ "proxy.customer.com"
681
+ ]
682
+ },
683
+ "port": {
684
+ "type": "integer",
685
+ "description": "port on which to connect to the proxy for the server",
686
+ "default": 443,
687
+ "minimum": 1,
688
+ "maximum": 65535
689
+ },
690
+ "protocol": {
691
+ "type": "string",
692
+ "description": "the protocol to use to connect to the proxy",
693
+ "default": "http",
694
+ "enum": [
695
+ "http",
696
+ "https",
697
+ "socks4",
698
+ "socks5",
699
+ "tls"
700
+ ]
701
+ },
702
+ "username": {
703
+ "type": "string",
704
+ "description": "username for proxy authentication",
705
+ "default": ""
706
+ },
707
+ "password": {
708
+ "type": "string",
709
+ "description": "password for proxy authentication",
710
+ "default": ""
711
+ }
712
+ },
713
+ "required": [
714
+ "enabled"
715
+ ],
716
+ "allOf": [
717
+ {
718
+ "if": {
719
+ "properties": {
720
+ "enabled": {
721
+ "enum": [
722
+ true
723
+ ]
724
+ }
725
+ }
726
+ },
727
+ "then": {
728
+ "required": [
729
+ "host",
730
+ "port"
731
+ ]
732
+ }
733
+ }
734
+ ]
735
+ },
736
+ "ssl": {
737
+ "type": "object",
738
+ "properties": {
739
+ "ecdhCurve": {
740
+ "type": "string",
741
+ "description": "Do we need to set the autoCurve on this request",
742
+ "default": "",
743
+ "examples": [
744
+ "auto"
745
+ ]
746
+ },
747
+ "enabled": {
748
+ "type": "boolean",
749
+ "description": "Whether or not ssl is enabled on Server",
750
+ "default": false
751
+ },
752
+ "accept_invalid_cert": {
753
+ "type": "boolean",
754
+ "description": "Whether the adapter should accept invalid certificates",
755
+ "default": false
756
+ },
757
+ "ca_file": {
758
+ "type": "string",
759
+ "description": "The fully qualified path name to the CA file used for SSL",
760
+ "default": "",
761
+ "examples": [
762
+ "security/ca.pem"
763
+ ]
764
+ },
765
+ "ca_file_content": {
766
+ "type": "string",
767
+ "description": "The content of the CA file used for SSL",
768
+ "default": "",
769
+ "examples": [
770
+ "-----BEGIN CERTIFICATE-----"
771
+ ]
772
+ },
773
+ "key_file": {
774
+ "type": "string",
775
+ "description": "The fully qualified path name to the key file used for SSL",
776
+ "default": "",
777
+ "examples": [
778
+ "security/key.pem"
779
+ ]
780
+ },
781
+ "cert_file": {
782
+ "type": "string",
783
+ "description": "The fully qualified path name to the Cert file used for SSL",
784
+ "default": "",
785
+ "examples": [
786
+ "security/cert.pem"
787
+ ]
788
+ },
789
+ "secure_protocol": {
790
+ "type": "string",
791
+ "description": "What protocol to set on the ssl request",
792
+ "default": "",
793
+ "examples": [
794
+ "SSLv2_method",
795
+ "SSLv3_method"
796
+ ]
797
+ },
798
+ "ciphers": {
799
+ "type": "string",
800
+ "description": "Hyphen separated list of acceptable ciphers",
801
+ "default": "",
802
+ "examples": [
803
+ "DHE-RSA-AES256-SHA"
804
+ ]
805
+ }
806
+ },
807
+ "required": [
808
+ "enabled"
809
+ ],
810
+ "allOf": [
811
+ {
812
+ "if": {
813
+ "properties": {
814
+ "enabled": {
815
+ "enum": [
816
+ true
817
+ ]
818
+ }
819
+ }
820
+ },
821
+ "then": {
822
+ "required": [
823
+ "accept_invalid_cert",
824
+ "ciphers"
825
+ ]
826
+ }
827
+ },
828
+ {
829
+ "if": {
830
+ "allOf": [
831
+ {
832
+ "properties": {
833
+ "enabled": {
834
+ "enum": [
835
+ true
836
+ ]
837
+ }
838
+ }
839
+ },
840
+ {
841
+ "properties": {
842
+ "accept_invalid_cert": {
843
+ "enum": [
844
+ false
845
+ ]
846
+ }
847
+ }
848
+ }
849
+ ]
850
+ },
851
+ "then": {
852
+ "required": [
853
+ "ca_file"
854
+ ]
855
+ }
856
+ }
857
+ ]
858
+ },
859
+ "mongo": {
860
+ "type": "object",
861
+ "properties": {
862
+ "url": {
863
+ "type": "string",
864
+ "description": "Mongo's complete connection URL. This property overrides host, port, database, username, password and replSet settings.",
865
+ "examples": [
866
+ "mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]",
867
+ "mongodb+srv://[username:password@]cluster0.xxxxx.mongodb.net/[defaultauthdb][?options]",
868
+ "mongodb+srv://cluster0.xxxxx.mongodb.net/[defaultauthdb][?options]"
869
+ ]
870
+ },
871
+ "host": {
872
+ "type": "string",
873
+ "description": "Host information for the Mongo server",
874
+ "default": "",
875
+ "examples": [
876
+ "localhost",
877
+ "cluster0.xxxxx.mongodb.net",
878
+ "my-cluster.example.com"
879
+ ]
880
+ },
881
+ "port": {
882
+ "type": "integer",
883
+ "description": "Port information for the Mongo server. Not used when using mongodb+srv:// protocol",
884
+ "default": 443,
885
+ "minimum": 0,
886
+ "maximum": 65535
887
+ },
888
+ "database": {
889
+ "type": "string",
890
+ "description": "The database for the adapter to use for its data.",
891
+ "default": "",
892
+ "examples": [
893
+ "adapter-xyz"
894
+ ]
895
+ },
896
+ "dbAuth": {
897
+ "type": "boolean",
898
+ "description": "Whether to use authentication for MongoDB connection. Default is false.",
899
+ "default": false
900
+ },
901
+ "username": {
902
+ "type": "string",
903
+ "description": "If credentials are required to access Mongo, this is the user to login as.",
904
+ "default": "",
905
+ "examples": [
906
+ "username"
907
+ ]
908
+ },
909
+ "password": {
910
+ "type": "string",
911
+ "description": "If credentials are required to access Mongo, this is the password to login with.",
912
+ "default": "",
913
+ "examples": [
914
+ "password"
915
+ ]
916
+ },
917
+ "replSet": {
918
+ "type": "string",
919
+ "description": "If the database is set up to use replica sets, define it here so it can be added to the database connection. Not used when using mongodb+srv:// protocol",
920
+ "default": "",
921
+ "examples": [
922
+ "my_repolica_set"
923
+ ]
924
+ },
925
+ "addSrv": {
926
+ "type": "boolean",
927
+ "description": "Whether the connection requires the mongodb+srv:// protocol. If true, uses mongodb+srv:// protocol. Note: mongodb+srv:// can also be used for non-Atlas deployments that support DNS SRV records",
928
+ "default": false
929
+ },
930
+ "db_ssl": {
931
+ "type": "object",
932
+ "description": "SSL for mongo database connection",
933
+ "properties": {
934
+ "enabled": {
935
+ "type": "boolean",
936
+ "description": "Whether or not ssl is enabled on Database Server",
937
+ "default": false
938
+ },
939
+ "accept_invalid_cert": {
940
+ "type": "boolean",
941
+ "description": "Whether the adapter should accept invalid certificates",
942
+ "default": false
943
+ },
944
+ "ca_file": {
945
+ "type": "string",
946
+ "description": "The fully qualified path name to the CA file used for Database SSL",
947
+ "default": "",
948
+ "examples": [
949
+ "security/ca.pem"
950
+ ]
951
+ },
952
+ "key_file": {
953
+ "type": "string",
954
+ "description": "The fully qualified path name to the key file used for Database SSL",
955
+ "default": "",
956
+ "examples": [
957
+ "security/key.pem"
958
+ ]
959
+ },
960
+ "cert_file": {
961
+ "type": "string",
962
+ "description": "The fully qualified path name to the Cert file used for Database SSL",
963
+ "default": "",
964
+ "examples": [
965
+ "security/cert.pem"
966
+ ]
967
+ }
968
+ }
969
+ }
970
+ },
971
+ "dependencies": {
972
+ "dbAuth": {
973
+ "oneOf": [
974
+ {
975
+ "properties": {
976
+ "dbAuth": {
977
+ "const": false
978
+ }
979
+ }
980
+ },
981
+ {
982
+ "properties": {
983
+ "dbAuth": {
984
+ "const": true
985
+ },
986
+ "username": {
987
+ "type": "string",
988
+ "minLength": 1
989
+ },
990
+ "password": {
991
+ "type": "string",
992
+ "minLength": 1
993
+ }
994
+ },
995
+ "required": [
996
+ "username",
997
+ "password"
998
+ ]
999
+ }
1000
+ ]
1001
+ }
1002
+ }
1003
+ },
1004
+ "devicebroker": {
1005
+ "type": "object",
1006
+ "properties": {
1007
+ "enabled": {
1008
+ "type": "boolean",
1009
+ "description": "Whether or not the device broker calls have been mapped",
1010
+ "default": false
1011
+ },
1012
+ "getDevice": {
1013
+ "type": "array",
1014
+ "description": "Broker call(s) to getDevice",
1015
+ "items": {
1016
+ "type": "object",
1017
+ "properties": {
1018
+ "path": {
1019
+ "type": "string",
1020
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
1021
+ "default": ""
1022
+ },
1023
+ "method": {
1024
+ "type": "string",
1025
+ "description": "The method of the call to getDevice",
1026
+ "default": "GET"
1027
+ },
1028
+ "query": {
1029
+ "type": "object",
1030
+ "description": "The json object with query parameters of the call to getDevice",
1031
+ "additionalProperties": {
1032
+ "type": ["string", "number"]
1033
+ }
1034
+ },
1035
+ "body": {
1036
+ "type": "object",
1037
+ "description": "The json object with body of the call to getDevice",
1038
+ "additionalProperties": {
1039
+ "type": ["string", "number"]
1040
+ }
1041
+ },
1042
+ "headers": {
1043
+ "type": "object",
1044
+ "description": "The json object with headers of the call to getDevice",
1045
+ "additionalProperties": {
1046
+ "type": ["string", "number"]
1047
+ }
1048
+ },
1049
+ "handleFailure": {
1050
+ "type": "string",
1051
+ "enum": [
1052
+ "ignore",
1053
+ "fail"
1054
+ ],
1055
+ "description": "return failure or ignore failure",
1056
+ "default": "ignore"
1057
+ },
1058
+ "requestFields": {
1059
+ "type": "object",
1060
+ "description": "The json object with response fields of the call to getDevice",
1061
+ "additionalProperties": {
1062
+ "type": ["string", "number"]
1063
+ },
1064
+ "properties": {}
1065
+ },
1066
+ "responseDatakey": {
1067
+ "type": "string",
1068
+ "description": "place in the response where the data is - supports jsonquery",
1069
+ "default": ""
1070
+ },
1071
+ "responseFields": {
1072
+ "type": "object",
1073
+ "description": "The json object with response fields of the call to getDevice",
1074
+ "additionalProperties": {
1075
+ "type": ["string", "number"]
1076
+ },
1077
+ "properties": {
1078
+ "name": {
1079
+ "type": "string",
1080
+ "description": "The field in response to getDevice that contains the name of the device",
1081
+ "default": "name"
1082
+ },
1083
+ "ostype": {
1084
+ "type": "string",
1085
+ "description": "The field in response to getDevice that contains the ostype of the device",
1086
+ "default": "ostype"
1087
+ },
1088
+ "ostypePrefix": {
1089
+ "type": "string",
1090
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
1091
+ "default": ""
1092
+ },
1093
+ "port": {
1094
+ "type": "string",
1095
+ "description": "The field in response to getDevice that contains the port of the device",
1096
+ "default": ""
1097
+ },
1098
+ "ipaddress": {
1099
+ "type": "string",
1100
+ "description": "The field in response to getDevice that contains the ip address of the device",
1101
+ "default": ""
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+ }
1107
+ },
1108
+ "getDevicesFiltered": {
1109
+ "type": "array",
1110
+ "description": "Broker call(s) to getDevicesFiltered",
1111
+ "items": {
1112
+ "type": "object",
1113
+ "properties": {
1114
+ "path": {
1115
+ "type": "string",
1116
+ "description": "The fully qualified path of the call to getDevicesFiltered (e.g. /rest/api/device/{deviceid})",
1117
+ "default": ""
1118
+ },
1119
+ "method": {
1120
+ "type": "string",
1121
+ "description": "The method of the call to getDevicesFiltered",
1122
+ "default": "GET"
1123
+ },
1124
+ "pagination": {
1125
+ "type": "object",
1126
+ "description": "todo",
1127
+ "properties": {
1128
+ "offsetVar": {
1129
+ "type": "string",
1130
+ "description": "Name of variable that defines how to go to next set of results"
1131
+ },
1132
+ "limitVar": {
1133
+ "type": "string",
1134
+ "description": "Name of variable that defines the max results returned in a request"
1135
+ },
1136
+ "incrementBy": {
1137
+ "type": "string",
1138
+ "enum": [
1139
+ "limit",
1140
+ "page"
1141
+ ],
1142
+ "description": "How to incremenet offset. Default limit",
1143
+ "default": "limit"
1144
+ },
1145
+ "requestLocation": {
1146
+ "type": "string",
1147
+ "enum": [
1148
+ "query",
1149
+ "body"
1150
+ ],
1151
+ "description": "Where in request the pagination data goes",
1152
+ "default": "query"
1153
+ }
1154
+ }
1155
+ },
1156
+ "query": {
1157
+ "type": "object",
1158
+ "description": "The json object with query parameters of the call to getDevicesFiltered",
1159
+ "additionalProperties": {
1160
+ "type": ["string", "number"]
1161
+ }
1162
+ },
1163
+ "body": {
1164
+ "type": "object",
1165
+ "description": "The json object with body of the call to getDevicesFiltered",
1166
+ "additionalProperties": {
1167
+ "type": ["string", "number"]
1168
+ }
1169
+ },
1170
+ "headers": {
1171
+ "type": "object",
1172
+ "description": "The json object with headers of the call to getDevicesFiltered",
1173
+ "additionalProperties": {
1174
+ "type": ["string", "number"]
1175
+ }
1176
+ },
1177
+ "handleFailure": {
1178
+ "type": "string",
1179
+ "enum": [
1180
+ "ignore",
1181
+ "fail"
1182
+ ],
1183
+ "description": "return failure or ignore failure",
1184
+ "default": "ignore"
1185
+ },
1186
+ "requestFields": {
1187
+ "type": "object",
1188
+ "description": "The json object with response fields of the call to getDevice",
1189
+ "additionalProperties": {
1190
+ "type": ["string", "number"]
1191
+ },
1192
+ "properties": {}
1193
+ },
1194
+ "responseDatakey": {
1195
+ "type": "string",
1196
+ "description": "place in the response where the data is - supports jsonquery",
1197
+ "default": ""
1198
+ },
1199
+ "responseFields": {
1200
+ "type": "object",
1201
+ "description": "The json object with response fields of the call to getDevicesFiltered",
1202
+ "additionalProperties": {
1203
+ "type": ["string", "number"]
1204
+ },
1205
+ "properties": {
1206
+ "name": {
1207
+ "type": "string",
1208
+ "description": "The field in response to getDevicesFiltered that contains the name of the device",
1209
+ "default": "name"
1210
+ },
1211
+ "ostype": {
1212
+ "type": "string",
1213
+ "description": "The field in response to getDevicesFiltered that contains the ostype of the device",
1214
+ "default": "ostype"
1215
+ },
1216
+ "ostypePrefix": {
1217
+ "type": "string",
1218
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
1219
+ "default": ""
1220
+ },
1221
+ "port": {
1222
+ "type": "string",
1223
+ "description": "The field in response to getDevicesFiltered that contains the port of the device",
1224
+ "default": ""
1225
+ },
1226
+ "ipaddress": {
1227
+ "type": "string",
1228
+ "description": "The field in response to getDevicesFiltered that contains the ip address of the device",
1229
+ "default": ""
1230
+ }
1231
+ }
1232
+ }
1233
+ }
1234
+ }
1235
+ },
1236
+ "isAlive": {
1237
+ "type": "array",
1238
+ "description": "Broker call(s) to determine if the device isAlive",
1239
+ "items": {
1240
+ "type": "object",
1241
+ "properties": {
1242
+ "path": {
1243
+ "type": "string",
1244
+ "description": "The fully qualified path of the call to isAlive (e.g. /rest/api/device/{deviceid})",
1245
+ "default": ""
1246
+ },
1247
+ "method": {
1248
+ "type": "string",
1249
+ "description": "The method of the call to isAlive",
1250
+ "default": "GET"
1251
+ },
1252
+ "query": {
1253
+ "type": "object",
1254
+ "description": "The json object with query parameters of the call to isAlive",
1255
+ "additionalProperties": {
1256
+ "type": ["string", "number"]
1257
+ }
1258
+ },
1259
+ "body": {
1260
+ "type": "object",
1261
+ "description": "The json object with body of the call to isAlive",
1262
+ "additionalProperties": {
1263
+ "type": ["string", "number"]
1264
+ }
1265
+ },
1266
+ "headers": {
1267
+ "type": "object",
1268
+ "description": "The json object with headers of the call to isAlive",
1269
+ "additionalProperties": {
1270
+ "type": ["string", "number"]
1271
+ }
1272
+ },
1273
+ "handleFailure": {
1274
+ "type": "string",
1275
+ "enum": [
1276
+ "ignore",
1277
+ "fail"
1278
+ ],
1279
+ "description": "return failure or ignore isAlive",
1280
+ "default": "ignore"
1281
+ },
1282
+ "requestFields": {
1283
+ "type": "object",
1284
+ "description": "The json object with response fields of the call to getDevice",
1285
+ "additionalProperties": {
1286
+ "type": ["string", "number"]
1287
+ },
1288
+ "properties": {}
1289
+ },
1290
+ "responseDatakey": {
1291
+ "type": "string",
1292
+ "description": "place in the response where the data is - supports jsonquery",
1293
+ "default": ""
1294
+ },
1295
+ "responseFields": {
1296
+ "type": "object",
1297
+ "description": "The json object with response fields of the call to isAlive",
1298
+ "additionalProperties": {
1299
+ "type": ["string", "number"]
1300
+ },
1301
+ "properties": {
1302
+ "status": {
1303
+ "type": "string",
1304
+ "description": "The field in response to isAlive that contains the status of the device",
1305
+ "default": "name"
1306
+ },
1307
+ "statusValue": {
1308
+ "type": "string",
1309
+ "description": "The expected value in the status field",
1310
+ "default": "true"
1311
+ }
1312
+ }
1313
+ }
1314
+ }
1315
+ }
1316
+ },
1317
+ "getConfig": {
1318
+ "type": "array",
1319
+ "description": "Broker call(s) to getConfig",
1320
+ "items": {
1321
+ "type": "object",
1322
+ "properties": {
1323
+ "path": {
1324
+ "type": "string",
1325
+ "description": "The fully qualified path of the call to getConfig (e.g. /rest/api/device/{deviceid})",
1326
+ "default": ""
1327
+ },
1328
+ "method": {
1329
+ "type": "string",
1330
+ "description": "The method of the call to getConfig",
1331
+ "default": "GET"
1332
+ },
1333
+ "query": {
1334
+ "type": "object",
1335
+ "description": "The json object with query parameters of the call to getConfig",
1336
+ "additionalProperties": {
1337
+ "type": ["string", "number"]
1338
+ }
1339
+ },
1340
+ "body": {
1341
+ "type": "object",
1342
+ "description": "The json object with body of the call to getConfig",
1343
+ "additionalProperties": {
1344
+ "type": ["string", "number"]
1345
+ }
1346
+ },
1347
+ "headers": {
1348
+ "type": "object",
1349
+ "description": "The json object with headers of the call to getConfig",
1350
+ "additionalProperties": {
1351
+ "type": ["string", "number"]
1352
+ }
1353
+ },
1354
+ "handleFailure": {
1355
+ "type": "string",
1356
+ "enum": [
1357
+ "ignore",
1358
+ "fail"
1359
+ ],
1360
+ "description": "return failure or ignore getConfig",
1361
+ "default": "ignore"
1362
+ },
1363
+ "requestFields": {
1364
+ "type": "object",
1365
+ "description": "The json object with response fields of the call to getDevice",
1366
+ "additionalProperties": {
1367
+ "type": ["string", "number"]
1368
+ },
1369
+ "properties": {}
1370
+ },
1371
+ "responseDatakey": {
1372
+ "type": "string",
1373
+ "description": "place in the response where the data is - supports jsonquery",
1374
+ "default": ""
1375
+ },
1376
+ "responseFields": {
1377
+ "type": "object",
1378
+ "description": "The json object with response fields of the call to getConfig",
1379
+ "additionalProperties": {
1380
+ "type": ["string", "number"]
1381
+ },
1382
+ "properties": {}
1383
+ }
1384
+ }
1385
+ }
1386
+ },
1387
+ "getCount": {
1388
+ "type": "array",
1389
+ "description": "Broker call(s) to getCount",
1390
+ "items": {
1391
+ "type": "object",
1392
+ "properties": {
1393
+ "path": {
1394
+ "type": "string",
1395
+ "description": "The fully qualified path of the call to getCount (e.g. /rest/api/device/{deviceid})",
1396
+ "default": ""
1397
+ },
1398
+ "method": {
1399
+ "type": "string",
1400
+ "description": "The method of the call to getCount",
1401
+ "default": "GET"
1402
+ },
1403
+ "query": {
1404
+ "type": "object",
1405
+ "description": "The json object with query parameters of the call to getCount",
1406
+ "additionalProperties": {
1407
+ "type": ["string", "number"]
1408
+ }
1409
+ },
1410
+ "body": {
1411
+ "type": "object",
1412
+ "description": "The json object with body of the call to getCount",
1413
+ "additionalProperties": {
1414
+ "type": ["string", "number"]
1415
+ }
1416
+ },
1417
+ "headers": {
1418
+ "type": "object",
1419
+ "description": "The json object with headers of the call to getCount",
1420
+ "additionalProperties": {
1421
+ "type": ["string", "number"]
1422
+ }
1423
+ },
1424
+ "handleFailure": {
1425
+ "type": "string",
1426
+ "enum": [
1427
+ "ignore",
1428
+ "fail"
1429
+ ],
1430
+ "description": "return failure or ignore getCount",
1431
+ "default": "ignore"
1432
+ },
1433
+ "requestFields": {
1434
+ "type": "object",
1435
+ "description": "The json object with response fields of the call to getDevice",
1436
+ "additionalProperties": {
1437
+ "type": ["string", "number"]
1438
+ },
1439
+ "properties": {}
1440
+ },
1441
+ "responseDatakey": {
1442
+ "type": "string",
1443
+ "description": "place in the response where the data is - supports jsonquery",
1444
+ "default": ""
1445
+ },
1446
+ "responseFields": {
1447
+ "type": "object",
1448
+ "description": "The json object with response fields of the call to getConfig",
1449
+ "additionalProperties": {
1450
+ "type": ["string", "number"]
1451
+ },
1452
+ "properties": {}
1453
+ }
1454
+ }
1455
+ }
1456
+ }
1457
+ }
1458
+ },
1459
+ "cache": {
1460
+ "type": "object",
1461
+ "properties": {
1462
+ "enabled": {
1463
+ "type": "boolean",
1464
+ "description": "Whether or not cache is enabled for adapter",
1465
+ "default": false
1466
+ },
1467
+ "entities": {
1468
+ "type": "array",
1469
+ "description": "Information for the cached entities",
1470
+ "items": {
1471
+ "type": "object",
1472
+ "properties": {
1473
+ "entityType": {
1474
+ "type": "string",
1475
+ "description": "The name of the entity - should match adapter entity configuration or a broker (e.g. Device)",
1476
+ "default": ""
1477
+ },
1478
+ "frequency": {
1479
+ "type": "integer",
1480
+ "description": "how long (in minutes) we wait to re-populate the cache",
1481
+ "default": 1440,
1482
+ "maximum": 10080
1483
+ },
1484
+ "flushOnFail": {
1485
+ "type": "boolean",
1486
+ "description": "Whether to clear the cache we have if the populate failed",
1487
+ "default": false
1488
+ },
1489
+ "limit": {
1490
+ "type": "integer",
1491
+ "description": "maximum number of items to keep in cache",
1492
+ "default": 1000
1493
+ },
1494
+ "retryAttempts": {
1495
+ "type": "integer",
1496
+ "description": "number of times to retry the populate call before failure",
1497
+ "default": 5
1498
+ },
1499
+ "sort": {
1500
+ "type": "boolean",
1501
+ "description": "whether to sort the data or not",
1502
+ "default": true
1503
+ },
1504
+ "populate": {
1505
+ "type": "array",
1506
+ "description": "Information for the call(s) used to populate the cache",
1507
+ "items": {
1508
+ "type": "object",
1509
+ "properties": {
1510
+ "path": {
1511
+ "type": "string",
1512
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
1513
+ "default": ""
1514
+ },
1515
+ "method": {
1516
+ "type": "string",
1517
+ "description": "The method of the call to getDevice",
1518
+ "default": "GET"
1519
+ },
1520
+ "pagination": {
1521
+ "type": "object",
1522
+ "description": "todo",
1523
+ "properties": {
1524
+ "offsetVar": {
1525
+ "type": "string",
1526
+ "description": "Name of variable that defines how to go to next set of results"
1527
+ },
1528
+ "limitVar": {
1529
+ "type": "string",
1530
+ "description": "Name of variable that defines the max results returned in a request"
1531
+ },
1532
+ "incrementBy": {
1533
+ "type": "string",
1534
+ "enum": [
1535
+ "limit",
1536
+ "page"
1537
+ ],
1538
+ "description": "How to incremenet offset. Default limit",
1539
+ "default": "limit"
1540
+ },
1541
+ "requestLocation": {
1542
+ "type": "string",
1543
+ "enum": [
1544
+ "query",
1545
+ "body"
1546
+ ],
1547
+ "description": "Where in request the pagination data goes",
1548
+ "default": "query"
1549
+ }
1550
+ }
1551
+ },
1552
+ "query": {
1553
+ "type": "object",
1554
+ "description": "The json object with query parameters of the call to getDevice",
1555
+ "additionalProperties": {
1556
+ "type": ["string", "number"]
1557
+ }
1558
+ },
1559
+ "body": {
1560
+ "type": "object",
1561
+ "description": "The json object with body of the call to getDevice",
1562
+ "additionalProperties": {
1563
+ "type": ["string", "number"]
1564
+ }
1565
+ },
1566
+ "headers": {
1567
+ "type": "object",
1568
+ "description": "The json object with headers of the call to getDevice",
1569
+ "additionalProperties": {
1570
+ "type": ["string", "number"]
1571
+ }
1572
+ },
1573
+ "handleFailure": {
1574
+ "type": "string",
1575
+ "enum": [
1576
+ "ignore",
1577
+ "fail"
1578
+ ],
1579
+ "description": "return failure or ignore failure",
1580
+ "default": "ignore"
1581
+ },
1582
+ "requestFields": {
1583
+ "type": "object",
1584
+ "description": "The json object with response fields of the call to getDevice",
1585
+ "additionalProperties": {
1586
+ "type": ["string", "number"]
1587
+ },
1588
+ "properties": {}
1589
+ },
1590
+ "responseDatakey": {
1591
+ "type": "string",
1592
+ "description": "place in the response where the data is - supports jsonquery",
1593
+ "default": ""
1594
+ },
1595
+ "responseFields": {
1596
+ "type": "object",
1597
+ "description": "The json object with response fields of the call to getDevice",
1598
+ "additionalProperties": {
1599
+ "type": ["string", "number"]
1600
+ }
1601
+ }
1602
+ }
1603
+ }
1604
+ },
1605
+ "cachedTasks": {
1606
+ "type": "array",
1607
+ "description": "Information for the call(s) used to populate the cache",
1608
+ "items": {
1609
+ "type": "object",
1610
+ "properties": {
1611
+ "name": {
1612
+ "type": "string",
1613
+ "description": "the name of the task/action that should utilize cached information",
1614
+ "default": ""
1615
+ },
1616
+ "filterField": {
1617
+ "type": "string",
1618
+ "description": "the field that contains filter information for this call",
1619
+ "default": ""
1620
+ },
1621
+ "filterLoc": {
1622
+ "type": "string",
1623
+ "description": "the field that contains the location of the filter field",
1624
+ "default": ""
1625
+ }
1626
+ }
1627
+ }
1628
+ }
1629
+ }
1630
+ }
1631
+ }
1632
+ }
1633
+ }
1634
+ }
1635
+ }