@itentialopensource/adapter-bluecat_ipam 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.
- package/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.jshintrc +3 -0
- package/AUTH.md +39 -0
- package/BROKER.md +211 -0
- package/CALLS.md +3069 -0
- package/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +13 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +681 -0
- package/README.md +344 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +25 -0
- package/TAB1.md +15 -0
- package/TAB2.md +318 -0
- package/TROUBLESHOOT.md +56 -0
- package/UTILITIES.md +473 -0
- package/adapter.js +47832 -0
- package/adapterBase.js +1526 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/ACLResources/action.json +127 -0
- package/entities/ACLResources/schema.json +24 -0
- package/entities/AdminResources/action.json +1954 -0
- package/entities/AdminResources/schema.json +113 -0
- package/entities/ConfigurationResources/action.json +106 -0
- package/entities/ConfigurationResources/schema.json +23 -0
- package/entities/DHCPClientClassResources/action.json +250 -0
- package/entities/DHCPClientClassResources/schema.json +30 -0
- package/entities/DHCPZoneResources/action.json +250 -0
- package/entities/DHCPZoneResources/schema.json +30 -0
- package/entities/DNSSECResources/action.json +147 -0
- package/entities/DNSSECResources/schema.json +25 -0
- package/entities/DeploymentOptionResources/action.json +250 -0
- package/entities/DeploymentOptionResources/schema.json +30 -0
- package/entities/DeploymentRoleResources/action.json +169 -0
- package/entities/DeploymentRoleResources/schema.json +26 -0
- package/entities/DeviceResources/action.json +352 -0
- package/entities/DeviceResources/schema.json +35 -0
- package/entities/FavoriteResources/action.json +65 -0
- package/entities/FavoriteResources/schema.json +21 -0
- package/entities/IPv4AndIPv6Resources/action.json +1964 -0
- package/entities/IPv4AndIPv6Resources/schema.json +113 -0
- package/entities/KerberosResources/action.json +393 -0
- package/entities/KerberosResources/schema.json +37 -0
- package/entities/LocationResources/action.json +209 -0
- package/entities/LocationResources/schema.json +28 -0
- package/entities/MACAddressAndClientIdentifierResources/action.json +395 -0
- package/entities/MACAddressAndClientIdentifierResources/schema.json +37 -0
- package/entities/NamingPolicyResources/action.json +476 -0
- package/entities/NamingPolicyResources/schema.json +41 -0
- package/entities/ResourceRecordResources/action.json +377 -0
- package/entities/ResourceRecordResources/schema.json +36 -0
- package/entities/ServerResources/action.json +784 -0
- package/entities/ServerResources/schema.json +56 -0
- package/entities/TFTPResources/action.json +250 -0
- package/entities/TFTPResources/schema.json +30 -0
- package/entities/TagResources/action.json +495 -0
- package/entities/TagResources/schema.json +42 -0
- package/entities/TaskResources/action.json +106 -0
- package/entities/TaskResources/schema.json +23 -0
- package/entities/VendorProfileResources/action.json +106 -0
- package/entities/VendorProfileResources/schema.json +23 -0
- package/entities/ViewAndZoneResources/action.json +660 -0
- package/entities/ViewAndZoneResources/schema.json +50 -0
- package/error.json +190 -0
- package/metadata.json +84 -0
- package/package.json +75 -0
- package/pronghorn.json +34480 -0
- package/propertiesDecorators.json +18 -0
- package/propertiesSchema.json +1777 -0
- package/report/Bluecat IPAM 9.5 v2 API.yml-OpenApi3Json.json +114720 -0
- package/report/adapterInfo.json +10 -0
- package/report/auto-adapter-openapi.json +28663 -0
- package/report/creationReport.json +2910 -0
- package/sampleProperties.json +264 -0
- package/test/integration/adapterTestBasicGet.js +117 -0
- package/test/integration/adapterTestConnectivity.js +117 -0
- package/test/integration/adapterTestIntegration.js +12568 -0
- package/test/unit/adapterBaseTestUnit.js +1628 -0
- package/test/unit/adapterTestUnit.js +16058 -0
- package/utils/adapterInfo.js +156 -0
- package/utils/argParser.js +44 -0
- package/utils/checkMigrate.js +102 -0
- package/utils/entitiesToDB.js +190 -0
- package/utils/findPath.js +74 -0
- package/utils/logger.js +26 -0
- package/utils/methodDocumentor.js +298 -0
- package/utils/modify.js +153 -0
- package/utils/mongoDbConnection.js +79 -0
- package/utils/mongoUtils.js +162 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/taskMover.js +308 -0
- package/utils/tbScript.js +103 -0
- package/utils/tbUtils.js +347 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +177 -0
- package/utils/updateAdapterConfig.js +158 -0
package/TAB2.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# BlueCat
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Specific Adapter Information](#specific-adapter-information)
|
|
6
|
+
- [Authentication](#authentication)
|
|
7
|
+
- [Sample Properties](#sample-properties)
|
|
8
|
+
- [Swagger](#swagger)
|
|
9
|
+
- [Generic Adapter Information](#generic-adapter-information)
|
|
10
|
+
|
|
11
|
+
## Specific Adapter Information
|
|
12
|
+
### Authentication
|
|
13
|
+
|
|
14
|
+
This document will go through the steps for authenticating the BlueCat adapter with the authentication methods we have worked with in the past. Properly configuring the properties for an adapter in Itential Platform is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
|
|
15
|
+
|
|
16
|
+
Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
|
|
17
|
+
|
|
18
|
+
#### Dynamic Token Authentication
|
|
19
|
+
The BlueCat adapter requires Dynamic Token Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
|
|
20
|
+
|
|
21
|
+
STEPS
|
|
22
|
+
1. Ensure you have access to a BlueCat server and that it is running
|
|
23
|
+
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
|
|
24
|
+
3. Use the properties below for the ```properties.authentication``` field
|
|
25
|
+
```json
|
|
26
|
+
"authentication": {
|
|
27
|
+
"auth_method": "request_token",
|
|
28
|
+
"username": "<username>",
|
|
29
|
+
"password": "<password>",
|
|
30
|
+
"token_timeout": 1800000,
|
|
31
|
+
"token_cache": "local",
|
|
32
|
+
"invalid_token_error": 401,
|
|
33
|
+
"auth_field": "header.headers.Authorization",
|
|
34
|
+
"auth_field_format": "{token}",
|
|
35
|
+
"auth_logging": false,
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
you can leave all of the other properties in the authentication section, they will not be used for BlueCat dynamic token authentication.<br>
|
|
39
|
+
4. Restart the adapter. If your properties were set correctly, the adapter should go online.
|
|
40
|
+
|
|
41
|
+
#### Troubleshooting
|
|
42
|
+
- Make sure you copied over the correct username and password.
|
|
43
|
+
- Turn on debug level logs for the adapter in Itential Platform Admin Essentials.
|
|
44
|
+
- Turn on auth_logging for the adapter in Itential Platform Admin Essentials (adapter properties).
|
|
45
|
+
- Investigate the logs - in particular:
|
|
46
|
+
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
|
|
47
|
+
- The FULL BODY log to make sure the payload is accurate.
|
|
48
|
+
- The CALL RETURN log to see what the other system is telling us.
|
|
49
|
+
- Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
|
|
50
|
+
- Remember when you are done to turn auth_logging off as you do not want to log credentials.
|
|
51
|
+
|
|
52
|
+
### Sample Properties
|
|
53
|
+
|
|
54
|
+
Sample Properties can be used to help you configure the adapter in the Itential Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
"properties": {
|
|
58
|
+
"host": "localhost",
|
|
59
|
+
"port": 80,
|
|
60
|
+
"choosepath": "",
|
|
61
|
+
"base_path": "/",
|
|
62
|
+
"version": "",
|
|
63
|
+
"cache_location": "none",
|
|
64
|
+
"encode_pathvars": true,
|
|
65
|
+
"encode_queryvars": true,
|
|
66
|
+
"save_metric": false,
|
|
67
|
+
"stub": true,
|
|
68
|
+
"protocol": "http",
|
|
69
|
+
"authentication": {
|
|
70
|
+
"auth_method": "request_token",
|
|
71
|
+
"username": "username",
|
|
72
|
+
"password": "password",
|
|
73
|
+
"token": "token",
|
|
74
|
+
"token_timeout": 1800000,
|
|
75
|
+
"token_cache": "local",
|
|
76
|
+
"invalid_token_error": 401,
|
|
77
|
+
"auth_field": "header.headers.Authorization",
|
|
78
|
+
"auth_field_format": "Basic {token}",
|
|
79
|
+
"auth_logging": false,
|
|
80
|
+
"client_id": "",
|
|
81
|
+
"client_secret": "",
|
|
82
|
+
"grant_type": "",
|
|
83
|
+
"auth_request_datatype": "",
|
|
84
|
+
"auth_response_datatype": "",
|
|
85
|
+
"token_response_placement": "",
|
|
86
|
+
"sensitive": [],
|
|
87
|
+
"multiStepAuthCalls": [
|
|
88
|
+
{
|
|
89
|
+
"name": "",
|
|
90
|
+
"requestFields": {},
|
|
91
|
+
"responseFields": {},
|
|
92
|
+
"successfullResponseCode": 200
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"sso": {
|
|
96
|
+
"protocol": "",
|
|
97
|
+
"host": "",
|
|
98
|
+
"port": 0
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"healthcheck": {
|
|
102
|
+
"type": "none",
|
|
103
|
+
"frequency": 60000,
|
|
104
|
+
"query_object": {},
|
|
105
|
+
"addlHeaders": {}
|
|
106
|
+
},
|
|
107
|
+
"throttle": {
|
|
108
|
+
"throttle_enabled": false,
|
|
109
|
+
"number_pronghorns": 1,
|
|
110
|
+
"sync_async": "sync",
|
|
111
|
+
"max_in_queue": 1000,
|
|
112
|
+
"concurrent_max": 1,
|
|
113
|
+
"expire_timeout": 0,
|
|
114
|
+
"avg_runtime": 200,
|
|
115
|
+
"priorities": [
|
|
116
|
+
{
|
|
117
|
+
"value": 0,
|
|
118
|
+
"percent": 100
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"request": {
|
|
123
|
+
"number_redirects": 0,
|
|
124
|
+
"number_retries": 3,
|
|
125
|
+
"limit_retry_error": [
|
|
126
|
+
0
|
|
127
|
+
],
|
|
128
|
+
"failover_codes": [],
|
|
129
|
+
"attempt_timeout": 5000,
|
|
130
|
+
"global_request": {
|
|
131
|
+
"payload": {},
|
|
132
|
+
"uriOptions": {},
|
|
133
|
+
"addlHeaders": {},
|
|
134
|
+
"authData": {}
|
|
135
|
+
},
|
|
136
|
+
"healthcheck_on_timeout": true,
|
|
137
|
+
"return_raw": false,
|
|
138
|
+
"archiving": false,
|
|
139
|
+
"return_request": false,
|
|
140
|
+
"keep_alive_interval": 0
|
|
141
|
+
},
|
|
142
|
+
"proxy": {
|
|
143
|
+
"enabled": false,
|
|
144
|
+
"host": "",
|
|
145
|
+
"port": 1,
|
|
146
|
+
"protocol": "http",
|
|
147
|
+
"username": "",
|
|
148
|
+
"password": ""
|
|
149
|
+
},
|
|
150
|
+
"ssl": {
|
|
151
|
+
"ecdhCurve": "",
|
|
152
|
+
"enabled": false,
|
|
153
|
+
"accept_invalid_cert": false,
|
|
154
|
+
"ca_file": "",
|
|
155
|
+
"key_file": "",
|
|
156
|
+
"cert_file": "",
|
|
157
|
+
"secure_protocol": "",
|
|
158
|
+
"ciphers": ""
|
|
159
|
+
},
|
|
160
|
+
"mongo": {
|
|
161
|
+
"url": "",
|
|
162
|
+
"host": "",
|
|
163
|
+
"port": 0,
|
|
164
|
+
"database": "",
|
|
165
|
+
"dbAuth": false,
|
|
166
|
+
"username": "",
|
|
167
|
+
"password": "",
|
|
168
|
+
"replSet": "",
|
|
169
|
+
"addSrv": false,
|
|
170
|
+
"db_ssl": {
|
|
171
|
+
"enabled": false,
|
|
172
|
+
"accept_invalid_cert": false,
|
|
173
|
+
"ca_file": "",
|
|
174
|
+
"key_file": "",
|
|
175
|
+
"cert_file": ""
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"devicebroker": {
|
|
179
|
+
"enabled": false,
|
|
180
|
+
"getDevice": [
|
|
181
|
+
{
|
|
182
|
+
"path": "/get/devices/{id}",
|
|
183
|
+
"method": "GET",
|
|
184
|
+
"query": {},
|
|
185
|
+
"body": {},
|
|
186
|
+
"headers": {},
|
|
187
|
+
"handleFailure": "fail",
|
|
188
|
+
"requestFields": {
|
|
189
|
+
"id": "name"
|
|
190
|
+
},
|
|
191
|
+
"responseDatakey": "",
|
|
192
|
+
"responseFields": {
|
|
193
|
+
"name": "host",
|
|
194
|
+
"ostype": "os",
|
|
195
|
+
"ostypePrefix": "system-",
|
|
196
|
+
"ipaddress": "attributes.ipaddr",
|
|
197
|
+
"port": "443"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"getDevicesFiltered": [
|
|
202
|
+
{
|
|
203
|
+
"path": "/get/devices",
|
|
204
|
+
"method": "GET",
|
|
205
|
+
"pagination": {
|
|
206
|
+
"offsetVar": "",
|
|
207
|
+
"limitVar": "",
|
|
208
|
+
"incrementBy": "limit",
|
|
209
|
+
"requestLocation": "query"
|
|
210
|
+
},
|
|
211
|
+
"query": {},
|
|
212
|
+
"body": {},
|
|
213
|
+
"headers": {},
|
|
214
|
+
"handleFailure": "fail",
|
|
215
|
+
"requestFields": {},
|
|
216
|
+
"responseDatakey": "",
|
|
217
|
+
"responseFields": {
|
|
218
|
+
"name": "host",
|
|
219
|
+
"ostype": "os",
|
|
220
|
+
"ostypePrefix": "system-",
|
|
221
|
+
"ipaddress": "attributes.ipaddr",
|
|
222
|
+
"port": "443"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"isAlive": [
|
|
227
|
+
{
|
|
228
|
+
"path": "/get/devices/{id}/status",
|
|
229
|
+
"method": "GET",
|
|
230
|
+
"query": {},
|
|
231
|
+
"body": {},
|
|
232
|
+
"headers": {},
|
|
233
|
+
"handleFailure": "fail",
|
|
234
|
+
"requestFields": {
|
|
235
|
+
"id": "name"
|
|
236
|
+
},
|
|
237
|
+
"responseDatakey": "",
|
|
238
|
+
"responseFields": {
|
|
239
|
+
"status": "status",
|
|
240
|
+
"statusValue": "online"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
"getConfig": [
|
|
245
|
+
{
|
|
246
|
+
"path": "/get/devices/{id}/configPart1",
|
|
247
|
+
"method": "GET",
|
|
248
|
+
"query": {},
|
|
249
|
+
"body": {},
|
|
250
|
+
"headers": {},
|
|
251
|
+
"handleFailure": "fail",
|
|
252
|
+
"requestFields": {
|
|
253
|
+
"id": "name"
|
|
254
|
+
},
|
|
255
|
+
"responseDatakey": "",
|
|
256
|
+
"responseFields": {}
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"getCount": [
|
|
260
|
+
{
|
|
261
|
+
"path": "/get/devices",
|
|
262
|
+
"method": "GET",
|
|
263
|
+
"query": {},
|
|
264
|
+
"body": {},
|
|
265
|
+
"headers": {},
|
|
266
|
+
"handleFailure": "fail",
|
|
267
|
+
"requestFields": {},
|
|
268
|
+
"responseDatakey": "",
|
|
269
|
+
"responseFields": {}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
"cache": {
|
|
274
|
+
"enabled": false,
|
|
275
|
+
"entities": [
|
|
276
|
+
{
|
|
277
|
+
"entityType": "",
|
|
278
|
+
"frequency": 1440,
|
|
279
|
+
"flushOnFail": false,
|
|
280
|
+
"limit": 1000,
|
|
281
|
+
"retryAttempts": 5,
|
|
282
|
+
"sort": true,
|
|
283
|
+
"populate": [
|
|
284
|
+
{
|
|
285
|
+
"path": "",
|
|
286
|
+
"method": "GET",
|
|
287
|
+
"pagination": {
|
|
288
|
+
"offsetVar": "",
|
|
289
|
+
"limitVar": "",
|
|
290
|
+
"incrementBy": "limit",
|
|
291
|
+
"requestLocation": "query"
|
|
292
|
+
},
|
|
293
|
+
"query": {},
|
|
294
|
+
"body": {},
|
|
295
|
+
"headers": {},
|
|
296
|
+
"handleFailure": "ignore",
|
|
297
|
+
"requestFields": {},
|
|
298
|
+
"responseDatakey": "",
|
|
299
|
+
"responseFields": {}
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
"cachedTasks": [
|
|
303
|
+
{
|
|
304
|
+
"name": "",
|
|
305
|
+
"filterField": "",
|
|
306
|
+
"filterLoc": ""
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
### Swagger
|
|
315
|
+
|
|
316
|
+
Note: The content for this section may be missing as its corresponding .json file is unavailable. This sections will be updated once adapter-openapi.json file is added.
|
|
317
|
+
## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/adapter-bluecat_ipam/-/blob/master/README.md)
|
|
318
|
+
|
package/TROUBLESHOOT.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
## Troubleshoot
|
|
2
|
+
|
|
3
|
+
Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into Itential Platform.
|
|
4
|
+
|
|
5
|
+
You also have the option to run individual commands to perform specific test:
|
|
6
|
+
|
|
7
|
+
- `npm run healthcheck` will perform a healthcheck request of with current setting.
|
|
8
|
+
- `npm run basicget` will perform some non-parameter GET request with current setting.
|
|
9
|
+
- `npm run connectivity` will perform networking diagnostics of the adatper endpoint.
|
|
10
|
+
|
|
11
|
+
### Connectivity Issues
|
|
12
|
+
|
|
13
|
+
1. You can run the adapter troubleshooting script which will check connectivity, run the healthcheck and run basic get calls.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run troubleshoot
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Verify the adapter properties are set up correctly.
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Go into the Itential Platform GUI and verify/update the properties
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
3. Verify there is connectivity between the Itential Platform Server and Bluecat_ipam Server.
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
ping the ip address of Bluecat_ipam server
|
|
29
|
+
try telnet to the ip address port of Bluecat_ipam
|
|
30
|
+
execute a curl command to the other system
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. Verify the credentials provided for Bluecat_ipam.
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
login to Bluecat_ipam using the provided credentials
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
5. Verify the API of the call utilized for Bluecat_ipam Healthcheck.
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Go into the Itential Platform GUI and verify/update the properties
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Functional Issues
|
|
46
|
+
|
|
47
|
+
Adapter logs are located in `/var/log/pronghorn`. In older releases of the Itential Platform, there is a `pronghorn.log` file which contains logs for all of the Itential Platform. In newer versions, adapters can be configured to log into their own files.
|
|
48
|
+
|
|
49
|
+
### Adapter Results
|
|
50
|
+
|
|
51
|
+
The majority of the http response codes from the adapter come directly from the downstream system. There are some exceptions to this:
|
|
52
|
+
|
|
53
|
+
1. Timeout (-2): There is an attempt timeout property that defines how long the adapter should wait to receive a response before giving up. If that time expires before a resonse is received the adapter will respond with a code of -2. The message will say "The Adapter has run out of time for the request" and it will recommend that you "Increase your adapter request.attempt_timeout property".
|
|
54
|
+
2. Econnreset (-1): When the downstream system or something within the network drops the connection, the adapter will receive and forward an ECONNRESET error with a -1 code. The message will say "The connection was terminated by the network or external system" and the recommendation will be for you to "Check connectivity to the external system and that the system is up".
|
|
55
|
+
|
|
56
|
+
The adapter will also have various errors if it is unable to build the request. All of these errors come with messages and recommendations to help you understand what you need to do to resolve the issue.
|