@itentialopensource/adapter-adtran_mosaic_devicemanager 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 (52) hide show
  1. package/AUTH.md +39 -0
  2. package/BROKER.md +199 -0
  3. package/CALLS.md +733 -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 +14 -14
  8. package/PROPERTIES.md +483 -89
  9. package/README.md +156 -67
  10. package/SUMMARY.md +2 -2
  11. package/SYSTEMINFO.md +11 -0
  12. package/TROUBLESHOOT.md +4 -3
  13. package/adapter.js +236 -626
  14. package/adapterBase.js +647 -494
  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/metadata.json +47 -0
  19. package/package.json +24 -24
  20. package/pronghorn.json +508 -90
  21. package/propertiesSchema.json +496 -39
  22. package/refs?service=git-upload-pack +0 -0
  23. package/report/adapter-openapi.json +7211 -0
  24. package/report/adapter-openapi.yaml +6459 -0
  25. package/report/adapterInfo.json +10 -0
  26. package/report/updateReport1653138377421.json +120 -0
  27. package/report/updateReport1691507605063.json +120 -0
  28. package/report/updateReport1692202606613.json +120 -0
  29. package/report/updateReport1694462023649.json +120 -0
  30. package/report/updateReport1698421007213.json +120 -0
  31. package/sampleProperties.json +153 -3
  32. package/test/integration/adapterTestBasicGet.js +3 -5
  33. package/test/integration/adapterTestConnectivity.js +91 -42
  34. package/test/integration/adapterTestIntegration.js +1965 -2493
  35. package/test/unit/adapterBaseTestUnit.js +388 -306
  36. package/test/unit/adapterTestUnit.js +364 -231
  37. package/utils/adapterInfo.js +206 -0
  38. package/utils/addAuth.js +1 -1
  39. package/utils/artifactize.js +1 -1
  40. package/utils/checkMigrate.js +1 -1
  41. package/utils/entitiesToDB.js +12 -57
  42. package/utils/findPath.js +1 -1
  43. package/utils/methodDocumentor.js +273 -0
  44. package/utils/modify.js +13 -15
  45. package/utils/packModificationScript.js +1 -1
  46. package/utils/pre-commit.sh +5 -0
  47. package/utils/taskMover.js +309 -0
  48. package/utils/tbScript.js +123 -53
  49. package/utils/tbUtils.js +84 -59
  50. package/utils/testRunner.js +17 -17
  51. package/utils/troubleshootingAdapter.js +9 -6
  52. package/workflows/README.md +0 -3
package/README.md CHANGED
@@ -2,34 +2,37 @@
2
2
 
3
3
  ## Table of Contents
4
4
 
