@itentialopensource/adapter-meraki 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
package/error.json CHANGED
@@ -96,6 +96,12 @@
96
96
  "displayString": "Invalid properties: $VARIABLE$",
97
97
  "recommendation": "Verify the properties for the adapter"
98
98
  },
99
+ {
100
+ "key": "Missing Properties",
101
+ "icode": "AD.306",
102
+ "displayString": "Property $VARIABLE$ is required",
103
+ "recommendation": "Please provide the required property"
104
+ },
99
105
  {
100
106
  "key": "Query Not Translated",
101
107
  "icode": "AD.310",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-meraki",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "This adapter integrates with system described as: merakiDashboardApi.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
package/pronghorn.json CHANGED
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "methods": [
11
11
  {
12
- "name": "updateAdapterConfiguration",
12
+ "name": "iapUpdateAdapterConfiguration",
13
13
  "summary": "Updates the adapter configuration",
14
14
  "description": "Updates the adapter configuration file with the provided changes",
15
15
  "input": [
@@ -78,27 +78,25 @@
78
78
  ],
79
79
  "route": {
80
80
  "verb": "POST",
81
- "path": "/updateAdapterConfiguration"
81
+ "path": "/iapUpdateAdapterConfiguration"
82
82
  },
83
83
  "task": true
84
84
  },
85
85
  {
86
- "name": "findPath",
86
+ "name": "iapFindAdapterPath",
87
87
  "summary": "Provides the ability to see if a particular API path is supported by the adapter",
88
88
  "description": "Provides the ability to see if a particular API path is supported by the adapter",
89
- "input": [
90
- {
91
- "name": "apiPath",
92
- "type": "string",
93
- "info": "The API Path you want to check - make sure to not include base path and version",
94
- "description": "The API Path you want to check - make sure to not include base path and version",
95
- "schema": {
96
- "title": "apiPath",
97
- "type": "string"
98
- },
99
- "required": true
100
- }
101
- ],
89
+ "input": [{
90
+ "name": "apiPath",
91
+ "type": "string",
92
+ "info": "The API Path you want to check - make sure to not include base path and version",
93
+ "description": "The API Path you want to check - make sure to not include base path and version",
94
+ "schema": {
95
+ "title": "apiPath",
96
+ "type": "string"
97
+ },
98
+ "required": true
99
+ }],
102
100
  "output": {
103
101
  "name": "result",
104
102
  "type": "object",
@@ -113,36 +111,30 @@
113
111
  ],
114
112
  "route": {
115
113
  "verb": "POST",
116
- "path": "/findPath"
114
+ "path": "/iapFindAdapterPath"
117
115
  },
118
116
  "task": true
119
117
  },
120
118
  {
121
- "name": "troubleshoot",
122
- "summary": "Runs troubleshoot script for adapter",
123
- "description": "Runs troubleshoot script for adapter",
124
- "input": [
125
- {
126
- "name": "props",
127
- "type": "object",
128
- "info": "Object containing configuration, healthcheck and auth properties {'connProps':{'host': 'api.service.com', 'base_path': '/', 'protocol': 'http', 'port': 443, 'version': 'v1'},'healthCheckEndpoint': '/healthcheck', 'auth': {'auth_method': 'no authentication', 'username': 'username', 'password': 'password'}}",
129
- "required": true,
130
- "schema": {
131
- "title": "props",
132
- "type": "object"
133
- }
119
+ "name": "iapSuspendAdapter",
120
+ "summary": "Suspends the adapter",
121
+ "description": "Suspends the adapter",
122
+ "input": [{
123
+ "name": "mode",
124
+ "type": "enum",
125
+ "enumerals": ["pause", "error"],
126
+ "info": "How incoming requests are handled. Defaults to 'pause'",
127
+ "description": "How incoming requests are handled. Defaults to 'pause'",
128
+ "schema": {
129
+ "title": "mode",
130
+ "type": "string"
134
131
  },
135
- {
136
- "name": "persistFlag",
137
- "type": "boolean",
138
- "info": "Whether the input properties should be saved",
139
- "required": true
140
- }
141
- ],
132
+ "required": false
133
+ }],
142
134
  "output": {
143
135
  "name": "result",
144
136
  "type": "object",
145
- "description": "A JSON Object containing the test results",
137
+ "description": "A JSON Object containing the adapter suspended status",
146
138
  "schema": {
147
139
  "title": "result",
148
140
  "type": "object"
@@ -153,38 +145,42 @@
153
145
  ],
154
146
  "route": {
155
147
  "verb": "POST",
156
- "path": "/troubleshoot"
148
+ "path": "/iapSuspendAdapter"
157
149
  },
158
150
  "task": true
159
151
  },
160
152
  {
161
- "name": "runHealthcheck",
162
- "summary": "Runs healthcheck script for adapter",
163
- "description": "Runs healthcheck script for adapter",
153
+ "name": "iapUnsuspendAdapter",
154
+ "summary": "Unsuspends the adapter",
155
+ "description": "Unsuspends the adapter",
164
156
  "input": [],
165
157
  "output": {
166
158
  "name": "result",
167
- "type": "boolean",
168
- "description": "Whether healthcheck passed or failed"
159
+ "type": "object",
160
+ "description": "A JSON Object containing the adapter suspended status",
161
+ "schema": {
162
+ "title": "result",
163
+ "type": "object"
164
+ }
169
165
  },
170
166
  "roles": [
171
167
  "admin"
172
168
  ],
173
169
  "route": {
174
170
  "verb": "POST",
175
- "path": "/runHealthcheck"
171
+ "path": "/iapUnsuspendAdapter"
176
172
  },
177
173
  "task": true
178
174
  },
179
175
  {
180
- "name": "runConnectivity",
181
- "summary": "Runs connectivity check script for adapter",
182
- "description": "Runs connectivity check script for adapter",
176
+ "name": "iapGetAdapterQueue",
177
+ "summary": "Return the requests that are waiting in the queue if throttling is enabled",
178
+ "description": "Return the requests that are waiting in the queue if throttling is enabled",
183
179
  "input": [],
184
180
  "output": {
185
181
  "name": "result",
186
182
  "type": "object",
187
- "description": "A JSON Object containing the test results",
183
+ "description": "A JSON Object containing the adapter queue",
188
184
  "schema": {
189
185
  "title": "result",
190
186
  "type": "object"
@@ -195,15 +191,32 @@
195
191
  ],
196
192
  "route": {
197
193
  "verb": "POST",
198
- "path": "/runConnectivity"
194
+ "path": "/iapGetAdapterQueue"
199
195
  },
200
196
  "task": true
201
197
  },
202
198
  {
203
- "name": "runBasicGet",
204
- "summary": "Runs basicGet script for adapter",
205
- "description": "Runs basicGet script for adapter",
206
- "input": [],
199
+ "name": "iapTroubleshootAdapter",
200
+ "summary": "Runs troubleshoot script for adapter",
201
+ "description": "Runs troubleshoot script for adapter",
202
+ "input": [
203
+ {
204
+ "name": "props",
205
+ "type": "object",
206
+ "info": "Object containing configuration, healthcheck and auth properties {'connProps':{'host': 'api.service.com', 'base_path': '/', 'protocol': 'http', 'port': 443, 'version': 'v1'},'healthCheckEndpoint': '/healthcheck', 'auth': {'auth_method': 'no authentication', 'username': 'username', 'password': 'password'}}",
207
+ "required": true,
208
+ "schema": {
209
+ "title": "props",
210
+ "type": "object"
211
+ }
212
+ },
213
+ {
214
+ "name": "persistFlag",
215
+ "type": "boolean",
216
+ "info": "Whether the input properties should be saved",
217
+ "required": true
218
+ }
219
+ ],
207
220
  "output": {
208
221
  "name": "result",
209
222
  "type": "object",
@@ -218,35 +231,38 @@
218
231
  ],
219
232
  "route": {
220
233
  "verb": "POST",
221
- "path": "/runBasicGet"
234
+ "path": "/iapTroubleshootAdapter"
222
235
  },
223
236
  "task": true
224
237
  },
225
238
  {
226
- "name": "suspend",
227
- "summary": "Suspends the adapter",
228
- "description": "Suspends the adapter",
229
- "input": [
230
- {
231
- "name": "mode",
232
- "type": "enum",
233
- "enumerals": [
234
- "pause",
235
- "error"
236
- ],
237
- "info": "How incoming requests are handled. Defaults to 'pause'",
238
- "description": "How incoming requests are handled. Defaults to 'pause'",
239
- "schema": {
240
- "title": "mode",
241
- "type": "string"
242
- },
243
- "required": false
244
- }
239
+ "name": "iapRunAdapterHealthcheck",
240
+ "summary": "Runs healthcheck script for adapter",
241
+ "description": "Runs healthcheck script for adapter",
242
+ "input": [],
243
+ "output": {
244
+ "name": "result",
245
+ "type": "boolean",
246
+ "description": "Whether healthcheck passed or failed"
247
+ },
248
+ "roles": [
249
+ "admin"
245
250
  ],
251
+ "route": {
252
+ "verb": "POST",
253
+ "path": "/iapRunAdapterHealthcheck"
254
+ },
255
+ "task": true
256
+ },
257
+ {
258
+ "name": "iapRunAdapterConnectivity",
259
+ "summary": "Runs connectivity check script for adapter",
260
+ "description": "Runs connectivity check script for adapter",
261
+ "input": [],
246
262
  "output": {
247
263
  "name": "result",
248
264
  "type": "object",
249
- "description": "A JSON Object containing the adapter suspended status",
265
+ "description": "A JSON Object containing the test results",
250
266
  "schema": {
251
267
  "title": "result",
252
268
  "type": "object"
@@ -257,19 +273,19 @@
257
273
  ],
258
274
  "route": {
259
275
  "verb": "POST",
260
- "path": "/suspend"
276
+ "path": "/iapRunAdapterConnectivity"
261
277
  },
262
278
  "task": true
263
279
  },
264
280
  {
265
- "name": "unsuspend",
266
- "summary": "Unsuspends the adapter",
267
- "description": "Unsuspends the adapter",
281
+ "name": "iapRunAdapterBasicGet",
282
+ "summary": "Runs basicGet script for adapter",
283
+ "description": "Runs basicGet script for adapter",
268
284
  "input": [],
269
285
  "output": {
270
286
  "name": "result",
271
287
  "type": "object",
272
- "description": "A JSON Object containing the adapter suspended status",
288
+ "description": "A JSON Object containing the test results",
273
289
  "schema": {
274
290
  "title": "result",
275
291
  "type": "object"
@@ -280,21 +296,21 @@
280
296
  ],
281
297
  "route": {
282
298
  "verb": "POST",
283
- "path": "/unsuspend"
299
+ "path": "/iapRunAdapterBasicGet"
284
300
  },
285
301
  "task": true
286
302
  },
287
303
  {
288
- "name": "getQueue",
289
- "summary": "Return the requests that are waiting in the queue if throttling is enabled",
290
- "description": "Return the requests that are waiting in the queue if throttling is enabled",
304
+ "name": "iapMoveAdapterEntitiesToDB",
305
+ "summary": "Moves entities from an adapter into the IAP database",
306
+ "description": "Moves entities from an adapter into the IAP database",
291
307
  "input": [],
292
308
  "output": {
293
- "name": "result",
309
+ "name": "res",
294
310
  "type": "object",
295
- "description": "A JSON Object containing the adapter queue",
311
+ "description": "A JSON Object containing status, code and the response from the mongo transaction",
296
312
  "schema": {
297
- "title": "result",
313
+ "title": "res",
298
314
  "type": "object"
299
315
  }
300
316
  },
@@ -303,7 +319,7 @@
303
319
  ],
304
320
  "route": {
305
321
  "verb": "POST",
306
- "path": "/getQueue"
322
+ "path": "/iapMoveAdapterEntitiesToDB"
307
323
  },
308
324
  "task": true
309
325
  },
@@ -386,29 +402,6 @@
386
402
  },
387
403
  "task": true
388
404
  },
389
- {
390
- "name": "moveEntitiesToDB",
391
- "summary": "Moves entities from an adapter into the IAP database",
392
- "description": "Moves entities from an adapter into the IAP database",
393
- "input": [],
394
- "output": {
395
- "name": "res",
396
- "type": "object",
397
- "description": "A JSON Object containing status, code and the response from the mongo transaction",
398
- "schema": {
399
- "title": "res",
400
- "type": "object"
401
- }
402
- },
403
- "roles": [
404
- "admin"
405
- ],
406
- "route": {
407
- "verb": "POST",
408
- "path": "/moveEntitiesToDB"
409
- },
410
- "task": true
411
- },
412
405
  {
413
406
  "name": "getDevice",
414
407
  "summary": "Get the Appliance",
@@ -556,7 +549,7 @@
556
549
  "task": false
557
550
  },
558
551
  {
559
- "name": "getCount",
552
+ "name": "iapGetDeviceCount",
560
553
  "summary": "Gets a device count from the system",
561
554
  "description": "Gets a device count from the system",
562
555
  "input": [],
@@ -574,7 +567,7 @@
574
567
  ],
575
568
  "route": {
576
569
  "verb": "POST",
577
- "path": "/getCount"
570
+ "path": "/iapGetDeviceCount"
578
571
  },
579
572
  "task": false
580
573
  },
@@ -93,6 +93,9 @@
93
93
  },
94
94
  "mongo": {
95
95
  "$ref": "#/definitions/mongo"
96
+ },
97
+ "devicebroker": {
98
+ "$ref": "#/definitions/devicebroker"
96
99
  }
97
100
  },
98
101
  "required": [
@@ -835,6 +838,226 @@
835
838
  }
836
839
  }
837
840
  }
