@itentialopensource/adapter-meraki 0.8.0 → 0.8.3

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.
@@ -51,6 +51,11 @@
51
51
  "description": "When true the path variables are encoded in the url",
52
52
  "default": true
53
53
  },
54
+ "encode_queryvars": {
55
+ "type": "boolean",
56
+ "description": "When true the path variables are encoded in the url",
57
+ "default": true
58
+ },
54
59
  "save_metric": {
55
60
  "type": [
56
61
  "boolean",
@@ -93,6 +98,9 @@
93
98
  },
94
99
  "mongo": {
95
100
  "$ref": "#/definitions/mongo"
101
+ },
102
+ "devicebroker": {
103
+ "$ref": "#/definitions/devicebroker"
96
104
  }
97
105
  },
98
106
  "required": [
@@ -835,6 +843,378 @@
835
843
  }
836
844
  }
837
845
  }
846
+ },
847
+ "devicebroker": {
848
+ "type": "object",
849
+ "properties": {
850
+ "getDevice": {
851
+ "type": "array",
852
+ "description": "Broker call(s) to getDevice",
853
+ "items": {
854
+ "properties": {
855
+ "path": {
856
+ "type": "string",
857
+ "description": "The fully qualified path of the call to getDevice (e.g. /rest/api/device/{deviceid})",
858
+ "default": ""
859
+ },
860
+ "method": {
861
+ "type": "string",
862
+ "description": "The method of the call to getDevice",
863
+ "default": "GET"
864
+ },
865
+ "query": {
866
+ "type": "object",
867
+ "description": "The json object with query parameters of the call to getDevice",
868
+ "additionalProperties": {
869
+ "type": "string"
870
+ }
871
+ },
872
+ "body": {
873
+ "type": "object",
874
+ "description": "The json object with body of the call to getDevice",
875
+ "additionalProperties": {
876
+ "type": "string"
877
+ }
878
+ },
879
+ "headers": {
880
+ "type": "object",
881
+ "description": "The json object with headers of the call to getDevice",
882
+ "additionalProperties": {
883
+ "type": "string"
884
+ }
885
+ },
886
+ "handleFailure": {
887
+ "type": "string",
888
+ "enum": [
889
+ "ignore",
890
+ "fail"
891
+ ],
892
+ "description": "return failure or ignore failure",
893
+ "default": "ignore"
894
+ },
895
+ "requestFields": {
896
+ "type": "object",
897
+ "description": "The json object with response fields of the call to getDevice",
898
+ "additionalProperties": {
899
+ "type": "string"
900
+ },
901
+ "properties": {}
902
+ },
903
+ "responseFields": {
904
+ "type": "object",
905
+ "description": "The json object with response fields of the call to getDevice",
906
+ "additionalProperties": {
907
+ "type": "string"
908
+ },
909
+ "properties": {
910
+ "name": {
911
+ "type": "string",
912
+ "description": "The field in response to getDevice that contains the name of the device",
913
+ "default": "name"
914
+ },
915
+ "ostype": {
916
+ "type": "string",
917
+ "description": "The field in response to getDevice that contains the ostype of the device",
918
+ "default": "ostype"
919
+ },
920
+ "ostypePrefix": {
921
+ "type": "string",
922
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
923
+ "default": ""
924
+ },
925
+ "port": {
926
+ "type": "string",
927
+ "description": "The field in response to getDevice that contains the port of the device",
928
+ "default": ""
929
+ },
930
+ "ip": {
931
+ "type": "string",
932
+ "description": "The field in response to getDevice that contains the ip address of the device",
933
+ "default": ""
934
+ }
935
+ }
936
+ }
937
+ }
938
+ }
939
+ },
940
+ "getDevicesFiltered": {
941
+ "type": "array",
942
+ "description": "Broker call(s) to getDevicesFiltered",
943
+ "items": {
944
+ "properties": {
945
+ "path": {
946
+ "type": "string",
947
+ "description": "The fully qualified path of the call to getDevicesFiltered (e.g. /rest/api/device/{deviceid})",
948
+ "default": ""
949
+ },
950
+ "method": {
951
+ "type": "string",
952
+ "description": "The method of the call to getDevicesFiltered",
953
+ "default": "GET"
954
+ },
955
+ "query": {
956
+ "type": "object",
957
+ "description": "The json object with query parameters of the call to getDevicesFiltered",
958
+ "additionalProperties": {
959
+ "type": "string"
960
+ }
961
+ },
962
+ "body": {
963
+ "type": "object",
964
+ "description": "The json object with body of the call to getDevicesFiltered",
965
+ "additionalProperties": {
966
+ "type": "string"
967
+ }
968
+ },
969
+ "headers": {
970
+ "type": "object",
971
+ "description": "The json object with headers of the call to getDevicesFiltered",
972
+ "additionalProperties": {
973
+ "type": "string"
974
+ }
975
+ },
976
+ "handleFailure": {
977
+ "type": "string",
978
+ "enum": [
979
+ "ignore",
980
+ "fail"
981
+ ],
982
+ "description": "return failure or ignore failure",
983
+ "default": "ignore"
984
+ },
985
+ "requestFields": {
986
+ "type": "object",
987
+ "description": "The json object with response fields of the call to getDevice",
988
+ "additionalProperties": {
989
+ "type": "string"
990
+ },
991
+ "properties": {}
992
+ },
993
+ "responseFields": {
994
+ "type": "object",
995
+ "description": "The json object with response fields of the call to getDevicesFiltered",
996
+ "additionalProperties": {
997
+ "type": "string"
998
+ },
999
+ "properties": {
1000
+ "name": {
1001
+ "type": "string",
1002
+ "description": "The field in response to getDevicesFiltered that contains the name of the device",
1003
+ "default": "name"
1004
+ },
1005
+ "ostype": {
1006
+ "type": "string",
1007
+ "description": "The field in response to getDevicesFiltered that contains the ostype of the device",
1008
+ "default": "ostype"
1009
+ },
1010
+ "ostypePrefix": {
1011
+ "type": "string",
1012
+ "description": "Any prefix that should be added to the ostype of the device (e.g. aws-)",
1013
+ "default": ""
1014
+ },
1015
+ "port_field": {
1016
+ "type": "string",
1017
+ "description": "The field in response to getDevicesFiltered that contains the port of the device",
1018
+ "default": ""
1019
+ },
1020
+ "ip_field": {
1021
+ "type": "string",
1022
+ "description": "The field in response to getDevicesFiltered that contains the ip address of the device",
1023
+ "default": ""
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ },
1030
+ "isAlive": {
1031
+ "type": "array",
1032
+ "description": "Broker call(s) to determine if the device isAlive",
1033
+ "items": {
1034
+ "properties": {
1035
+ "path": {
1036
+ "type": "string",
1037
+ "description": "The fully qualified path of the call to isAlive (e.g. /rest/api/device/{deviceid})",
1038
+ "default": ""
1039
+ },
1040
+ "method": {
1041
+ "type": "string",
1042
+ "description": "The method of the call to isAlive",
1043
+ "default": "GET"
1044
+ },
1045
+ "query": {
1046
+ "type": "object",
1047
+ "description": "The json object with query parameters of the call to isAlive",
1048
+ "additionalProperties": {
1049
+ "type": "string"
1050
+ }
1051
+ },
1052
+ "body": {
1053
+ "type": "object",
1054
+ "description": "The json object with body of the call to isAlive",
1055
+ "additionalProperties": {
1056
+ "type": "string"
1057
+ }
1058
+ },
1059
+ "headers": {
1060
+ "type": "object",
1061
+ "description": "The json object with headers of the call to isAlive",
1062
+ "additionalProperties": {
1063
+ "type": "string"
1064
+ }
1065
+ },
1066
+ "handleFailure": {
1067
+ "type": "string",
1068
+ "enum": [
1069
+ "ignore",
1070
+ "fail"
1071
+ ],
1072
+ "description": "return failure or ignore isAlive",
1073
+ "default": "ignore"
1074
+ },
1075
+ "statusValue": {
1076
+ "type": "string",
1077
+ "description": "The expected value in the status field",
1078
+ "default": "true"
1079
+ },
1080
+ "requestFields": {
1081
+ "type": "object",
1082
+ "description": "The json object with response fields of the call to getDevice",
1083
+ "additionalProperties": {
1084
+ "type": "string"
1085
+ },
1086
+ "properties": {}
1087
+ },
1088
+ "responseFields": {
1089
+ "type": "object",
1090
+ "description": "The json object with response fields of the call to isAlive",
1091
+ "additionalProperties": {
1092
+ "type": "string"
1093
+ },
1094
+ "properties": {
1095
+ "status": {
1096
+ "type": "string",
1097
+ "description": "The field in response to isAlive that contains the status of the device",
1098
+ "default": "name"
1099
+ }
1100
+ }
1101
+ }
1102
+ }
1103
+ }
1104
+ },
1105
+ "getConfig": {
1106
+ "type": "array",
1107
+ "description": "Broker call(s) to getConfig",
1108
+ "items": {
1109
+ "properties": {
1110
+ "path": {
1111
+ "type": "string",
1112
+ "description": "The fully qualified path of the call to getConfig (e.g. /rest/api/device/{deviceid})",
1113
+ "default": ""
1114
+ },
1115
+ "method": {
1116
+ "type": "string",
1117
+ "description": "The method of the call to getConfig",
1118
+ "default": "GET"
1119
+ },
1120
+ "query": {
1121
+ "type": "object",
1122
+ "description": "The json object with query parameters of the call to getConfig",
1123
+ "additionalProperties": {
1124
+ "type": "string"
1125
+ }
1126
+ },
1127
+ "body": {
1128
+ "type": "object",
1129
+ "description": "The json object with body of the call to getConfig",
1130
+ "additionalProperties": {
1131
+ "type": "string"
1132
+ }
1133
+ },
1134
+ "headers": {
1135
+ "type": "object",
1136
+ "description": "The json object with headers of the call to getConfig",
1137
+ "additionalProperties": {
1138
+ "type": "string"
1139
+ }
1140
+ },
1141
+ "handleFailure": {
1142
+ "type": "string",
1143
+ "enum": [
1144
+ "ignore",
1145
+ "fail"
1146
+ ],
1147
+ "description": "return failure or ignore getConfig",
1148
+ "default": "ignore"
1149
+ },
1150
+ "requestFields": {
1151
+ "type": "object",
1152
+ "description": "The json object with response fields of the call to getDevice",
1153
+ "additionalProperties": {
1154
+ "type": "string"
1155
+ },
1156
+ "properties": {}
1157
+ },
1158
+ "responseFields": {
1159
+ "type": "object",
1160
+ "description": "The json object with response fields of the call to getConfig",
1161
+ "additionalProperties": {
1162
+ "type": "string"
1163
+ },
1164
+ "properties": {}
1165
+ }
1166
+ }
1167
+ }
1168
+ },
1169
+ "getCount": {
1170
+ "type": "array",
1171
+ "description": "Broker call(s) to getCount",
1172
+ "items": {
1173
+ "properties": {
1174
+ "path": {
1175
+ "type": "string",
1176
+ "description": "The fully qualified path of the call to getCount (e.g. /rest/api/device/{deviceid})",
1177
+ "default": ""
1178
+ },
1179
+ "method": {
1180
+ "type": "string",
1181
+ "description": "The method of the call to getCount",
1182
+ "default": "GET"
1183
+ },
1184
+ "query": {
1185
+ "type": "object",
1186
+ "description": "The json object with query parameters of the call to getCount",
1187
+ "additionalProperties": {
1188
+ "type": "string"
1189
+ }
1190
+ },
1191
+ "body": {
1192
+ "type": "object",
1193
+ "description": "The json object with body of the call to getCount",
1194
+ "additionalProperties": {
1195
+ "type": "string"
1196
+ }
1197
+ },
1198
+ "headers": {
1199
+ "type": "object",
1200
+ "description": "The json object with headers of the call to getCount",
1201
+ "additionalProperties": {
1202
+ "type": "string"
1203
+ }
1204
+ },
1205
+ "handleFailure": {
1206
+ "type": "string",
1207
+ "enum": [
1208
+ "ignore",
1209
+ "fail"
1210
+ ],
1211
+ "description": "return failure or ignore getCount",
1212
+ "default": "ignore"
1213
+ }
1214
+ }
1215
+ }
1216
+ }
1217
+ }
838
1218
  }
839
1219
  }
840
1220
  }
Binary file
@@ -0,0 +1,115 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 13
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 7
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 23
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^4.45.4"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 69
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 258
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 248
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 47
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "unitTestJS",
71
+ "description": "Number of lines of code in unit tests",
72
+ "value": 13280
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of unit tests",
77
+ "value": 852
78
+ },
79
+ {
80
+ "owner": "integrationTestJS",
81
+ "description": "Number of lines of code in integration tests",
82
+ "value": 9678
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of integration tests",
87
+ "value": 334
88
+ },
89
+ {
90
+ "owner": "staticFile",
91
+ "description": "Number of lines of code in adapterBase.js",
92
+ "value": 1294
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of static files added",
97
+ "value": 35
98
+ },
99
+ {
100
+ "owner": "Overall",
101
+ "description": "Total lines of Code",
102
+ "value": 24252
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total Tests",
107
+ "value": 1186
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Files",
112
+ "value": 6
113
+ }
114
+ ]
115
+ }
@@ -8,6 +8,7 @@
8
8
  "version": "v0",