5
- * [Overview](./SUMMARY.md)
6
- * [Versioning](#versioning)
7
- * [Supported IAP Versions](#supported-iap-versions)
8
- * [Getting Started](#getting-started)
9
- * [Helpful Background Information](#helpful-background-information)
10
- * [Prerequisites](#prerequisites)
11
- * [How to Install](#how-to-install)
12
- * [Testing](#testing)
13
- * [Configuration](./PROPERTIES.md)
14
- * [Using this Adapter](./CALLS.md)
15
- * [Additional Information](#additional-information)
16
- * [Enhancements](./ENHANCE.md)
17
- * [Contributing](./CONTRIBUTING.md)
18
- * [Helpful Links](#helpful-links)
19
- * [Node Scripts](#node-scripts)
20
- * [Troubleshoot](./TROUBLESHOOT.md)
21
- * [License and Maintainers](#license-and-maintainers)
22
- * [Product License](#product-license)
5
+ Some of the page links in this document and links to other GitLab files do not work in Confluence however, the information is available in other sections of the Confluence material.
6
+
7
+ - [Overview](./SUMMARY.md)
8
+ - [Versioning](#versioning)
9
+ - [Supported IAP Versions](#supported-iap-versions)
10
+ - [Getting Started](#getting-started)
11
+ - [Helpful Background Information](#helpful-background-information)
12
+ - [Prerequisites](#prerequisites)
13
+ - [How to Install](#how-to-install)
14
+ - [Testing](#testing)
15
+ - [Configuration](./PROPERTIES.md)
16
+ - [Using this Adapter](./CALLS.md)
17
+ - [Authentication](./AUTH.md)
18
+ - [Additional Information](#additional-information)
19
+ - [Enhancements](./ENHANCE.md)
20
+ - [Contributing](./CONTRIBUTING.md)
21
+ - [Helpful Links](#helpful-links)
22
+ - [Node Scripts](#node-scripts)
23
+ - [Troubleshoot](./TROUBLESHOOT.md)
24
+ - [License and Maintainers](#license-and-maintainers)
25
+ - [Product License](#product-license)
23
26
 
24
27
  ## [Overview](./SUMMARY.md)
25
28
 
26
29
  ## Versioning
27
30
 
28
- Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the IAP GUI on the System page. All Itential opensource adapters can be found in the [Itential OpenSource Repository](https://gitlab.com/itentialopensource/adapters).
31
+ Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the IAP GUI on the System page. All Itential opensource adapters can be found in the <a href="https://gitlab.com/itentialopensource/adapters" target="_blank">Itential OpenSource Repository</a>.
29
32
 
30
33
  Any release prior to 1.0.0 is a pre-release. Initial builds of adapters are generally set up as pre-releases as there is often work that needs to be done to configure the adapter and make sure the authentication process to AdtranMosaicDeviceManager works appropriately.
31
34
 
32
- Release notes can be viewed in CHANGELOG.md or in the [Customer Knowledge Base](https://itential.atlassian.net/servicedesk/customer/portals) for Itential adapters.
35
+ Release notes can be viewed in CHANGELOG.md.
33
36
 
34
37
  ## Supported IAP Versions
35
38
 
@@ -45,21 +48,24 @@ These instructions will help you get a copy of the project on your local machine
45
48
 
46
49
  ### Helpful Background Information
47
50
 
48
- There is adapter documentation available on the Itential Developer Site [HERE](https://www.itential.com/automation-platform/integrations/adapters-resources/). This documentation includes information and examples that are helpful for:
51
+ There is <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter documentation available on the Itential Documentation Site</a>. This documentation includes information and examples that are helpful for:
49
52
 
50
53
  ```text
51
54
  Authentication
52
- Properties
55
+ IAP Service Instance Configuration
53
56
  Code Files
54
- Action Files
55
- Schema Files
56
- Mock Data Files
57
+ Endpoint Configuration (Action & Schema)
58
+ Mock Data
59
+ Adapter Generic Methods
60
+ Headers
61
+ Security
57
62
  Linting and Testing
58
- Troubleshooting
63
+ Build an Adapter
64
+ Troubleshooting an Adapter
59
65
  ```
60
66
 
61
67
  Others will be added over time.
62
- Want to build a new adapter? Use the Itential Adapter Builder [HERE](https://adapters.itential.io)
68
+ Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
63
69
 
64
70
  ### Prerequisites
65
71
 
@@ -73,22 +79,69 @@ Git
73
79
 
74
80
  The following list of packages are required for Itential opensource adapters or custom adapters that have been built utilizing the Itential Adapter Builder. You can install these packages by running npm install inside the adapter directory.
75
81
 
76
- | Package | Description |
77
- | ------- | ------- |
78
- | @itentialopensource/adapter-utils | Runtime library classes for all adapters; includes request handling, connection, authentication throttling, and translation. |
79
- | ajv | Required for validation of adapter properties to integrate with AdtranMosaicDeviceManager. |
80
- | axios | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
81
- | commander | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
82
- | fs-extra | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
83
- | mocha | Testing library that is utilized by some of the node scripts that are included with the adapter. |
84
- | mocha-param | Testing library that is utilized by some of the node scripts that are included with the adapter. |
85
- | mongodb | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
86
-
87
- | network-diagnostics | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
88
- | nyc | Testing coverage library that is utilized by some of the node scripts that are included with the adapter. |
89
- | readline-sync | Utilized by the node script that comes with the adapter; helps to test unit and integration functionality. |
90
- | semver | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
91
- | winston | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
82
+ <table border="1" class="bordered-table">
83
+ <tr>
84
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Package</span></th>
85
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
86
+ </tr>
87
+ <tr>
88
+ <td style="padding:15px">@itentialopensource/adapter-utils</td>
89
+ <td style="padding:15px">Runtime library classes for all adapters; includes request handling, connection, authentication throttling, and translation.</td>
90
+ </tr>
91
+ <tr>
92
+ <td style="padding:15px">ajv</td>
93
+ <td style="padding:15px">Required for validation of adapter properties to integrate with AdtranMosaicDeviceManager.</td>
94
+ </tr>
95
+ <tr>
96
+ <td style="padding:15px">axios</td>
97
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
98
+ </tr>
99
+ <tr>
100
+ <td style="padding:15px">commander</td>
101
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
102
+ </tr>
103
+ <tr>
104
+ <td style="padding:15px">dns-lookup-promise</td>
105
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
106
+ </tr>
107
+ <tr>
108
+ <td style="padding:15px">fs-extra</td>
109
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
110
+ </tr>
111
+ <tr>
112
+ <td style="padding:15px">mocha</td>
113
+ <td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
114
+ </tr>
115
+ <tr>
116
+ <td style="padding:15px">mocha-param</td>
117
+ <td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
118
+ </tr>
119
+ <tr>
120
+ <td style="padding:15px">mongodb</td>
121
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
122
+ </tr>
123
+ <tr>
124
+ <td style="padding:15px">nyc</td>
125
+ <td style="padding:15px">Testing coverage library that is utilized by some of the node scripts that are included with the adapter.</td>
126
+ </tr>
127
+ <tr>
128
+ <td style="padding:15px">ping</td>
129
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
130
+ </tr>
131
+ <tr>
132
+ <td style="padding:15px">readline-sync</td>
133
+ <td style="padding:15px">Utilized by the node script that comes with the adapter; helps to test unit and integration functionality.</td>
134
+ </tr>
135
+ <tr>
136
+ <td style="padding:15px">semver</td>
137
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
138
+ </tr>
139
+ <tr>
140
+ <td style="padding:15px">winston</td>
141
+ <td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
142
+ </tr>
143
+ </table>
144
+ <br>
92
145
 
93
146
  If you are developing and testing a custom adapter, or have testing capabilities on an Itential opensource adapter, you will need to install these packages as well.
94
147
 
@@ -98,7 +151,6 @@ eslint
98
151
  eslint-config-airbnb-base
99
152
  eslint-plugin-import
100
153
  eslint-plugin-json
101
- package-json-validator
102
154
  testdouble
103
155
  ```
104
156
 
@@ -127,7 +179,9 @@ tar -xvf adapter-adtran_mosaic_devicemanager.tar
127
179
 
128
180
  ```bash
129
181
  cd adapter-adtran_mosaic_devicemanager
130
- npm run adapter:install
182
+ npm install
183
+ npm run lint:errors
184
+ npm run test
131
185
  ```
132
186
 
133
187
  4. Restart IAP
@@ -136,17 +190,20 @@ npm run adapter:install
136
190
  systemctl restart pronghorn
137
191
  ```
138
192
 
139
- 5. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
193
+ 5. Create an adapter service instance configuration in IAP Admin Essentials GUI
194
+
195
+ 6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
196
+
197
+ 7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
140
198
 
141
- npm run adapter:install can be dependent on where the adapter is installed and on the version of IAP so it is subject to fail. If this happens you can replace step 3-5 above with these:
199
+
200
+ For an easier install of the adapter use npm run adapter:install, it will install the adapter in IAP. Please note that it can be dependent on where the adapter is installed and on the version of IAP so it is subject to fail. If using this, you can replace step 3-5 above with these:
142
201
 
143
202
  3. Install adapter dependencies and check the adapter.
144
203
 
145
204
  ```bash
146
205
  cd adapter-adtran_mosaic_devicemanager
147
- npm run install
148
- npm run lint:errors
149
- npm run test
206
+ npm run adapter:install
150
207
  ```
151
208
 
152
209
  4. Restart IAP
@@ -155,11 +212,8 @@ npm run test
155
212
  systemctl restart pronghorn
156
213
  ```
157
214
 
158
- 5. Create an adapter service instance configuration in IAP Admin Essentials GUI
159
-
160
- 6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
215
+ 5. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
161
216
 
162
- 7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
163
217
 
164
218
  ### Testing
165
219
 
@@ -223,24 +277,59 @@ Test should also be written to clean up after themselves. However, it is importa
223
277
 
224
278
  ### Helpful Links
225
279
 
226
- [Adapter Technical Resources](https://www.itential.com/automation-platform/integrations/adapters-resources/)
280
+ <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a>
227
281
 
228
282
  ### Node Scripts
229
283
 
230
284
  There are several node scripts that now accompany the adapter. These scripts are provided to make several activities easier. Many of these scripts can have issues with different versions of IAP as they have dependencies on IAP and Mongo. If you have issues with the scripts please report them to the Itential Adapter Team. Each of these scripts are described below.
231
285
 
232
- | Run | Description |
233
- | ------- | ------- |
234
- | npm run adapter:install | Provides an easier way to install the adapter.|
235
- | npm run adapter:checkMigrate | Checks whether your adapter can and should be migrated to the latest foundation.|
236
- | npm run adapter:findPath | Can be used to see if the adapter supports a particular API call.|
237
- | npm run adapter:migrate | Provides an easier way to migrate your adapter after you download the migration zip from Itential DevSite|
238
- | npm run adapter:update | Provides an easier way to update your adapter after you download the migration zip from Itential DevSite|
239
- | npm run adapter:revert | Allows you to revert after a migration or update if it resulted in issues.|
240
- | npm run troubleshoot | Provides a way to troubleshoot the adapter - runs connectivity, healthcheck and basic get.|
241
- | npm run connectivity | Provides a connectivity check to the AdtranMosaicDeviceManager system.|
242
- | npm run healthcheck | Checks whether the configured healthcheck call works to AdtranMosaicDeviceManager.|
243
- | npm run basicget | Checks whether the basic get calls works to AdtranMosaicDeviceManager.|
286
+ <table border="1" class="bordered-table">
287
+ <tr>
288
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Run</span></th>
289
+ <th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
290
+ </tr>
291
+ <tr>
292
+ <td style="padding:15px">npm run adapter:install</td>
293
+ <td style="padding:15px">Provides an easier way to install the adapter.</td>
294
+ </tr>
295
+ <tr>
296
+ <td style="padding:15px">npm run adapter:checkMigrate</td>
297
+ <td style="padding:15px">Checks whether your adapter can and should be migrated to the latest foundation.</td>
298
+ </tr>
299
+ <tr>
300
+ <td style="padding:15px">npm run adapter:findPath</td>
301
+ <td style="padding:15px">Can be used to see if the adapter supports a particular API call.</td>
302
+ </tr>
303
+ <tr>
304
+ <td style="padding:15px">npm run adapter:migrate</td>
305
+ <td style="padding:15px">Provides an easier way to update your adapter after you download the migration zip from Itential DevSite.</td>
306
+ </tr>
307
+ <tr>
308
+ <td style="padding:15px">npm run adapter:update</td>
309
+ <td style="padding:15px">Provides an easier way to update your adapter after you download the update zip from Itential DevSite.</td>
310
+ </tr>
311
+ <tr>
312
+ <td style="padding:15px">npm run adapter:revert</td>
313
+ <td style="padding:15px">Allows you to revert after a migration or update if it resulted in issues.</td>
314
+ </tr>
315
+ <tr>
316
+ <td style="padding:15px">npm run troubleshoot</td>
317
+ <td style="padding:15px">Provides a way to troubleshoot the adapter - runs connectivity, healthcheck and basic get.</td>
318
+ </tr>
319
+ <tr>
320
+ <td style="padding:15px">npm run connectivity</td>
321
+ <td style="padding:15px">Provides a connectivity check to the AdtranMosaicDeviceManager system.</td>
322
+ </tr>
323
+ <tr>
324
+ <td style="padding:15px">npm run healthcheck</td>
325
+ <td style="padding:15px">Checks whether the configured healthcheck call works to AdtranMosaicDeviceManager.</td>
326
+ </tr>
327
+ <tr>
328
+ <td style="padding:15px">npm run basicget</td>
329
+ <td style="padding:15px">Checks whether the basic get calls works to AdtranMosaicDeviceManager.</td>
330
+ </tr>
331
+ </table>
332
+ <br>
244
333
 
245
334
  ## [Troubleshoot](./TROUBLESHOOT.md)
246
335
 
package/SUMMARY.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ## Overview
2
2
 
3
- This adapter is used to integrate the Itential Automation Platform (IAP) with the AdtranMosaicDeviceManager System. The API for AdtranMosaicDeviceManager is available at [HERE](). The adapter utilizes the AdtranMosaicDeviceManager API to provide the integrations that are deemed pertinent to IAP. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
3
+ This adapter is used to integrate the Itential Automation Platform (IAP) with the AdtranMosaicDeviceManager System. The API that was used to build the adapter for AdtranMosaicDeviceManager is usually available in the report directory of this adapter. The adapter utilizes the AdtranMosaicDeviceManager API to provide the integrations that are deemed pertinent to IAP. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
4
4
 
5
5
  >**Note**: It is possible that some integrations will be supported through the AdtranMosaicDeviceManager adapter while other integrations will not. If you need additional API calls, you can use the Update capabilities provided by the Adapter Builder or request Itential to add them if the Adapter is an Itential opensourced adapter.
6
6
 
7
- Itential provides information on all of its product adapters in the Customer Knowledge Base. Information in the [Customer Knowledge Base](https://itential.atlassian.net/servicedesk/customer/portals) is consistently maintained and goes through documentation reviews. As a result, it should be the first place to go for information.
7
+ Itential provides information on all of its product adapters in the Customer Knowledge Base. Information in the <a href="https://itential.atlassian.net/servicedesk/customer/portals" target="_blank">Customer Knowledge Base</a> is consistently maintained and goes through documentation reviews. As a result, it should be the first place to go for information.
8
8
 
9
9
  For opensourced and custom built adapters, the ReadMe is a starting point to understand what you have built, provide the information for you to be able to update the adapter, and assist you with deploying the adapter into IAP.
package/SYSTEMINFO.md ADDED
@@ -0,0 +1,11 @@
1
+ # Adtran Mosaic Device Manager
2
+
3
+ Vendor: Adtran Mosaic Device Manager
4
+ Homepage: https://Adtran Mosaic Device Manager.com/
5
+
6
+ Product: Adtran Mosaic Device Manager
7
+ Product Page: https://Adtran Mosaic Device Manager.com/
8
+
9
+ ## Introduction
10
+
11
+ ## Additional Product Documentation
package/TROUBLESHOOT.md CHANGED
@@ -1,8 +1,8 @@
1
1
  ## Troubleshoot
2
2
 
3
- Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows user 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 IAP.
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 IAP.
4
4
 
5
- User also have the option to run individual command to perform specific test
5
+ You also have the option to run individual commands to perform specific test:
6
6
 
7
7
  - `npm run healthcheck` will perform a healthcheck request of with current setting.
8
8
  - `npm run basicget` will perform some non-parameter GET request with current setting.
@@ -27,6 +27,7 @@ Go into the Itential Platform GUI and verify/update the properties
27
27
  ```text
28
28
  ping the ip address of AdtranMosaicDeviceManager server
29
29
  try telnet to the ip address port of AdtranMosaicDeviceManager
30
+ execute a curl command to the other system
30
31
  ```
31
32
 
32
33
  4. Verify the credentials provided for AdtranMosaicDeviceManager.
@@ -43,4 +44,4 @@ Go into the Itential Platform GUI and verify/update the properties
43
44
 
44
45
  ### Functional Issues
45
46
 
46
- 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 are logging into their own files.
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.