@itentialopensource/adapter-robustel 0.1.1 → 0.3.0

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 (54) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +205 -0
  4. package/CHANGELOG.md +17 -2
  5. package/CODE_OF_CONDUCT.md +12 -17
  6. package/CONTRIBUTING.md +3 -148
  7. package/ENHANCE.md +69 -0
  8. package/PROPERTIES.md +641 -0
  9. package/README.md +235 -576
  10. package/SUMMARY.md +9 -0
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +47 -0
  13. package/adapter.js +402 -573
  14. package/adapterBase.js +843 -419
  15. package/changelogs/changelog.md +16 -0
  16. package/entities/.generic/action.json +105 -0
  17. package/entities/.generic/schema.json +6 -1
  18. package/error.json +6 -0
  19. package/metadata.json +47 -0
  20. package/package.json +24 -24
  21. package/pronghorn.json +559 -148
  22. package/propertiesDecorators.json +14 -0
  23. package/propertiesSchema.json +842 -6
  24. package/refs?service=git-upload-pack +0 -0
  25. package/report/adapter-openapi.json +204 -0
  26. package/report/adapter-openapi.yaml +163 -0
  27. package/report/adapterInfo.json +10 -0
  28. package/report/updateReport1653173664637.json +120 -0
  29. package/report/updateReport1691507608338.json +120 -0
  30. package/report/updateReport1692202610637.json +120 -0
  31. package/report/updateReport1694462053440.json +120 -0
  32. package/report/updateReport1698421016757.json +120 -0
  33. package/sampleProperties.json +158 -5
  34. package/test/integration/adapterTestBasicGet.js +3 -5
  35. package/test/integration/adapterTestConnectivity.js +91 -42
  36. package/test/integration/adapterTestIntegration.js +269 -271
  37. package/test/unit/adapterBaseTestUnit.js +388 -308
  38. package/test/unit/adapterTestUnit.js +399 -260
  39. package/utils/adapterInfo.js +206 -0
  40. package/utils/addAuth.js +1 -1
  41. package/utils/artifactize.js +1 -1
  42. package/utils/checkMigrate.js +1 -1
  43. package/utils/entitiesToDB.js +12 -57
  44. package/utils/findPath.js +1 -1
  45. package/utils/methodDocumentor.js +273 -0
  46. package/utils/modify.js +13 -15
  47. package/utils/packModificationScript.js +1 -1
  48. package/utils/pre-commit.sh +5 -0
  49. package/utils/taskMover.js +309 -0
  50. package/utils/tbScript.js +123 -53
  51. package/utils/tbUtils.js +87 -49
  52. package/utils/testRunner.js +17 -17
  53. package/utils/troubleshootingAdapter.js +9 -6
  54. package/workflows/README.md +0 -3
@@ -18,6 +18,11 @@
18
18
  "minimum": 1,
19
19
  "maximum": 65535
20
20
  },
21
+ "choosepath": {
22
+ "type": "string",
23
+ "description": "choose the path to use -- requires entityPath choices",
24
+ "default": ""
25
+ },
21
26
  "base_path": {
22
27
  "type": "string",
23
28
  "description": "a base path that is consistent across api calls",
@@ -51,6 +56,11 @@
51
56
  "description": "When true the path variables are encoded in the url",
52
57
  "default": true
53
58
  },
59
+ "encode_queryvars": {
60
+ "type": "boolean",
61
+ "description": "When true the query parameters are encoded in the url",
62
+ "default": true
63
+ },
54
64
  "save_metric": {
55
65
  "type": [
56
66
  "boolean",
@@ -73,6 +83,14 @@
73
83
  "https"
74
84
  ]
75
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
+ },
76
94
  "authentication": {
77
95
  "$ref": "#/definitions/authentication"
78
96
  },
@@ -93,6 +111,12 @@
93
111
  },