9
9
  "cache_location": "none",
10
10
  "encode_pathvars": true,
11
+ "encode_queryvars": true,
11
12
  "save_metric": true,
12
13
  "stub": true,
13
14
  "protocol": "https",
@@ -95,6 +96,87 @@
95
96
  "key_file": "",
96
97
  "cert_file": ""
97
98
  }
99
+ },
100
+ "deviceBroker": {
101
+ "getDevice": [
102
+ {
103
+ "path": "/get/devices/{id}",
104
+ "method": "GET",
105
+ "query": {},
106
+ "body": {},
107
+ "headers": {},
108
+ "handleFailure": "ignore",
109
+ "requestFields": {
110
+ "id": "name"
111
+ },
112
+ "responseFields": {
113
+ "name": "host",
114
+ "ostype": "os",
115
+ "ostypePrefix": "system-",
116
+ "ipaddress": "attributes.ipaddr",
117
+ "port": 443
118
+ }
119
+ }
120
+ ],
121
+ "getDevicesFiltered": [
122
+ {
123
+ "path": "/get/devices",
124
+ "method": "GET",
125
+ "query": {},
126
+ "body": {},
127
+ "headers": {},
128
+ "handleFailure": "ignore",
129
+ "requestFields": {},
130
+ "responseFields": {
131
+ "name": "host",
132
+ "ostype": "os",
133
+ "ostypePrefix": "system-",
134
+ "ipaddress": "attributes.ipaddr",
135
+ "port": 443
136
+ }
137
+ }
138
+ ],
139
+ "isAlive": [
140
+ {
141
+ "path": "/get/devices/{id}/status",
142
+ "method": "GET",
143
+ "query": {},
144
+ "body": {},
145
+ "headers": {},
146
+ "handleFailure": "ignore",
147
+ "statusValue": "online",
148
+ "requestFields": {
149
+ "id": "name"
150
+ },
151
+ "responseFields": {
152
+ "status": "status"
153
+ }
154
+ }
155
+ ],
156
+ "getConfig": [
157
+ {
158
+ "path": "/get/devices/{id}/configPart1",
159
+ "method": "GET",
160
+ "query": {},
161
+ "body": {},
162
+ "headers": {},
163
+ "handleFailure": "ignore",
164
+ "requestFields": {
165
+ "id": "name"
166
+ },
167
+ "responseFields": {}
168
+ }
169
+ ],
170
+ "getCount": [
171
+ {
172
+ "path": "/get/devices",
173
+ "method": "GET",
174
+ "query": {},
175
+ "body": {},
176
+ "headers": {},
177
+ "handleFailure": "ignore"
178
+ }
179
+ ]
98
180
  }
99
181
  },
100
182
  "groups": [],
@@ -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');