@itentialopensource/adapter-netbox_v210 0.2.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.
@@ -104,6 +104,111 @@
104
104
  "mockFile": ""
105
105
  }
106
106
  ]
107
+ },
108
+ {
109
+ "name": "getGenericsNoBase",
110
+ "protocol": "REST",
111
+ "method": "GET",
112
+ "entitypath": "/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
113
+ "requestSchema": "schema.json",
114
+ "responseSchema": "schema.json",
115
+ "timeout": 0,
116
+ "sendEmpty": false,
117
+ "sendGetBody": false,
118
+ "requestDatatype": "JSON",
119
+ "responseDatatype": "JSON",
120
+ "headers": {},
121
+ "responseObjects": [
122
+ {
123
+ "type": "default",
124
+ "key": "",
125
+ "mockFile": ""
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ "name": "createGenericNoBase",
131
+ "protocol": "REST",
132
+ "method": "POST",
133
+ "entitypath": "/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
134
+ "requestSchema": "schema.json",
135
+ "responseSchema": "schema.json",
136
+ "timeout": 0,
137
+ "sendEmpty": false,
138
+ "sendGetBody": false,
139
+ "requestDatatype": "JSON",
140
+ "responseDatatype": "JSON",
141
+ "headers": {},
142
+ "responseObjects": [
143
+ {
144
+ "type": "default",
145
+ "key": "",
146
+ "mockFile": ""
147
+ }
148
+ ]
149
+ },
150
+ {
151
+ "name": "updateGenericNoBase",
152
+ "protocol": "REST",
153
+ "method": "PUT",
154
+ "entitypath": "/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
155
+ "requestSchema": "schema.json",
156
+ "responseSchema": "schema.json",
157
+ "timeout": 0,
158
+ "sendEmpty": false,
159
+ "sendGetBody": false,
160
+ "requestDatatype": "JSON",
161
+ "responseDatatype": "JSON",
162
+ "headers": {},
163
+ "responseObjects": [
164
+ {
165
+ "type": "default",
166
+ "key": "",
167
+ "mockFile": ""
168
+ }
169
+ ]
170
+ },
171
+ {
172
+ "name": "patchGenericNoBase",
173
+ "protocol": "REST",
174
+ "method": "PATCH",
175
+ "entitypath": "/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
176
+ "requestSchema": "schema.json",
177
+ "responseSchema": "schema.json",
178
+ "timeout": 0,
179
+ "sendEmpty": false,
180
+ "sendGetBody": false,
181
+ "requestDatatype": "JSON",
182
+ "responseDatatype": "JSON",
183
+ "headers": {},
184
+ "responseObjects": [
185
+ {
186
+ "type": "default",
187
+ "key": "",
188
+ "mockFile": ""
189
+ }
190
+ ]
191
+ },
192
+ {
193
+ "name": "deleteGenericNoBase",
194
+ "protocol": "REST",
195
+ "method": "DELETE",
196
+ "entitypath": "/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
197
+ "requestSchema": "schema.json",
198
+ "responseSchema": "schema.json",
199
+ "timeout": 0,
200
+ "sendEmpty": false,
201
+ "sendGetBody": false,
202
+ "requestDatatype": "JSON",
203
+ "responseDatatype": "JSON",
204
+ "headers": {},
205
+ "responseObjects": [
206
+ {
207
+ "type": "default",
208
+ "key": "",
209
+ "mockFile": ""
210
+ }
211
+ ]
107
212
  }
108
213
  ]
109
214
  }
@@ -14,7 +14,12 @@
14
14
  "createGeneric",
15
15
  "updateGeneric",
16
16
  "patchGeneric",
17
- "deleteGeneric"
17
+ "deleteGeneric",
18
+ "getGenericsNoBase",
19
+ "createGenericNoBase",
20
+ "updateGenericNoBase",
21
+ "patchGenericNoBase",
22
+ "deleteGenericNoBase"
18
23
  ],
19
24
  "external_name": "ph_request_type"
20
25
  }
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,10 +1,11 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-netbox_v210",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "This adapter integrates with system described as: Netbox v2.10",
5
5
  "main": "adapter.js",
6
+ "systemName": "NetBox v2.10",
6
7
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.59.55",
8
+ "engineVersion": "1.61.6",
8
9
  "adapterType": "http",