94
112
  "mongo": {
95
113
  "$ref": "#/definitions/mongo"
114
+ },
115
+ "devicebroker": {
116
+ "$ref": "#/definitions/devicebroker"
117
+ },
118
+ "cache": {
119
+ "$ref": "#/definitions/cache"
96
120
  }
97
121
  },
98
122
  "required": [
@@ -114,7 +138,9 @@
114
138
  "static_token",
115
139
  "jwt_token",
116
140
  "request_token",
117
- "no_authentication"
141
+ "no_authentication",
142
+ "multi_step_authentication",
143
+ "aws_authentication"
118
144
  ]
119
145
  },
120
146
  "username": {
@@ -247,6 +273,89 @@
247
273
  "type": "string",
248
274
  "description": "The grant type for OAuth requests - can also provide in schema",
249
275
  "default": ""
276
+ },
277
+ "api_version": {
278
+ "type": "string",
279
+ "description": "The api version for the signature request",
280
+ "default": ""
281
+ },
282
+ "signature_version": {
283
+ "type": "string",
284
+ "description": "The signature version for the signature request",
285
+ "default": ""
286
+ },
287
+ "unique_code": {
288
+ "type": "string",
289
+ "description": "The unique code for the signature request",
290
+ "default": ""
291
+ },
292
+ "sensitive": {
293
+ "type": "array",
294
+ "description": "List of sensitive keys to search and hide values from being logged",
295
+ "default": [],
296
+ "items": {
297
+ "type": "string"
298
+ }
299
+ },
300
+ "sso": {
301
+ "type": "object",
302
+ "properties": {
303
+ "protocol": {
304
+ "type": "string",
305
+ "description": "the protocol to request token from system",
306
+ "default": "",
307
+ "enum": [
308
+ "http",
309
+ "https",
310
+ ""
311
+ ]
312
+ },
313
+ "host": {
314
+ "type": "string",
315
+ "description": "hostname of the authentication system",
316
+ "default": "",
317
+ "examples": [
318
+ "systemx.customer.com"
319
+ ]
320
+ },
321
+ "port": {
322
+ "type": "integer",
323
+ "description": "port on which to connect to the authentication system",
324
+ "default": 0,
325
+ "minimum": 0,
326
+ "maximum": 65535
327
+ }
328
+ }
329
+ },
330
+ "multiStepAuthCalls": {
331
+ "type": "array",
332
+ "items": {
333
+ "type": "object",
334
+ "properties": {
335
+ "name": {
336
+ "type": "string",
337
+ "description": "Id of the step call",
338
+ "examples": [
339
+ "getAccessToken"
340
+ ]
341
+ },
342
+ "requestFields": {
343
+ "type": "object",
344
+ "description": "The fields set in step request"
345
+ },
346
+ "responseFields": {
347
+ "type": "object",
348
+ "description": "The fields from the step result"
349
+ },
350
+ "successfullResponseCode": {
351
+ "type": "integer",
352
+ "description": "Expected response code for given step, if not set any successfull http response is accepted",
353
+ "examples": [
354
+ 200
355
+ ]
356
+ }
357
+ }
358
+ }
250
359
  }
251
360
  },
252
361
  "required": [
@@ -349,7 +458,13 @@
349
458
  },
350
459
  "query_object": {
351
460
  "type": "object",
352
- "description": "Query object { device: xxxxx } to be placed into the healthcheck, will be converted to query string by the adapter"
461
+ "description": "Query object { device: xxxxx } to be placed into the healthcheck, will be converted to query string by the adapter",
462
+ "default": {}
463
+ },
464
+ "addlHeaders": {
465
+ "type": "object",
466
+ "description": "headers that will be appended to the headers for the call",
467
+ "default": {}
353
468
  }
354
469
  },
