@itentialopensource/adapter-moogsoft 0.1.1 → 0.2.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.
- package/.eslintignore +1 -0
- package/.eslintrc.js +12 -12
- package/.jshintrc +0 -0
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +37 -2
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/LICENSE +0 -0
- package/PROPERTIES.md +641 -0
- package/README.md +249 -418
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +1636 -35
- package/adapterBase.js +1331 -50
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +1 -0
- package/entities/Alerts/action.json +9 -0
- package/entities/Cookbooks/action.json +3 -0
- package/entities/Integrations/action.json +3 -0
- package/entities/Licenses/action.json +1 -0
- package/entities/MaintenanceWindows/action.json +4 -0
- package/entities/MergeGroups/action.json +4 -0
- package/entities/Processes/action.json +1 -0
- package/entities/Recipes/action.json +5 -0
- package/entities/SecurityRealms/action.json +2 -0
- package/entities/Services/action.json +1 -0
- package/entities/Situations/action.json +20 -0
- package/entities/Teams/action.json +3 -0
- package/entities/Tempus/action.json +3 -0
- package/entities/Threads/action.json +4 -0
- package/entities/Tools/action.json +2 -0
- package/entities/Users/action.json +2 -0
- package/entities/Workflows/action.json +4 -0
- package/error.json +12 -0
- package/package.json +51 -25
- package/pronghorn.json +642 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +487 -10
- package/refs?service=git-upload-pack +0 -0
- package/report/Moogsoft.OpenApi3Json.json +11552 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1594225130913.json +95 -0
- package/report/updateReport1615386555916.json +95 -0
- package/report/updateReport1653652218796.json +120 -0
- package/sampleProperties.json +103 -5
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +33 -102
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +643 -110
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +9 -14
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +179 -0
- package/utils/findPath.js +74 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +4 -1
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +0 -0
- package/utils/tbScript.js +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +16 -16
- package/utils/troubleshootingAdapter.js +190 -0
- package/workflows/README.md +0 -0
- package/gl-code-quality-report.json +0 -1
package/README.md
CHANGED
|
@@ -1,324 +1,235 @@
|
|
|
1
|
-
# Moogsoft
|
|
1
|
+
# Adapter for Moogsoft
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
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
|
+
- [Additional Information](#additional-information)
|
|
18
|
+
- [Enhancements](./ENHANCE.md)
|
|
19
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
20
|
+
- [Helpful Links](#helpful-links)
|
|
21
|
+
- [Node Scripts](#node-scripts)
|
|
22
|
+
- [Troubleshoot](./TROUBLESHOOT.md)
|
|
23
|
+
- [License and Maintainers](#license-and-maintainers)
|
|
24
|
+
- [Product License](#product-license)
|
|
25
|
+
|
|
26
|
+
## [Overview](./SUMMARY.md)
|
|
2
27
|
|
|
3
|
-
|
|
28
|
+
## Versioning
|
|
4
29
|
|
|
5
|
-
|
|
30
|
+
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>.
|
|
6
31
|
|
|
7
|
-
|
|
32
|
+
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 Moogsoft works appropriately.
|
|
8
33
|
|
|
9
|
-
|
|
34
|
+
Release notes can be viewed in CHANGELOG.md or in the <a href="https://itential.atlassian.net/servicedesk/customer/portals" target="_blank">Customer Knowledge Base</a> for Itential adapters.
|
|
10
35
|
|
|
11
|
-
##
|
|
36
|
+
## Supported IAP Versions
|
|
12
37
|
|
|
13
|
-
Itential Product adapters
|
|
38
|
+
Itential Product adapters are built for particular versions of IAP and packaged with the versions they work with.
|
|
14
39
|
|
|
15
|
-
|
|
40
|
+
Itential opensource adapter as well as custom adapters built with the Itential Adapter Builder work acoss many releases of IAP. As a result, it is not often necessary to modify an adapter when upgrading IAP. If IAP has changes that impact the pronghorn.json, like adding a new required section, this will most likely require changes to all adapters when upgrading IAP.
|
|
16
41
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Release notes can be viewed in CHANGELOG.md or in the [Customer Knowledge Base](https://itential.atlassian.net/servicedesk/customer/portals) for Itential adapters.
|
|
42
|
+
Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on IAP or the IAP database schema and so it is possible these scripts could stop working in different versions of IAP. If you notify Itential of any issues, the Adapter Team will attempt to fix the scripts for newer releases of IAP.
|
|
20
43
|
|
|
21
44
|
## Getting Started
|
|
22
45
|
|
|
23
46
|
These instructions will help you get a copy of the project on your local machine for development and testing. Reading this section is also helpful for deployments as it provides you with pertinent information on prerequisites and properties.
|
|
24
47
|
|
|
25
|
-
###
|
|
48
|
+
### Helpful Background Information
|
|
26
49
|
|
|
27
|
-
|
|
50
|
+
There is adapter documentation available on the Itential Developer Site <a href="https://www.itential.com/automation-platform/integrations/adapters-resources/" target="_blank">HERE</a>. This documentation includes information and examples that are helpful for:
|
|
28
51
|
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
|
|
52
|
+
```text
|
|
53
|
+
Authentication
|
|
54
|
+
Properties
|
|
55
|
+
Code Files
|
|
56
|
+
Action Files
|
|
57
|
+
Schema Files
|
|
58
|
+
Mock Data Files
|
|
59
|
+
Linting and Testing
|
|
60
|
+
Troubleshooting
|
|
32
61
|
```
|
|
33
62
|
|
|
34
|
-
|
|
63
|
+
Others will be added over time.
|
|
64
|
+
Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
|
|
35
65
|
|
|
36
|
-
|
|
66
|
+
### Prerequisites
|
|
37
67
|
|
|
38
|
-
|
|
39
|
-
| ------- | ------- |
|
|
40
|
-
| @itentialopensource/adapter-utils | Runtime library classes for all adapters; includes request handling, connection, throttling, and translation. |
|
|
41
|
-
| ajv | Required for validation of adapter properties to integrate with Moogsoft. |
|
|
42
|
-
| fs-extra | Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality. |
|
|
43
|
-
| readline-sync | Utilized by the testRunner script that comes with the adapter; helps to test unit and integration functionality. |
|
|
68
|
+
The following is a list of required packages for installation on the system the adapter will run on:
|
|
44
69
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
```text
|
|
71
|
+
Node.js
|
|
72
|
+
npm
|
|
73
|
+
Git
|
|
74
|
+
```
|
|
48
75
|
|
|
49
|
-
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
<table border="1" class="bordered-table">
|
|
79
|
+
<tr>
|
|
80
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Package</span></th>
|
|
81
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
82
|
+
</tr>
|
|
83
|
+
<tr>
|
|
84
|
+
<td style="padding:15px">@itentialopensource/adapter-utils</td>
|
|
85
|
+
<td style="padding:15px">Runtime library classes for all adapters; includes request handling, connection, authentication throttling, and translation.</td>
|
|
86
|
+
</tr>
|
|
87
|
+
<tr>
|
|
88
|
+
<td style="padding:15px">ajv</td>
|
|
89
|
+
<td style="padding:15px">Required for validation of adapter properties to integrate with Moogsoft.</td>
|
|
90
|
+
</tr>
|
|
91
|
+
<tr>
|
|
92
|
+
<td style="padding:15px">axios</td>
|
|
93
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td style="padding:15px">commander</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">fs-extra</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">mocha</td>
|
|
105
|
+
<td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
106
|
+
</tr>
|
|
107
|
+
<tr>
|
|
108
|
+
<td style="padding:15px">mocha-param</td>
|
|
109
|
+
<td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr>
|
|
112
|
+
<td style="padding:15px">mongodb</td>
|
|
113
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
114
|
+
</tr>
|
|
115
|
+
<tr>
|
|
116
|
+
<td style="padding:15px">network-diagnostics</td>
|
|
117
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
118
|
+
</tr>
|
|
119
|
+
<tr>
|
|
120
|
+
<td style="padding:15px">nyc</td>
|
|
121
|
+
<td style="padding:15px">Testing coverage library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
122
|
+
</tr>
|
|
123
|
+
<tr>
|
|
124
|
+
<td style="padding:15px">readline-sync</td>
|
|
125
|
+
<td style="padding:15px">Utilized by the node script that comes with the adapter; helps to test unit and integration functionality.</td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td style="padding:15px">semver</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">winston</td>
|
|
133
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
134
|
+
</tr>
|
|
135
|
+
</table>
|
|
136
|
+
<br>
|
|
137
|
+
|
|
138
|
+
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.
|
|
139
|
+
|
|
140
|
+
```text
|
|
50
141
|
chai
|
|
51
142
|
eslint
|
|
52
143
|
eslint-config-airbnb-base
|
|
53
144
|
eslint-plugin-import
|
|
54
145
|
eslint-plugin-json
|
|
55
|
-
|
|
56
|
-
nyc
|
|
146
|
+
package-json-validator
|
|
57
147
|
testdouble
|
|
58
|
-
winston
|
|
59
148
|
```
|
|
60
149
|
|
|
61
|
-
###
|
|
150
|
+
### How to Install
|
|
62
151
|
|
|
63
|
-
|
|
152
|
+
1. Set up the name space location in your IAP node_modules.
|
|
64
153
|
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
154
|
+
```bash
|
|
155
|
+
cd /opt/pronghorn/current/node_modules (* could be in a different place)
|
|
156
|
+
if the @itentialopensource directory does not exist, create it:
|
|
157
|
+
mkdir @itentialopensource
|
|
68
158
|
```
|
|
69
159
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"port": 443,
|
|
80
|
-
"base_path": "/",
|
|
81
|
-
"version": "v1",
|
|
82
|
-
"cache_location": "local",
|
|
83
|
-
"save_metric": true,
|
|
84
|
-
"stub": false,
|
|
85
|
-
"protocol": "https",
|
|
86
|
-
"authentication": {
|
|
87
|
-
"auth_method": "basic user_password",
|
|
88
|
-
"username": "username",
|
|
89
|
-
"password": "password",
|
|
90
|
-
"auth_field": "header.headers.X-AUTH-TOKEN",
|
|
91
|
-
"auth_field_format": "{token}",
|
|
92
|
-
"token": "token",
|
|
93
|
-
"invalid_token_error": 401,
|
|
94
|
-
"token_timeout": 0,
|
|
95
|
-
"token_cache": "local"
|
|
96
|
-
},
|
|
97
|
-
"healthcheck": {
|
|
98
|
-
"type": "startup",
|
|
99
|
-
"frequency": 300000
|
|
100
|
-
},
|
|
101
|
-
"request": {
|
|
102
|
-
"number_redirects": 0,
|
|
103
|
-
"number_retries": 3,
|
|
104
|
-
"limit_retry_error": [401],
|
|
105
|
-
"failover_codes": [404, 405],
|
|
106
|
-
"attempt_timeout": 5000,
|
|
107
|
-
"global_request": {
|
|
108
|
-
"payload": {},
|
|
109
|
-
"uriOptions": {},
|
|
110
|
-
"addlHeaders": {},
|
|
111
|
-
"authData": {}
|
|
112
|
-
},
|
|
113
|
-
"healthcheck_on_timeout": false,
|
|
114
|
-
"return_raw": false,
|
|
115
|
-
"archiving": false
|
|
116
|
-
},
|
|
117
|
-
"ssl": {
|
|
118
|
-
"ecdhCurve": "",
|
|
119
|
-
"enabled": false,
|
|
120
|
-
"accept_invalid_cert": false,
|
|
121
|
-
"ca_file": "",
|
|
122
|
-
"key_file": "",
|
|
123
|
-
"cert_file": "",
|
|
124
|
-
"secure_protocol": "",
|
|
125
|
-
"ciphers": ""
|
|
126
|
-
},
|
|
127
|
-
"throttle": {
|
|
128
|
-
"throttle_enabled": false,
|
|
129
|
-
"number_pronghorns": 1,
|
|
130
|
-
"sync_async": "sync",
|
|
131
|
-
"max_in_queue": 1000,
|
|
132
|
-
"concurrent_max": 1,
|
|
133
|
-
"expire_timeout": 0,
|
|
134
|
-
"avg_runtime": 200
|
|
135
|
-
},
|
|
136
|
-
"proxy": {
|
|
137
|
-
"enabled": false,
|
|
138
|
-
"host": "localhost",
|
|
139
|
-
"port": 9999,
|
|
140
|
-
"protocol": "http"
|
|
141
|
-
},
|
|
142
|
-
"mongo": {
|
|
143
|
-
"host": "",
|
|
144
|
-
"port": 0,
|
|
145
|
-
"database": "",
|
|
146
|
-
"username": "",
|
|
147
|
-
"password": "",
|
|
148
|
-
"replSet": "",
|
|
149
|
-
"db_ssl": {
|
|
150
|
-
"enabled": false,
|
|
151
|
-
"accept_invalid_cert": false,
|
|
152
|
-
"ca_file": "",
|
|
153
|
-
"key_file": "",
|
|
154
|
-
"cert_file": ""
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"type": "YOUR ADAPTER CLASS"
|
|
159
|
-
}
|
|
160
|
+
2. Clone/unzip/tar the adapter into your IAP environment.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
cd \@itentialopensource
|
|
164
|
+
git clone git@gitlab.com:\@itentialopensource/adapters/adapter-moogsoft
|
|
165
|
+
or
|
|
166
|
+
unzip adapter-moogsoft.zip
|
|
167
|
+
or
|
|
168
|
+
tar -xvf adapter-moogsoft.tar
|
|
160
169
|
```
|
|
161
170
|
|
|
162
|
-
|
|
171
|
+
3. Run the adapter install script.
|
|
163
172
|
|
|
164
|
-
|
|
173
|
+
```bash
|
|
174
|
+
cd adapter-moogsoft
|
|
175
|
+
npm run adapter:install
|
|
176
|
+
```
|
|
165
177
|
|
|
166
|
-
|
|
167
|
-
| ------- | ------- |
|
|
168
|
-
| host | Required. A fully qualified domain name or IP address.|
|
|
169
|
-
| port | Required. Used to connect to the server.|
|
|
170
|
-
| base_path | Optional. Used to define part of a path that is consistent for all or most endpoints. It makes the URIs easier to use and maintain but can be overridden on individual calls. An example **base_path** might be `/rest/api`. Default is ``.|
|
|
171
|
-
| version | Optional. Used to set a global version for action endpoints. This makes it faster to update the adapter when endpoints change. As with the base-path, version can be overridden on individual endpoints. Default is ``.|
|
|
172
|
-
| cache\_location | Optional. Used to define where the adapter cache is located. The cache is used to maintain an entity list to improve performance. Storage locally is lost when the adapter is restarted. Storage in Redis is preserved upon adapter restart. Default is none which means no caching of the entity list.|
|
|
173
|
-
| save\_metric | Optional. Used to tell the adapter to save metric information (this does not impact metrics returned on calls). This allows the adapter to gather metrics over time. Metric data can be stored in a database or on the file system.|
|
|
174
|
-
| stub | Optional. Indicates whether the stub should run instead of making calls to Moogsoft (very useful during basic testing). Default is false (which means connect to Moogsoft).|
|
|
175
|
-
| protocol | Optional. Notifies the adapter whether to use HTTP or HTTPS. Default is HTTP.|
|
|
178
|
+
4. Restart IAP
|
|
176
179
|
|
|
177
|
-
|
|
180
|
+
```bash
|
|
181
|
+
systemctl restart pronghorn
|
|
182
|
+
```
|
|
178
183
|
|
|
179
|
-
|
|
184
|
+
5. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
180
185
|
|
|
181
|
-
|
|
186
|
+
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:
|
|
182
187
|
|
|
183
|
-
|
|
188
|
+
3. Install adapter dependencies and check the adapter.
|
|
184
189
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
| auth\_field\_format | Defines the format of the auth\_field. See examples below. Items enclosed in {} inform the adapter to perofrm an action prior to sending the data. It may be to replace the item with a value or it may be to encode the item. |
|
|
192
|
-
| token | Defines a static token that can be used on all requests. Only used with `static_token` as an authentication method (auth\_method).|
|
|
193
|
-
| invalid\_token\_error | Defines the HTTP error that is received when the token is invalid. Notifies the adapter to pull a new token and retry the request. Default is 401.|
|
|
194
|
-
| token\_timeout | Defines how long a token is valid. Measured in milliseconds. Once a dynamic token is no longer valid, the adapter has to pull a new token. If the token\_timeout is set to -1, the adapter will pull a token on every request to Moogsoft. If the timeout\_token is 0, the adapter will use the expiration from the token response to determine when the token is no longer valid.|
|
|
195
|
-
| token\_cache | Used to determine where the token should be stored (local memory or in Redis).|
|
|
190
|
+
```bash
|
|
191
|
+
cd adapter-moogsoft
|
|
192
|
+
npm run install
|
|
193
|
+
npm run lint:errors
|
|
194
|
+
npm run test
|
|
195
|
+
```
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
4. Restart IAP
|
|
198
198
|
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
"Token {token}",
|
|
202
|
-
"{username}:{password}",
|
|
203
|
-
"Basic {b64}{username}:{password}{/b64}"
|
|
199
|
+
```bash
|
|
200
|
+
systemctl restart pronghorn
|
|
204
201
|
```
|
|
205
202
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
The healthcheck properties defines the API that runs the healthcheck to tell the adapter that it can reach Moogsoft. There are currently three types of healthchecks.
|
|
209
|
-
|
|
210
|
-
- None - Not recommended. Adapter will not run a healthcheck. Consequently, unable to determine before making a request if the adapter can reach Moogsoft.
|
|
211
|
-
- Startup - Adapter will check for connectivity when the adapter initially comes up, but it will not check afterwards.
|
|
212
|
-
- Intermittent - Adapter will check connectivity to Moogsoft at a frequency defined in the `frequency` property.
|
|
213
|
-
|
|
214
|
-
| Property | Description |
|
|
215
|
-
| ------- | ------- |
|
|
216
|
-
| type | Required. The type of health check to run. |
|
|
217
|
-
| frequency | Required if intermittent. Defines how often the health check should run. Measured in milliseconds. Default is 300000.|
|
|
218
|
-
|
|
219
|
-
### Request Properties
|
|
220
|
-
|
|
221
|
-
The request section defines properties to help handle requests.
|
|
222
|
-
|
|
223
|
-
| Property | Description |
|
|
224
|
-
| ------- | ------- |
|
|
225
|
-
| number\_redirects | Optional. Tells the adapter that the request may be redirected and gives it a maximum number of redirects to allow before returning an error. Default is 0 - no redirects.|
|
|
226
|
-
| number\_retries | Tells the adapter how many times to retry a request that has either aborted or reached a limit error before giving up and returning an error.|
|
|
227
|
-
| limit\_retry\_error | Optional. Can be either an integer or an array. Indicates the http error status number to define that no capacity was available and, after waiting a short interval, the adapter can retry the request. If an array is provvided, the array can contain integers or strings. Strings in the array are used to define ranges (e.g. "502-506"). Default is [0].|
|
|
228
|
-
| failover\_codes | An array of error codes for which the adapter will send back a failover flag to IAP so that the Platform can attempt the action in another adapter.|
|
|
229
|
-
| attempt\_timeout | Optional. Tells how long the adapter should wait before aborting the attempt. On abort, the adapter will do one of two things: 1) return the error; or 2) if **healthcheck\_on\_timeout** is set to true, it will abort the request and run a Healthcheck until it re-establishes connectivity to Moogsoft, and then will re-attempt the request that aborted. Default is 5000 milliseconds.|
|
|
230
|
-
| global\_request | Optional. This is information that the adapter can include in all requests to the other system. This is easier to define and maintain than adding this information in either the code (adapter.js) or the action files.|
|
|
231
|
-
| global\_request -> payload | Optional. Defines any information that should be included on all requests sent to the other system that have a payload/body.|
|
|
232
|
-
| global\_request -> uriOptions | Optional. Defines any information that should be sent as untranslated query options (e.g. page, size) on all requests to the other system.|
|
|
233
|
-
| global\_request -> addlHeaders | Optioonal. Defines any headers that should be sent on all requests to the other system.|
|
|
234
|
-
| global\_request -> authData | Optional. Defines any additional authentication data used to authentice with the other system. This authData needs to be consistent on every request.|
|
|
235
|
-
| healthcheck\_on\_timeout | Required. Defines if the adapter should run a health check on timeout. If set to true, the adapter will abort the request and run a health check until it re-establishes connectivity and then it will re-attempt the request.|
|
|
236
|
-
| return\_raw | Optional. Tells the adapter whether the raw response should be returned as well as the IAP response. This is helpful when running integration tests to save mock data. It does add overhead to the response object so it is not ideal from production.|
|
|
237
|
-
| archiving | Optional flag. Default is false. It archives the request, the results and the various times (wait time, Moogsoft time and overall time) in the `adapterid_results` collection in MongoDB. Although archiving might be desirable, be sure to develop a strategy before enabling this capability. Consider how much to archive and what strategy to use for cleaning up the collection in the database so that it does not become too large, especially if the responses are large.|
|
|
238
|
-
|
|
239
|
-
### SSL Properties
|
|
240
|
-
|
|
241
|
-
The SSL section defines the properties utilized for ssl authentication with Moogsoft. SSL can work two different ways: set the `accept\_invalid\_certs` flag to true (only recommended for lab environments), or provide a `ca\_file`.
|
|
242
|
-
|
|
243
|
-
| Property | Description |
|
|
244
|
-
| ------- | ------- |
|
|
245
|
-
| enabled | If SSL is required, set to true. |
|
|
246
|
-
| accept\_invalid\_certs | Defines if the adapter should accept invalid certificates (only recommended for lab environments). Required if SSL is enabled. Default is false.|
|
|
247
|
-
| ca\_file | Defines the path name to the CA file used for SSL. If SSL is enabled and the accept invalid certifications is false, then ca_file is required.|
|
|
248
|
-
| key\_file | Defines the path name to the Key file used for SSL. The key_file may be needed for some systems but it is not required for SSL.|
|
|
249
|
-
| cert\_file | Defines the path name to the Certificate file used for SSL. The cert_file may be needed for some systems but it is not required for SSL.|
|
|
250
|
-
| secure\_protocol | Defines the protocol (e.g., SSLv3_method) to use on the SSL request.|
|
|
251
|
-
| ciphers | Required if SSL enabled. Specifies a list of SSL ciphers to use.|
|
|
252
|
-
| ecdhCurve | During testing on some Node 8 environments, you need to set `ecdhCurve` to auto. If you do not, you will receive PROTO errors when attempting the calls. This is the only usage of this property and to our knowledge it only impacts Node 8 and 9. |
|
|
253
|
-
|
|
254
|
-
### Throttle Properties
|
|
255
|
-
|
|
256
|
-
The throttle section is used when requests to Moogsoft must be queued (throttled). All of the properties in this section are optional.
|
|
257
|
-
|
|
258
|
-
| Property | Description |
|
|
259
|
-
| ------- | ------- |
|
|
260
|
-
| throttle\_enabled | Default is false. Defines if the adapter should use throttling o rnot. |
|
|
261
|
-
| number\_pronghorns | Default is 1. Defines if throttling is done in a single Itential instance or whether requests are being throttled across multiple Itential instances (minimum = 1, maximum = 20). Throttling in a single Itential instance uses an in-memory queue so there is less overhead. Throttling across multiple Itential instances requires placing the request and queue information into a shared resource (e.g. database) so that each instance can determine what is running and what is next to run. Throttling across multiple instances requires additional I/O overhead.|
|
|
262
|
-
| sync-async | This property is not used at the current time (it is for future expansion of the throttling engine).|
|
|
263
|
-
| max\_in\_queue | Represents the maximum number of requests the adapter should allow into the queue before rejecting requests (minimum = 1, maximum = 5000). This is not a limit on what the adapter can handle but more about timely responses to requests. The default is currently 1000.|
|
|
264
|
-
| concurrent\_max | Defines the number of requests the adapter can send to Moogsoft at one time (minimum = 1, maximum = 1000). The default is 1 meaning each request must be sent to Moogsoft in a serial manner. |
|
|
265
|
-
| expire\_timeout | Default is 0. Defines a graceful timeout of the request session. After a request has completed, the adapter will wait additional time prior to sending the next request. Measured in milliseconds (minimum = 0, maximum = 60000).|
|
|
266
|
-
| average\_runtime | Represents the approximate average of how long it takes Moogsoft to handle each request. Measured in milliseconds (minimum = 50, maximum = 60000). Default is 200. This metric has performance implications. If the runtime number is set too low, it puts extra burden on the CPU and memory as the requests will continually try to run. If the runtime number is set too high, requests may wait longer than they need to before running. The number does not need to be exact but your throttling strategy depends heavily on this number being within reason. If averages range from 50 to 250 milliseconds you might pick an average run-time somewhere in the middle so that when Moogsoft performance is exceptional you might run a little slower than you might like, but when it is poor you still run efficiently.|
|
|
267
|
-
|
|
268
|
-
### Proxy Properties
|
|
269
|
-
|
|
270
|
-
The proxy section defines the properties to utilize when Moogsoft is behind a proxy server.
|
|
271
|
-
|
|
272
|
-
| Property | Description |
|
|
273
|
-
| ------- | ------- |
|
|
274
|
-
| enabled | Required. Default is false. If Moogsoft is behind a proxy server, set enabled flag to true. |
|
|
275
|
-
| host | Host information for the proxy server. Required if `enabled` is true.|
|
|
276
|
-
| port | Port information for the proxy server. Required if `enabled` is true.|
|
|
277
|
-
| protocol | The protocol (i.e., http, https, etc.) used to connect to the proxy. Default is http.|
|
|
278
|
-
|
|
279
|
-
### Mongo Properties
|
|
280
|
-
|
|
281
|
-
The mongo section defines the properties used to connect to a Mongo database. Mongo can be used for throttling as well as to persist metric data. If not provided, metrics will be stored in the file system.
|
|
282
|
-
|
|
283
|
-
| Property | Description |
|
|
284
|
-
| ------- | ------- |
|
|
285
|
-
| host | Optional. Host information for the mongo server.|
|
|
286
|
-
| port | Optional. Port information for the mongo server.|
|
|
287
|
-
| database | Optional. The database for the adapter to use for its data.|
|
|
288
|
-
| username | Optional. If credentials are required to access mongo, this is the user to login as.|
|
|
289
|
-
| password | Optional. If credentials are required to access mongo, this is the password to login with.|
|
|
290
|
-
| replSet | Optional. If the database is set up to use replica sets, define it here so it can be added to the database connection.|
|
|
291
|
-
| db\_ssl | Optional. Contains information for SSL connectivity to the database.|
|
|
292
|
-
| db\_ssl -> enabled | If SSL is required, set to true.|
|
|
293
|
-
| db\_ssl -> accept_invalid_cert | Defines if the adapter should accept invalid certificates (only recommended for lab environments). Required if SSL is enabled. Default is false.|
|
|
294
|
-
| db\_ssl -> ca_file | Defines the path name to the CA file used for SSL. If SSL is enabled and the accept invalid certifications is false, then ca_file is required.|
|
|
295
|
-
| db\_ssl -> key_file | Defines the path name to the Key file used for SSL. The key_file may be needed for some systems but it is not required for SSL.|
|
|
296
|
-
| db\_ssl -> cert_file | Defines the path name to the Certificate file used for SSL. The cert_file may be needed for some systems but it is not required for SSL.|
|
|
297
|
-
|
|
298
|
-
## Testing an Itential Product Adapter
|
|
299
|
-
|
|
300
|
-
Mocha is generally used to test all Itential Product Adapters. There are unit tests as well as integration tests performed. Integration tests can generally be run as standalone using mock data and running the adapter in stub mode, or as integrated. When running integrated, every effort is made to prevent environmental failures, however there is still a possibility.
|
|
301
|
-
|
|
302
|
-
### Unit Testing
|
|
203
|
+
5. Create an adapter service instance configuration in IAP Admin Essentials GUI
|
|
303
204
|
|
|
304
|
-
|
|
205
|
+
6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
|
|
206
|
+
|
|
207
|
+
7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
305
208
|
|
|
209
|
+
### Testing
|
|
306
210
|
|
|
307
|
-
|
|
211
|
+
Mocha is generally used to test all Itential Opensource Adapters. There are unit tests as well as integration tests performed. Integration tests can generally be run as standalone using mock data and running the adapter in stub mode, or as integrated. When running integrated, every effort is made to prevent environmental failures, however there is still a possibility.
|
|
212
|
+
|
|
213
|
+
#### Unit Testing
|
|
214
|
+
|
|
215
|
+
Unit Testing includes testing basic adapter functionality as well as error conditions that are triggered in the adapter prior to any integration. There are two ways to run unit tests. The prefered method is to use the testRunner script; however, both methods are provided here.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
308
218
|
node utils/testRunner --unit
|
|
309
219
|
|
|
310
220
|
npm run test:unit
|
|
221
|
+
npm run test:baseunit
|
|
311
222
|
```
|
|
312
223
|
|
|
313
224
|
To add new unit tests, edit the `test/unit/adapterTestUnit.js` file. The tests that are already in this file should provide guidance for adding additional tests.
|
|
314
225
|
|
|
315
|
-
|
|
226
|
+
#### Integration Testing - Standalone
|
|
316
227
|
|
|
317
228
|
Standalone Integration Testing requires mock data to be provided with the entities. If this data is not provided, standalone integration testing will fail. When the adapter is set to run in stub mode (setting the stub property to true), the adapter will run through its code up to the point of making the request. It will then retrieve the mock data and return that as if it had received that data as the response from Moogsoft. It will then translate the data so that the adapter can return the expected response to the rest of the Itential software. Standalone is the default integration test.
|
|
318
229
|
|
|
319
230
|
Similar to unit testing, there are two ways to run integration tests. Using the testRunner script is better because it prevents you from having to edit the test script; it will also resets information after testing is complete so that credentials are not saved in the file.
|
|
320
231
|
|
|
321
|
-
```
|
|
232
|
+
```bash
|
|
322
233
|
node utils/testRunner
|
|
323
234
|
answer no at the first prompt
|
|
324
235
|
|
|
@@ -327,13 +238,13 @@ npm run test:integration
|
|
|
327
238
|
|
|
328
239
|
To add new integration tests, edit the `test/integration/adapterTestIntegration.js` file. The tests that are already in this file should provide guidance for adding additional tests.
|
|
329
240
|
|
|
330
|
-
|
|
241
|
+
#### Integration Testing
|
|
331
242
|
|
|
332
243
|
Integration Testing requires connectivity to Moogsoft. By using the testRunner script it prevents you from having to edit the integration test. It also resets the integration test after the test is complete so that credentials are not saved in the file.
|
|
333
244
|
|
|
334
245
|
> **Note**: These tests have been written as a best effort to make them work in most environments. However, the Adapter Builder often does not have the necessary information that is required to set up valid integration tests. For example, the order of the requests can be very important and data is often required for `creates` and `updates`. Hence, integration tests may have to be enhanced before they will work (integrate) with Moogsoft. Even after tests have been set up properly, it is possible there are environmental constraints that could result in test failures. Some examples of possible environmental issues are customizations that have been made within Moogsoft which change order dependencies or required data.
|
|
335
246
|
|
|
336
|
-
```
|
|
247
|
+
```bash
|
|
337
248
|
node utils/testRunner
|
|
338
249
|
answer yes at the first prompt
|
|
339
250
|
answer all other questions on connectivity and credentials
|
|
@@ -343,164 +254,84 @@ Test should also be written to clean up after themselves. However, it is importa
|
|
|
343
254
|
|
|
344
255
|
> **Reminder**: Do not check in code with actual credentials to systems.
|
|
345
256
|
|
|
346
|
-
##
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
```json
|
|
424
|
-
getQueue(callback)
|
|
425
|
-
Will return the requests that are waiting in the queue if throttling is enabled.
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
```json
|
|
429
|
-
addEntityCache(entityType, entities, key, callback)
|
|
430
|
-
Will take the entities and add the list to the entity cache to expedite performance.
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
```json
|
|
434
|
-
capabilityResults(results, callback)
|
|
435
|
-
Will take the results from a verifyCompatibility and put them in the format to be passed back to the Itential Platform.
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
```json
|
|
439
|
-
hasEntity(entityType, entityId, callback)
|
|
440
|
-
Verifies the adapter has the specific entity.
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
```json
|
|
444
|
-
verifyCapability(entityType, actionType, entityId, callback)
|
|
445
|
-
Verifies the adapter can perform the provided action on the specific entity.
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
```json
|
|
449
|
-
updateEntityCache()
|
|
450
|
-
Call to update the entity cache.
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
### Specific Adapter Calls
|
|
454
|
-
|
|
455
|
-
Specific adapter calls are built based on the API of the Moogsoft. The Adapter Builder creates the proper method comments for generating JS-DOC for the adapter. This is the best way to get information on the calls.
|
|
456
|
-
|
|
457
|
-
## Troubleshooting the Adapter
|
|
458
|
-
|
|
459
|
-
### Connectivity Issues
|
|
460
|
-
|
|
461
|
-
1. Verify the adapter properties are set up correctly.
|
|
462
|
-
|
|
463
|
-
```json
|
|
464
|
-
Go into the Itential Platform GUI and verify/update the properties
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
1. Verify there is connectivity between the Itential Platform Server and Moogsoft Server.
|
|
468
|
-
|
|
469
|
-
```json
|
|
470
|
-
ping the ip address of Moogsoft server
|
|
471
|
-
try telnet to the ip address port of Moogsoft
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
1. Verify the credentials provided for Moogsoft.
|
|
475
|
-
|
|
476
|
-
```json
|
|
477
|
-
login to Moogsoft using the provided credentials
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
1. Verify the API of the call utilized for Moogsoft Healthcheck.
|
|
481
|
-
|
|
482
|
-
```json
|
|
483
|
-
Go into the Itential Platform GUI and verify/update the properties
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
### Functional Issues
|
|
487
|
-
|
|
488
|
-
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.
|
|
489
|
-
|
|
490
|
-
## Contributing to Moogsoft
|
|
491
|
-
|
|
492
|
-
Please check out the [Contributing Guidelines](./CONTRIBUTING.md).
|
|
493
|
-
|
|
494
|
-
## License & Maintainers
|
|
495
|
-
|
|
496
|
-
### Maintained By
|
|
497
|
-
|
|
498
|
-
```json
|
|
499
|
-
Itential Product Adapters are maintained by the Itential Adapter Team.
|
|
500
|
-
Itential OpenSource Adapters are maintained by the community at large.
|
|
257
|
+
## [Configuration](./PROPERTIES.md)
|
|
258
|
+
|
|
259
|
+
## [Using this Adapter](./CALLS.md)
|
|
260
|
+
|
|
261
|
+
### [Authentication](./AUTH.md)
|
|
262
|
+
|
|
263
|
+
## Additional Information
|
|
264
|
+
|
|
265
|
+
### [Enhancements](./ENHANCE.md)
|
|
266
|
+
|
|
267
|
+
### [Contributing](./CONTRIBUTING.md)
|
|
268
|
+
|
|
269
|
+
### Helpful Links
|
|
270
|
+
|
|
271
|
+
<a href="https://www.itential.com/automation-platform/integrations/adapters-resources/" target="_blank">Adapter Technical Resources</a>
|
|
272
|
+
|
|
273
|
+
### Node Scripts
|
|
274
|
+
|
|
275
|
+
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.
|
|
276
|
+
|
|
277
|
+
<table border="1" class="bordered-table">
|
|
278
|
+
<tr>
|
|
279
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Run</span></th>
|
|
280
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
281
|
+
</tr>
|
|
282
|
+
<tr>
|
|
283
|
+
<td style="padding:15px">npm run adapter:install</td>
|
|
284
|
+
<td style="padding:15px">Provides an easier way to install the adapter.</td>
|
|
285
|
+
</tr>
|
|
286
|
+
<tr>
|
|
287
|
+
<td style="padding:15px">npm run adapter:checkMigrate</td>
|
|
288
|
+
<td style="padding:15px">Checks whether your adapter can and should be migrated to the latest foundation.</td>
|
|
289
|
+
</tr>
|
|
290
|
+
<tr>
|
|
291
|
+
<td style="padding:15px">npm run adapter:findPath</td>
|
|
292
|
+
<td style="padding:15px">Can be used to see if the adapter supports a particular API call.</td>
|
|
293
|
+
</tr>
|
|
294
|
+
<tr>
|
|
295
|
+
<td style="padding:15px">npm run adapter:migrate</td>
|
|
296
|
+
<td style="padding:15px">Provides an easier way to update your adapter after you download the migration zip from Itential DevSite.</td>
|
|
297
|
+
</tr>
|
|
298
|
+
<tr>
|
|
299
|
+
<td style="padding:15px">npm run adapter:update</td>
|
|
300
|
+
<td style="padding:15px">Provides an easier way to update your adapter after you download the update zip from Itential DevSite.</td>
|
|
301
|
+
</tr>
|
|
302
|
+
<tr>
|
|
303
|
+
<td style="padding:15px">npm run adapter:revert</td>
|
|
304
|
+
<td style="padding:15px">Allows you to revert after a migration or update if it resulted in issues.</td>
|
|
305
|
+
</tr>
|
|
306
|
+
<tr>
|
|
307
|
+
<td style="padding:15px">npm run troubleshoot</td>
|
|
308
|
+
<td style="padding:15px">Provides a way to troubleshoot the adapter - runs connectivity, healthcheck and basic get.</td>
|
|
309
|
+
</tr>
|
|
310
|
+
<tr>
|
|
311
|
+
<td style="padding:15px">npm run connectivity</td>
|
|
312
|
+
<td style="padding:15px">Provides a connectivity check to the Moogsoft system.</td>
|
|
313
|
+
</tr>
|
|
314
|
+
<tr>
|
|
315
|
+
<td style="padding:15px">npm run healthcheck</td>
|
|
316
|
+
<td style="padding:15px">Checks whether the configured healthcheck call works to Moogsoft.</td>
|
|
317
|
+
</tr>
|
|
318
|
+
<tr>
|
|
319
|
+
<td style="padding:15px">npm run basicget</td>
|
|
320
|
+
<td style="padding:15px">Checks whether the basic get calls works to Moogsoft.</td>
|
|
321
|
+
</tr>
|
|
322
|
+
</table>
|
|
323
|
+
<br>
|
|
324
|
+
|
|
325
|
+
## [Troubleshoot](./TROUBLESHOOT.md)
|
|
326
|
+
|
|
327
|
+
## License and Maintainers
|
|
328
|
+
|
|
329
|
+
```text
|
|
330
|
+
Itential Product Adapters are maintained by the Itential Product Team.
|
|
331
|
+
Itential OpenSource Adapters are maintained by the Itential Adapter Team and the community at large.
|
|
501
332
|
Custom Adapters are maintained by other sources.
|
|
502
333
|
```
|
|
503
334
|
|
|
504
|
-
|
|
335
|
+
## Product License
|
|
505
336
|
|
|
506
337
|
[Apache 2.0](./LICENSE)
|