9
10
  "scripts": {
10
11
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -53,11 +54,12 @@
53
54
  "author": "Itential",
54
55
  "homepage": "https://gitlab.com/itentialopensource/adapters/inventory/adapter-netbox_v210#readme",
55
56
  "dependencies": {
56
- "@itentialopensource/adapter-utils": "^4.44.11",
57
+ "@itentialopensource/adapter-utils": "^4.45.6",
57
58
  "ajv": "^6.12.0",
58
59
  "axios": "^0.21.0",
59
60
  "commander": "^2.20.0",
60
61
  "fs-extra": "^8.1.0",
62
+ "json-query": "^2.2.2",
61
63
  "mocha": "^9.0.1",
62
64
  "mocha-param": "^2.0.1",
63
65
  "mongodb": "^4.1.0",
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,12 +78,12 @@
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
89
  "input": [
@@ -113,36 +113,35 @@
113
113
  ],
114
114
  "route": {
115
115
  "verb": "POST",
116
- "path": "/findPath"
116
+ "path": "/iapFindAdapterPath"
117
117
  },
118
118
  "task": true
119
119
  },
120
120
  {
121
- "name": "troubleshoot",
122
- "summary": "Runs troubleshoot script for adapter",
123
- "description": "Runs troubleshoot script for adapter",
121
+ "name": "iapSuspendAdapter",
122
+ "summary": "Suspends the adapter",
123
+ "description": "Suspends the adapter",
124
124
  "input": [
125
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,
126
+ "name": "mode",
127
+ "type": "enum",
128
+ "enumerals": [
129
+ "pause",
130
+ "error"
131
+ ],
132
+ "info": "How incoming requests are handled. Defaults to 'pause'",
133
+ "description": "How incoming requests are handled. Defaults to 'pause'",
130
134
  "schema": {
131
- "title": "props",
132
- "type": "object"
133
- }
134
- },
135
- {
136
- "name": "persistFlag",
137
- "type": "boolean",
138
- "info": "Whether the input properties should be saved",
139
- "required": true
135
+ "title": "mode",
136
+ "type": "string"
137
+ },
138
+ "required": false
140
139
  }
141
140
  ],
142
141
  "output": {
143
142
  "name": "result",
144
143
  "type": "object",
145
- "description": "A JSON Object containing the test results",
144
+ "description": "A JSON Object containing the adapter suspended status",
146
145
  "schema": {
147
146
  "title": "result",
148
147
  "type": "object"
@@ -153,38 +152,42 @@
153
152
  ],
154
153
  "route": {
155
154
  "verb": "POST",
156
- "path": "/troubleshoot"
155
+ "path": "/iapSuspendAdapter"
157
156
  },
158
157
  "task": true
159
158
  },
160
159
  {
161
- "name": "runHealthcheck",
162
- "summary": "Runs healthcheck script for adapter",
163
- "description": "Runs healthcheck script for adapter",
160
+ "name": "iapUnsuspendAdapter",
161
+ "summary": "Unsuspends the adapter",
162
+ "description": "Unsuspends the adapter",
164
163
  "input": [],
165
164
  "output": {
166
165
  "name": "result",
167
- "type": "boolean",
168
- "description": "Whether healthcheck passed or failed"
166
+ "type": "object",
167
+ "description": "A JSON Object containing the adapter suspended status",
168
+ "schema": {
169
+ "title": "result",
170
+ "type": "object"
171
+ }
169
172
  },
170
173
  "roles": [
171
174
  "admin"
172
175
  ],
173
176
  "route": {
174
177
  "verb": "POST",
175
- "path": "/runHealthcheck"
178
+ "path": "/iapUnsuspendAdapter"
176
179
  },
177
180
  "task": true
178
181
  },