355
470
  "required": [
@@ -429,6 +544,7 @@
429
544
  "priorities": {
430
545
  "type": "array",
431
546
  "description": "define your priorities here",
547
+ "default": [],
432
548
  "items": {
433
549
  "type": "object",
434
550
  "properties": {
@@ -499,6 +615,7 @@
499
615
  "failover_codes": {
500
616
  "type": "array",
501
617
  "description": "An array of codes where it is ok to try another method",
618
+ "default": [],
502
619
  "items": {
503
620
  "type": "integer"
504
621
  }
@@ -516,19 +633,23 @@
516
633
  "properties": {
517
634
  "payload": {
518
635
  "type": "object",
519
- "description": "payload fields that will be appended to the provided payload (excluding GET calls)"
636
+ "description": "payload fields that will be appended to the provided payload (excluding GET calls)",
637
+ "default": {}
520
638
  },
521
639
  "uriOptions": {
522
640
  "type": "object",
523
- "description": "options that will be appended to all GET calls"
641
+ "description": "options that will be appended to all GET calls",
642
+ "default": {}
524
643
  },
525
644
  "addlHeaders": {
526
645
  "type": "object",
527
- "description": "headers that will be appended to the headers for the call"
646
+ "description": "headers that will be appended to the headers for the call",
647
+ "default": {}
528
648
  },
529
649
  "authData": {
530
650
  "type": "object",
531
- "description": "authentication data that will be appended to the payload for authentication calls"
651
+ "description": "authentication data that will be appended to the payload for authentication calls",
652
+ "default": {}
532
653
  }
533
654
  }
534
655
  },
@@ -835,6 +956,721 @@
835
956
  }
836
957
  }
837
958
  }
959
+ },
960
+ "devicebroker": {
961
+ "type": "object",
962
+ "properties": {
963
+ "getDevice": {
964
+ "type": "array",
965
+ "description": "Broker call(s) to getDevice",
966
+ "items": {
967
+ "type": "object",
968
+ "properties": {
969
+ "path": {
970
+ "type": "string",
971
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
972
+ "default": ""
973
+ },
974
+ "method": {
975
+ "type": "string",
976
+ "description": "The method of the call to getDevice",
977
+ "default": "GET"
978
+ },
979
+ "query": {
980
+ "type": "object",
981
+ "description": "The json object with query parameters of the call to getDevice",
982
+ "additionalProperties": {
983
+ "type": [
984
+ "string",
985
+ "number"
986
+ ]
987
+ }
988
+ },
989
+ "body": {
990
+ "type": "object",
991
+ "description": "The json object with body of the call to getDevice",
992
+ "additionalProperties": {
993
+ "type": [
994
+ "string",
995
+ "number"
996
+ ]
997
+ }
998
+ },
999
+ "headers": {
1000
+ "type": "object",
1001
+ "description": "The json object with headers of the call to getDevice",
1002
+ "additionalProperties": {
1003
+ "type": [
1004
+ "string",
1005
+ "number"
1006
+ ]
1007
+ }
1008
+ },
1009
+ "handleFailure": {
1010
+ "type": "string",
1011
+ "enum": [
1012
+ "ignore",
1013
+ "fail"
1014
+ ],
1015
+ "description": "return failure or ignore failure",
1016
+ "default": "ignore"
1017
+ },
1018
+ "requestFields": {
1019
+ "type": "object",
1020
+ "description": "The json object with response fields of the call to getDevice",
1021
+ "additionalProperties": {
1022
+ "type": [
1023
+ "string",
1024
+ "number"
1025
+ ]
1026
+ },
1027
+ "properties": {}
1028
+ },
1029
+ "responseDatakey": {
1030
+ "type": "string",
1031
+ "description": "place in the response where the data is - supports jsonquery",
1032
+ "default": ""
1033
+ },
1034
+ "responseFields": {
1035
+ "type": "object",
1036
+ "description": "The json object with response fields of the call to getDevice",
1037
+ "additionalProperties": {
1038
+ "type": [
1039
+ "string",
1040
+ "number"
1041
+ ]
1042
+ },
1043
+ "properties": {
1044
+ "name": {
1045
+ "type": "string",
1046
+ "description": "The field in response to getDevice that contains the name of the device",
1047
+ "default": "name"
1048
+ },
1049
+ "ostype": {
1050
+ "type": "string",
1051
+ "description": "The field in response to getDevice that contains the ostype of the device",
1052
+ "default": "ostype"
1053
+ },
1054
+ "ostypePrefix": {
1055
+ "type": "string",
1056
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
1057
+ "default": ""
1058
+ },
1059
+ "port": {
1060
+ "type": "string",
1061
+ "description": "The field in response to getDevice that contains the port of the device",
1062
+ "default": ""
1063
+ },
1064
+ "ipaddress": {
1065
+ "type": "string",
1066
+ "description": "The field in response to getDevice that contains the ip address of the device",
1067
+ "default": ""
1068
+ }
1069
+ }
1070
+ }
1071
+ }
1072
+ }
1073
+ },
1074
+ "getDevicesFiltered": {
1075
+ "type": "array",
1076
+ "description": "Broker call(s) to getDevicesFiltered",
1077
+ "items": {
1078
+ "type": "object",
1079
+ "properties": {
1080
+ "path": {
1081
+ "type": "string",
1082
+ "description": "The fully qualified path of the call to getDevicesFiltered (e.g. /rest/api/device/{deviceid})",
1083
+ "default": ""
1084
+ },
1085
+ "method": {
1086
+ "type": "string",
1087
+ "description": "The method of the call to getDevicesFiltered",
1088
+ "default": "GET"
1089
+ },
1090
+ "pagination": {
1091
+ "type": "object",
1092
+ "description": "todo",
1093
+ "properties": {
1094
+ "offsetVar": {
1095
+ "type": "string",
1096
+ "description": "Name of variable that defines how to go to next set of results"
1097
+ },
1098
+ "limitVar": {
1099
+ "type": "string",
1100
+ "description": "Name of variable that defines the max results returned in a request"
1101
+ },
1102
+ "incrementBy": {
1103
+ "type": "string",
1104
+ "enum": [
1105
+ "limit",
1106
+ "page"
1107
+ ],
1108
+ "description": "How to incremenet offset. Default limit",
1109
+ "default": "limit"
1110
+ },
1111
+ "requestLocation": {
1112
+ "type": "string",
1113
+ "enum": [
1114
+ "query",
1115
+ "body"
1116
+ ],
1117
+ "description": "Where in request the pagination data goes",
1118
+ "default": "query"
1119
+ }
1120
+ }
1121
+ },
1122
+ "query": {
1123
+ "type": "object",
1124
+ "description": "The json object with query parameters of the call to getDevicesFiltered",
1125
+ "additionalProperties": {
1126
+ "type": [
1127
+ "string",
1128
+ "number"
1129
+ ]
1130
+ }
1131
+ },
1132
+ "body": {
1133
+ "type": "object",
1134
+ "description": "The json object with body of the call to getDevicesFiltered",
1135
+ "additionalProperties": {
1136
+ "type": [
1137
+ "string",
1138
+ "number"
1139
+ ]
1140
+ }
1141
+ },
1142
+ "headers": {
1143
+ "type": "object",
1144
+ "description": "The json object with headers of the call to getDevicesFiltered",
1145
+ "additionalProperties": {
1146
+ "type": [
1147
+ "string",
1148
+ "number"
1149
+ ]
1150
+ }
1151
+ },
1152
+ "handleFailure": {
1153
+ "type": "string",
1154
+ "enum": [
1155
+ "ignore",
1156
+ "fail"
1157
+ ],
1158
+ "description": "return failure or ignore failure",
1159
+ "default": "ignore"
1160
+ },
1161
+ "requestFields": {
1162
+ "type": "object",
1163
+ "description": "The json object with response fields of the call to getDevice",
1164
+ "additionalProperties": {
1165
+ "type": [
1166
+ "string",
1167
+ "number"
1168
+ ]
1169
+ },
1170
+ "properties": {}
1171
+ },
1172
+ "responseDatakey": {
1173
+ "type": "string",
1174
+ "description": "place in the response where the data is - supports jsonquery",
1175
+ "default": ""
1176
+ },
1177
+ "responseFields": {
1178
+ "type": "object",
1179
+ "description": "The json object with response fields of the call to getDevicesFiltered",
1180
+ "additionalProperties": {
1181
+ "type": [
1182
+ "string",
1183
+ "number"
1184
+ ]
1185
+ },
1186
+ "properties": {
1187
+ "name": {
1188
+ "type": "string",
1189
+ "description": "The field in response to getDevicesFiltered that contains the name of the device",
1190
+ "default": "name"
1191
+ },
1192
+ "ostype": {
1193
+ "type": "string",
1194
+ "description": "The field in response to getDevicesFiltered that contains the ostype of the device",
1195
+ "default": "ostype"
1196
+ },
1197
+ "ostypePrefix": {
1198
+ "type": "string",
1199
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
1200
+ "default": ""
1201
+ },
1202
+ "port": {
1203
+ "type": "string",
1204
+ "description": "The field in response to getDevicesFiltered that contains the port of the device",
1205
+ "default": ""
1206
+ },
1207
+ "ipaddress": {
1208
+ "type": "string",
1209
+ "description": "The field in response to getDevicesFiltered that contains the ip address of the device",
1210
+ "default": ""
1211
+ }
1212
+ }
1213
+ }
1214
+ }
1215
+ }
1216
+ },
1217
+ "isAlive": {
1218
+ "type": "array",
1219
+ "description": "Broker call(s) to determine if the device isAlive",
1220
+ "items": {
1221
+ "type": "object",
1222
+ "properties": {
1223
+ "path": {
1224
+ "type": "string",
1225
+ "description": "The fully qualified path of the call to isAlive (e.g. /rest/api/device/{deviceid})",
1226
+ "default": ""
1227
+ },
1228
+ "method": {
1229
+ "type": "string",
1230
+ "description": "The method of the call to isAlive",
1231
+ "default": "GET"
1232
+ },
1233
+ "query": {
1234
+ "type": "object",
1235
+ "description": "The json object with query parameters of the call to isAlive",
1236
+ "additionalProperties": {
1237
+ "type": [
1238
+ "string",
1239
+ "number"
1240
+ ]
1241
+ }
1242
+ },
1243
+ "body": {
1244
+ "type": "object",
1245
+ "description": "The json object with body of the call to isAlive",
1246
+ "additionalProperties": {
1247
+ "type": [
1248
+ "string",
1249
+ "number"
1250
+ ]
1251
+ }
1252
+ },
1253
+ "headers": {
1254
+ "type": "object",
1255
+ "description": "The json object with headers of the call to isAlive",
1256
+ "additionalProperties": {
1257
+ "type": [
1258
+ "string",
1259
+ "number"
1260
+ ]
1261
+ }
1262
+ },
1263
+ "handleFailure": {
1264
+ "type": "string",
1265
+ "enum": [
1266
+ "ignore",
1267
+ "fail"
1268
+ ],
1269
+ "description": "return failure or ignore isAlive",
1270
+ "default": "ignore"
1271
+ },
1272
+ "requestFields": {
1273
+ "type": "object",
1274
+ "description": "The json object with response fields of the call to getDevice",
1275
+ "additionalProperties": {
1276
+ "type": [
1277
+ "string",
1278
+ "number"
1279
+ ]
1280
+ },
1281
+ "properties": {}
1282
+ },
1283
+ "responseDatakey": {
1284
+ "type": "string",
1285
+ "description": "place in the response where the data is - supports jsonquery",
1286
+ "default": ""
1287
+ },
1288
+ "responseFields": {
1289
+ "type": "object",
1290
+ "description": "The json object with response fields of the call to isAlive",
1291
+ "additionalProperties": {
1292
+ "type": [
1293
+ "string",
1294
+ "number"
1295
+ ]
1296
+ },
1297
+ "properties": {
1298
+ "status": {
1299
+ "type": "string",
1300
+ "description": "The field in response to isAlive that contains the status of the device",
1301
+ "default": "name"
1302
+ },
1303
+ "statusValue": {
1304
+ "type": "string",
1305
+ "description": "The expected value in the status field",
1306
+ "default": "true"
1307
+ }
1308
+ }
1309
+ }
1310
+ }
1311
+ }
1312
+ },
1313
+ "getConfig": {
1314
+ "type": "array",
1315
+ "description": "Broker call(s) to getConfig",
1316
+ "items": {
1317
+ "type": "object",
1318
+ "properties": {
1319
+ "path": {
1320
+ "type": "string",
1321
+ "description": "The fully qualified path of the call to getConfig (e.g. /rest/api/device/{deviceid})",
1322
+ "default": ""
1323
+ },
1324
+ "method": {
1325
+ "type": "string",
1326
+ "description": "The method of the call to getConfig",
1327
+ "default": "GET"
1328
+ },
1329
+ "query": {
1330
+ "type": "object",
1331
+ "description": "The json object with query parameters of the call to getConfig",
1332
+ "additionalProperties": {
1333
+ "type": [
1334
+ "string",
1335
+ "number"
1336
+ ]
1337
+ }
1338
+ },
1339
+ "body": {
1340
+ "type": "object",
1341
+ "description": "The json object with body of the call to getConfig",
1342
+ "additionalProperties": {
1343
+ "type": [
1344
+ "string",
1345
+ "number"
1346
+ ]
1347
+ }
1348
+ },
1349
+ "headers": {
1350
+ "type": "object",
1351
+ "description": "The json object with headers of the call to getConfig",
1352
+ "additionalProperties": {
1353
+ "type": [
1354
+ "string",
1355
+ "number"
1356
+ ]
1357
+ }
1358
+ },
1359
+ "handleFailure": {
1360
+ "type": "string",
1361
+ "enum": [
1362
+ "ignore",
1363
+ "fail"
1364
+ ],
1365
+ "description": "return failure or ignore getConfig",
1366
+ "default": "ignore"
1367
+ },
1368
+ "requestFields": {
1369
+ "type": "object",
1370
+ "description": "The json object with response fields of the call to getDevice",
1371
+ "additionalProperties": {
1372
+ "type": [
1373
+ "string",
1374
+ "number"
1375
+ ]
1376
+ },
1377
+ "properties": {}
1378
+ },
1379
+ "responseDatakey": {
1380
+ "type": "string",
1381
+ "description": "place in the response where the data is - supports jsonquery",
1382
+ "default": ""
1383
+ },
1384
+ "responseFields": {
1385
+ "type": "object",
1386
+ "description": "The json object with response fields of the call to getConfig",
1387
+ "additionalProperties": {
1388
+ "type": [
1389
+ "string",
1390
+ "number"
1391
+ ]
1392
+ },
1393
+ "properties": {}
1394
+ }
1395
+ }
1396
+ }
1397
+ },
1398
+ "getCount": {
1399
+ "type": "array",
1400
+ "description": "Broker call(s) to getCount",
1401
+ "items": {
1402
+ "type": "object",
1403
+ "properties": {
1404
+ "path": {
1405
+ "type": "string",
1406
+ "description": "The fully qualified path of the call to getCount (e.g. /rest/api/device/{deviceid})",
1407
+ "default": ""
1408
+ },
1409
+ "method": {
1410
+ "type": "string",
1411
+ "description": "The method of the call to getCount",
1412
+ "default": "GET"
1413
+ },
1414
+ "query": {
1415
+ "type": "object",
1416
+ "description": "The json object with query parameters of the call to getCount",
1417
+ "additionalProperties": {
1418
+ "type": [
1419
+ "string",
1420
+ "number"
1421
+ ]
1422
+ }
1423
+ },
1424
+ "body": {
1425
+ "type": "object",
1426
+ "description": "The json object with body of the call to getCount",
1427
+ "additionalProperties": {
1428
+ "type": [
1429
+ "string",
1430
+ "number"
1431
+ ]
1432
+ }
1433
+ },
1434
+ "headers": {
1435
+ "type": "object",
1436
+ "description": "The json object with headers of the call to getCount",
1437
+ "additionalProperties": {
1438
+ "type": [
1439
+ "string",
1440
+ "number"
1441
+ ]
1442
+ }
1443
+ },
1444
+ "handleFailure": {
1445
+ "type": "string",
1446
+ "enum": [
1447
+ "ignore",
1448
+ "fail"
1449
+ ],
1450
+ "description": "return failure or ignore getCount",
1451
+ "default": "ignore"
1452
+ },
1453
+ "requestFields": {
1454
+ "type": "object",
1455
+ "description": "The json object with response fields of the call to getDevice",
1456
+ "additionalProperties": {
1457
+ "type": [
1458
+ "string",
1459
+ "number"
1460
+ ]
1461
+ },
1462
+ "properties": {}
1463
+ },
1464
+ "responseDatakey": {
1465
+ "type": "string",
1466
+ "description": "place in the response where the data is - supports jsonquery",
1467
+ "default": ""
1468
+ },
1469
+ "responseFields": {
1470
+ "type": "object",
1471
+ "description": "The json object with response fields of the call to getConfig",
1472
+ "additionalProperties": {
1473
+ "type": [
1474
+ "string",
1475
+ "number"
1476
+ ]
1477
+ },
1478
+ "properties": {}
1479
+ }
1480
+ }
1481
+ }
1482
+ }
1483
+ }
1484
+ },
1485
+ "cache": {
1486
+ "type": "object",
1487
+ "properties": {
1488
+ "enabled": {
1489
+ "type": "boolean",
1490
+ "description": "Whether or not cache is enabled for adapter",
1491
+ "default": false
1492
+ },
1493
+ "entities": {
1494
+ "type": "array",
1495
+ "description": "Information for the cached entities",
1496
+ "items": {
1497
+ "type": "object",
1498
+ "properties": {
1499
+ "entityType": {
1500
+ "type": "string",
1501
+ "description": "The name of the entity - should match adapter entity configuration or a broker (e.g. Device)",
1502
+ "default": ""
1503
+ },
1504
+ "frequency": {
1505
+ "type": "integer",
1506
+ "description": "how long (in minutes) we wait to re-populate the cache",
1507
+ "default": 1440,
1508
+ "maximum": 10080
1509
+ },
1510
+ "flushOnFail": {
1511
+ "type": "boolean",
1512
+ "description": "Whether to clear the cache we have if the populate failed",
1513
+ "default": false
1514
+ },
1515
+ "limit": {
1516
+ "type": "integer",
1517
+ "description": "maximum number of items to keep in cache",
1518
+ "default": 1000
1519
+ },
1520
+ "retryAttempts": {
1521
+ "type": "integer",
1522
+ "description": "number of times to retry the populate call before failure",
1523
+ "default": 5
1524
+ },
1525
+ "sort": {
1526
+ "type": "boolean",
1527
+ "description": "whether to sort the data or not",
1528
+ "default": true
1529
+ },
1530
+ "populate": {
1531
+ "type": "array",
1532
+ "description": "Information for the call(s) used to populate the cache",
1533
+ "items": {
1534
+ "type": "object",
1535
+ "properties": {
1536
+ "path": {
1537
+ "type": "string",
1538
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
1539
+ "default": ""
1540
+ },
1541
+ "method": {
1542
+ "type": "string",
1543
+ "description": "The method of the call to getDevice",
1544
+ "default": "GET"
1545
+ },
1546
+ "pagination": {
1547
+ "type": "object",
1548
+ "description": "todo",
1549
+ "properties": {
1550
+ "offsetVar": {
1551
+ "type": "string",
1552
+ "description": "Name of variable that defines how to go to next set of results"
1553
+ },
1554
+ "limitVar": {
1555
+ "type": "string",
1556
+ "description": "Name of variable that defines the max results returned in a request"
1557
+ },
1558
+ "incrementBy": {
1559
+ "type": "string",
1560
+ "enum": [
1561
+ "limit",
1562
+ "page"
1563
+ ],
1564
+ "description": "How to incremenet offset. Default limit",
1565
+ "default": "limit"
1566
+ },
1567
+ "requestLocation": {
1568
+ "type": "string",
1569
+ "enum": [
1570
+ "query",
1571
+ "body"
1572
+ ],
1573
+ "description": "Where in request the pagination data goes",
1574
+ "default": "query"
1575
+ }
1576
+ }
1577
+ },
1578
+ "query": {
1579
+ "type": "object",
1580
+ "description": "The json object with query parameters of the call to getDevice",
1581
+ "additionalProperties": {
1582
+ "type": [
1583
+ "string",
1584
+ "number"
1585
+ ]
1586
+ }
1587
+ },
1588
+ "body": {
1589
+ "type": "object",
1590
+ "description": "The json object with body of the call to getDevice",
1591
+ "additionalProperties": {
1592
+ "type": [
1593
+ "string",
1594
+ "number"
1595
+ ]
1596
+ }
1597
+ },
1598
+ "headers": {
1599
+ "type": "object",
1600
+ "description": "The json object with headers of the call to getDevice",
1601
+ "additionalProperties": {
1602
+ "type": [
1603
+ "string",
1604
+ "number"
1605
+ ]
1606
+ }
1607
+ },
1608
+ "handleFailure": {
1609
+ "type": "string",
1610
+ "enum": [
1611
+ "ignore",
1612
+ "fail"
1613
+ ],
1614
+ "description": "return failure or ignore failure",
1615
+ "default": "ignore"
1616
+ },
1617
+ "requestFields": {
1618
+ "type": "object",
1619
+ "description": "The json object with response fields of the call to getDevice",
1620
+ "additionalProperties": {
1621
+ "type": [
1622
+ "string",
1623
+ "number"
1624
+ ]
1625
+ },
1626
+ "properties": {}
1627
+ },
1628
+ "responseDatakey": {
1629
+ "type": "string",
1630
+ "description": "place in the response where the data is - supports jsonquery",
1631
+ "default": ""
1632
+ },
1633
+ "responseFields": {
1634
+ "type": "object",
1635
+ "description": "The json object with response fields of the call to getDevice",
1636
+ "additionalProperties": {
1637
+ "type": [
1638
+ "string",
1639
+ "number"
1640
+ ]
1641
+ }
1642
+ }
1643
+ }
1644
+ }
1645
+ },
1646
+ "cachedTasks": {
1647
+ "type": "array",
1648
+ "description": "Information for the call(s) used to populate the cache",
1649
+ "items": {
1650
+ "type": "object",
1651
+ "properties": {
1652
+ "name": {
1653
+ "type": "string",
1654
+ "description": "the name of the task/action that should utilize cached information",
1655
+ "default": ""
1656
+ },
1657
+ "filterField": {
1658
+ "type": "string",
1659
+ "description": "the field that contains filter information for this call",
1660
+ "default": ""
1661
+ },
1662
+ "filterLoc": {
1663
+ "type": "string",
1664
+ "description": "the field that contains the location of the filter field",
1665
+ "default": ""
1666
+ }
1667
+ }
1668
+ }
1669
+ }
1670
+ }
1671
+ }
1672
+ }
1673
+ }
838
1674
  }
839
1675
  }
840
1676
  }