841
+ },
842
+ "devicebroker": {
843
+ "type": "object",
844
+ "properties": {
845
+ "getDevice": {
846
+ "type": "object",
847
+ "description": "Broker call to getDevice",
848
+ "properties": {
849
+ "path": {
850
+ "type": "string",
851
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
852
+ "default": ""
853
+ },
854
+ "method": {
855
+ "type": "string",
856
+ "description": "The method of the call to getDevice",
857
+ "default": "GET"
858
+ },
859
+ "query": {
860
+ "type": "string",
861
+ "description": "The stringified json object with query parameters of the call to getDevice",
862
+ "default": "{}"
863
+ },
864
+ "body": {
865
+ "type": "string",
866
+ "description": "The stringified json object with body of the call to getDevice",
867
+ "default": "{}"
868
+ },
869
+ "headers": {
870
+ "type": "string",
871
+ "description": "The stringified json object with headers of the call to getDevice",
872
+ "default": "{}"
873
+ },
874
+ "name_field": {
875
+ "type": "string",
876
+ "description": "The field in response to getDevice that contains the name of the device",
877
+ "default": "name"
878
+ },
879
+ "ostype_field": {
880
+ "type": "string",
881
+ "description": "The field in response to getDevice that contains the ostype of the device",
882
+ "default": "ostype"
883
+ },
884
+ "ostypePrefix": {
885
+ "type": "string",
886
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
887
+ "default": ""
888
+ },
889
+ "port_field": {
890
+ "type": "string",
891
+ "description": "The field in response to getDevice that contains the port of the device",
892
+ "default": "port"
893
+ },
894
+ "ip_field": {
895
+ "type": "string",
896
+ "description": "The field in response to getDevice that contains the ip address of the device",
897
+ "default": "ipaddress"
898
+ }
899
+ }
900
+ },
901
+ "getDevicesFiltered": {
902
+ "type": "object",
903
+ "description": "Broker call to getDevicesFiltered",
904
+ "properties": {
905
+ "path": {
906
+ "type": "string",
907
+ "description": "The fully qualified path of the call to getDevicesFiltered (e.g. /rest/api/devices)",
908
+ "default": ""
909
+ },
910
+ "method": {
911
+ "type": "string",
912
+ "description": "The method of the call to getDevicesFiltered",
913
+ "default": "GET"
914
+ },
915
+ "query": {
916
+ "type": "string",
917
+ "description": "The stringified json object with query parameters of the call to getDevicesFiltered",
918
+ "default": "{}"
919
+ },
920
+ "body": {
921
+ "type": "string",
922
+ "description": "The stringified json object with body of the call to getDevicesFiltered",
923
+ "default": "{}"
924
+ },
925
+ "headers": {
926
+ "type": "string",
927
+ "description": "The stringified json object with headers of the call to getDevicesFiltered",
928
+ "default": "{}"
929
+ },
930
+ "name_field": {
931
+ "type": "string",
932
+ "description": "The field in response to getDevicesFiltered that contains the name of the device",
933
+ "default": "name"
934
+ },
935
+ "ostype_field": {
936
+ "type": "string",
937
+ "description": "The field in response to getDevicesFiltered that contains the ostype of the device",
938
+ "default": "ostype"
939
+ },
940
+ "ostypePrefix": {
941
+ "type": "string",
942
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
943
+ "default": ""
944
+ },
945
+ "port_field": {
946
+ "type": "string",
947
+ "description": "The field in response to getDevicesFiltered that contains the port of the device",
948
+ "default": "port"
949
+ },
950
+ "ip_field": {
951
+ "type": "string",
952
+ "description": "The field in response to getDevicesFiltered that contains the ip address of the device",
953
+ "default": "ipaddress"
954
+ }
955
+ }
956
+ },
957
+ "isAlive": {
958
+ "type": "object",
959
+ "description": "Broker call to isAlive",
960
+ "properties": {
961
+ "path": {
962
+ "type": "string",
963
+ "description": "The fully qualified path of the call to isAlive (e.g. /rest/api/device/{deviceid})",
964
+ "default": ""
965
+ },
966
+ "method": {
967
+ "type": "string",
968
+ "description": "The method of the call to isAlive",
969
+ "default": "GET"
970
+ },
971
+ "query": {
972
+ "type": "string",
973
+ "description": "The stringified json object with query parameters of the call to isAlive",
974
+ "default": "{}"
975
+ },
976
+ "body": {
977
+ "type": "string",
978
+ "description": "The stringified json object with body of the call to isAlive",
979
+ "default": "{}"
980
+ },
981
+ "headers": {
982
+ "type": "string",
983
+ "description": "The stringified json object with headers of the call to isAlive",
984
+ "default": "{}"
985
+ },
986
+ "status_field": {
987
+ "type": "string",
988
+ "description": "The field in response to isAlive that contains the status of the device",
989
+ "default": "status"
990
+ },
991
+ "status_value": {
992
+ "type": "string",
993
+ "description": "The status of the device that says it is alive",
994
+ "default": "true"
995
+ }
996
+ }
997
+ },
998
+ "getConfig": {
999
+ "type": "object",
1000
+ "description": "Broker call to getConfig",
1001
+ "properties": {
1002
+ "path": {
1003
+ "type": "string",
1004
+ "description": "The fully qualified path of the call to getConfig (e.g. /rest/api/device/{deviceid})",
1005
+ "default": ""
1006
+ },
1007
+ "method": {
1008
+ "type": "string",
1009
+ "description": "The method of the call to getConfig",
1010
+ "default": "GET"
1011
+ },
1012
+ "query": {
1013
+ "type": "string",
1014
+ "description": "The stringified json object with query parameters of the call to getConfig",
1015
+ "default": "{}"
1016
+ },
1017
+ "body": {
1018
+ "type": "string",
1019
+ "description": "The stringified json object with body of the call to getConfig",
1020
+ "default": "{}"
1021
+ },
1022
+ "headers": {
1023
+ "type": "string",
1024
+ "description": "The stringified json object with headers of the call to getConfig",
1025
+ "default": "{}"
1026
+ }
1027
+ }
1028
+ },
1029
+ "getCount": {
1030
+ "type": "object",
1031
+ "description": "Broker call to getCount",
1032
+ "properties": {
1033
+ "path": {
1034
+ "type": "string",
1035
+ "description": "The fully qualified path of the call to getCount (e.g. /rest/api/device)",
1036
+ "default": ""
1037
+ },
1038
+ "method": {
1039
+ "type": "string",
1040
+ "description": "The method of the call to getCount",
1041
+ "default": "GET"
1042
+ },
1043
+ "query": {
1044
+ "type": "string",
1045
+ "description": "The stringified json object with query parameters of the call to getCount",
1046
+ "default": "{}"
1047
+ },
1048
+ "body": {
1049
+ "type": "string",
1050
+ "description": "The stringified json object with body of the call to getCount",
1051
+ "default": "{}"
1052
+ },
1053
+ "headers": {
1054
+ "type": "string",
1055
+ "description": "The stringified json object with headers of the call to getCount",
1056
+ "default": "{}"
1057
+ }
1058
+ }
1059
+ }
1060
+ }
838
1061
  }
839
1062
  }
840
1063
  }
Binary file
@@ -3,6 +3,7 @@
3
3
  // Set globals
4
4
  /* global describe it log pronghornProps */
5
5
  /* eslint no-unused-vars: warn */
6
+ /* eslint no-underscore-dangle: warn */
6
7
 
7
8
  // include required items for testing & logging
8
9
  const assert = require('assert');