179
182
  {
180
- "name": "runConnectivity",
181
- "summary": "Runs connectivity check script for adapter",
182
- "description": "Runs connectivity check script for adapter",
183
+ "name": "iapGetAdapterQueue",
184
+ "summary": "Return the requests that are waiting in the queue if throttling is enabled",
185
+ "description": "Return the requests that are waiting in the queue if throttling is enabled",
183
186
  "input": [],
184
187
  "output": {
185
188
  "name": "result",
186
189
  "type": "object",
187
- "description": "A JSON Object containing the test results",
190
+ "description": "A JSON Object containing the adapter queue",
188
191
  "schema": {
189
192
  "title": "result",
190
193
  "type": "object"
@@ -195,15 +198,32 @@
195
198
  ],
196
199
  "route": {
197
200
  "verb": "POST",
198
- "path": "/runConnectivity"
201
+ "path": "/iapGetAdapterQueue"
199
202
  },
200
203
  "task": true
201
204
  },
202
205
  {
203
- "name": "runBasicGet",
204
- "summary": "Runs basicGet script for adapter",
205
- "description": "Runs basicGet script for adapter",
206
- "input": [],
206
+ "name": "iapTroubleshootAdapter",
207
+ "summary": "Runs troubleshoot script for adapter",
208
+ "description": "Runs troubleshoot script for adapter",
209
+ "input": [
210
+ {
211
+ "name": "props",
212
+ "type": "object",
213
+ "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'}}",
214
+ "required": true,
215
+ "schema": {
216
+ "title": "props",
217
+ "type": "object"
218
+ }
219
+ },
220
+ {
221
+ "name": "persistFlag",
222
+ "type": "boolean",
223
+ "info": "Whether the input properties should be saved",
224
+ "required": true
225
+ }
226
+ ],
207
227
  "output": {
208
228
  "name": "result",
209
229
  "type": "object",
@@ -218,35 +238,38 @@
218
238
  ],
219
239
  "route": {
220
240
  "verb": "POST",
221
- "path": "/runBasicGet"
241
+ "path": "/iapTroubleshootAdapter"
222
242
  },
223
243
  "task": true
224
244
  },
225
245
  {
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
- }
246
+ "name": "iapRunAdapterHealthcheck",
247
+ "summary": "Runs healthcheck script for adapter",
248
+ "description": "Runs healthcheck script for adapter",
249
+ "input": [],
250
+ "output": {
251
+ "name": "result",
252
+ "type": "boolean",
253
+ "description": "Whether healthcheck passed or failed"
254
+ },
255
+ "roles": [
256
+ "admin"
245
257
  ],
258
+ "route": {
259
+ "verb": "POST",
260
+ "path": "/iapRunAdapterHealthcheck"
261
+ },
262
+ "task": true
263
+ },
264
+ {
265
+ "name": "iapRunAdapterConnectivity",
266
+ "summary": "Runs connectivity check script for adapter",
267
+ "description": "Runs connectivity check script for adapter",
268
+ "input": [],
246
269
  "output": {
247
270
  "name": "result",
248
271
  "type": "object",
249
- "description": "A JSON Object containing the adapter suspended status",
272
+ "description": "A JSON Object containing the test results",
250
273
  "schema": {
251
274
  "title": "result",
252
275
  "type": "object"
@@ -257,19 +280,19 @@
257
280
  ],
258
281
  "route": {
259
282
  "verb": "POST",
260
- "path": "/suspend"
283
+ "path": "/iapRunAdapterConnectivity"
261
284
  },
262
285
  "task": true
263
286
  },
264
287
  {
265
- "name": "unsuspend",
266
- "summary": "Unsuspends the adapter",
267
- "description": "Unsuspends the adapter",
288
+ "name": "iapRunAdapterBasicGet",
289
+ "summary": "Runs basicGet script for adapter",
290
+ "description": "Runs basicGet script for adapter",
268
291
  "input": [],
269
292
  "output": {
270
293
  "name": "result",
271
294
  "type": "object",
272
- "description": "A JSON Object containing the adapter suspended status",
295
+ "description": "A JSON Object containing the test results",
273
296
  "schema": {
274
297
  "title": "result",
275
298
  "type": "object"
@@ -280,21 +303,21 @@
280
303
  ],
281
304
  "route": {
282
305
  "verb": "POST",
283
- "path": "/unsuspend"
306
+ "path": "/iapRunAdapterBasicGet"
284
307
  },
285
308
  "task": true
286
309
  },
287
310
  {
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",
311
+ "name": "iapMoveAdapterEntitiesToDB",
312
+ "summary": "Moves entities from an adapter into the IAP database",
313
+ "description": "Moves entities from an adapter into the IAP database",
291
314
  "input": [],
292
315
  "output": {
293
- "name": "result",
316
+ "name": "res",
294
317
  "type": "object",
295
- "description": "A JSON Object containing the adapter queue",
318
+ "description": "A JSON Object containing status, code and the response from the mongo transaction",
296
319
  "schema": {
297
- "title": "result",
320
+ "title": "res",
298
321
  "type": "object"
299
322
  }
300
323
  },
@@ -303,7 +326,7 @@
303
326
  ],
304
327
  "route": {
305
328
  "verb": "POST",
306
- "path": "/getQueue"
329
+ "path": "/iapMoveAdapterEntitiesToDB"
307
330
  },
308
331
  "task": true
309
332
  },
@@ -387,16 +410,72 @@
387
410
  "task": true
388
411
  },
389
412
  {
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": [],
413
+ "name": "genericAdapterRequestNoBasePath",
414
+ "summary": "Makes the requested generic call with no base path or version",
415
+ "description": "Makes the requested generic call with no base path or version",
416
+ "input": [
417
+ {
418
+ "name": "uriPath",
419
+ "type": "string",
420
+ "info": "the path of the api call - do not include the host, port, base path or version",
421
+ "description": "the path of the api call",
422
+ "schema": {
423
+ "title": "uriPath",
424
+ "type": "string"
425
+ },
426
+ "required": true
427
+ },
428
+ {
429
+ "name": "restMethod",
430
+ "type": "string",
431
+ "info": "the rest method (GET, POST, PUT, PATCH, DELETE)",
432
+ "description": "the rest method (GET, POST, PUT, PATCH, DELETE)",
433
+ "schema": {
434
+ "title": "restMethod",
435
+ "type": "string"
436
+ },
437
+ "required": true
438
+ },
439
+ {
440
+ "name": "queryData",
441
+ "type": "object",
442
+ "info": "the query parameters to be put on the url (optional)",
443
+ "description": "the query parameters to be put on the url (optional)",
444
+ "schema": {
445
+ "title": "queryData",
446
+ "type": "object"
447
+ },
448
+ "required": false
449
+ },
450
+ {
451
+ "name": "requestBody",
452
+ "type": "object",
453
+ "info": "the payload to be sent with the request (optional)",
454
+ "description": "the payload to be sent with the request (optional)",
455
+ "schema": {
456
+ "title": "requestBody",
457
+ "type": "object"
458
+ },
459
+ "required": false
460
+ },
461
+ {
462
+ "name": "addlHeaders",
463
+ "type": "object",
464
+ "info": "additional headers to be put on the call (optional)",
465
+ "description": "additional headers to be put on the call (optional)",
466
+ "schema": {
467
+ "title": "addlHeaders",
468
+ "type": "object"
469
+ },
470
+ "required": false
471
+ }
472
+ ],
394
473
  "output": {
395
- "name": "res",
474
+ "name": "result",
396
475
  "type": "object",
397
- "description": "A JSON Object containing status, code and the response from the mongo transaction",
476
+ "description": "A JSON Object containing status, code and the result",
398
477
  "schema": {
399
- "title": "res",
478
+ "title": "result",
400
479
  "type": "object"
401
480
  }
402
481
  },
@@ -405,7 +484,7 @@
405
484
  ],
406
485
  "route": {
407
486
  "verb": "POST",
408
- "path": "/moveEntitiesToDB"
487
+ "path": "/genericAdapterRequestNoBasePath"
409
488
  },
410
489
  "task": true
411
490
  },
@@ -556,7 +635,7 @@
556
635
  "task": false
557
636
  },
558
637
  {
559
- "name": "getCount",
638
+ "name": "iapGetDeviceCount",
560
639
  "summary": "Gets a device count from the system",
561
640
  "description": "Gets a device count from the system",
562
641
  "input": [],
@@ -574,7 +653,7 @@
574
653
  ],
575
654
  "route": {
576
655
  "verb": "POST",
577
- "path": "/getCount"
656
+ "path": "/iapGetDeviceCount"
578
657
  },
579
658
  "task": false
580
659
  },
@@ -0,0 +1,14 @@
1
+ [
2
+ {
3
+ "type": "encryption",
4
+ "pointer": "/authentication/password"
5
+ },
6
+ {
7
+ "type": "encryption",
8
+ "pointer": "/authentication/token"
9
+ },
10
+ {
11
+ "type": "encryption",
12
+ "pointer": "/mongo/password"
13
+ }
14
+ ]