@itentialopensource/adapter-efficientip_solidserver 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.
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +1465 -0
- package/CHANGELOG.md +17 -2
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +3 -148
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +235 -576
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +383 -263
- package/adapterBase.js +854 -408
- package/changelogs/changelog.md +16 -0
- package/entities/.generic/action.json +110 -5
- package/entities/.generic/schema.json +6 -1
- package/error.json +6 -0
- package/metadata.json +49 -0
- package/package.json +27 -22
- package/pronghorn.json +691 -88
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +828 -7
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +41906 -0
- package/report/adapter-openapi.yaml +23138 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653233995404.json +120 -0
- package/report/updateReport1691508450223.json +120 -0
- package/report/updateReport1692202927301.json +120 -0
- package/report/updateReport1694465845842.json +120 -0
- package/report/updateReport1698421858198.json +120 -0
- package/sampleProperties.json +153 -3
- package/test/integration/adapterTestBasicGet.js +3 -5
- package/test/integration/adapterTestConnectivity.js +91 -42
- package/test/integration/adapterTestIntegration.js +155 -106
- package/test/unit/adapterBaseTestUnit.js +388 -308
- package/test/unit/adapterTestUnit.js +484 -243
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +1 -1
- package/utils/basicGet.js +1 -14
- package/utils/checkMigrate.js +1 -1
- package/utils/entitiesToDB.js +179 -0
- package/utils/findPath.js +1 -1
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +14 -16
- package/utils/packModificationScript.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +5 -0
- package/utils/removeHooks.js +20 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +129 -53
- package/utils/tbUtils.js +125 -25
- package/utils/testRunner.js +17 -17
- package/utils/troubleshootingAdapter.js +10 -31
- package/workflows/README.md +0 -3
package/README.md
CHANGED
|
@@ -1,48 +1,75 @@
|
|
|
1
|
-
# Adapter for Efficientip_solidserver
|
|
1
|
+
# Adapter for Efficientip_solidserver
|
|
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
|
+
- [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)
|
|
26
|
+
|
|
27
|
+
## [Overview](./SUMMARY.md)
|
|
2
28
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
>**Note**: It is possible that some integrations will be supported through the Efficientip_solidserver adapter while other integrations will not.
|
|
29
|
+
## Versioning
|
|
6
30
|
|
|
7
|
-
Itential
|
|
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>.
|
|
8
32
|
|
|
9
|
-
|
|
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 Efficientip_solidserver works appropriately.
|
|
10
34
|
|
|
11
|
-
|
|
35
|
+
Release notes can be viewed in CHANGELOG.md.
|
|
12
36
|
|
|
13
|
-
|
|
37
|
+
## Supported IAP Versions
|
|
14
38
|
|
|
15
|
-
|
|
39
|
+
Itential Product adapters are built for particular versions of IAP and packaged with the versions they work with.
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
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.
|
|
18
42
|
|
|
19
|
-
|
|
43
|
+
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
44
|
|
|
21
45
|
## Getting Started
|
|
22
46
|
|
|
23
47
|
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
48
|
|
|
25
|
-
###
|
|
49
|
+
### Helpful Background Information
|
|
26
50
|
|
|
27
|
-
There is
|
|
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:
|
|
28
52
|
|
|
29
53
|
```text
|
|
30
54
|
Authentication
|
|
31
|
-
|
|
55
|
+
IAP Service Instance Configuration
|
|
32
56
|
Code Files
|
|
33
|
-
Action
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
Endpoint Configuration (Action & Schema)
|
|
58
|
+
Mock Data
|
|
59
|
+
Adapter Generic Methods
|
|
60
|
+
Headers
|
|
61
|
+
Security
|
|
36
62
|
Linting and Testing
|
|
37
|
-
|
|
63
|
+
Build an Adapter
|
|
64
|
+
Troubleshooting an Adapter
|
|
38
65
|
```
|
|
39
66
|
|
|
40
67
|
Others will be added over time.
|
|
41
|
-
Want to build a new adapter? Use the
|
|
68
|
+
Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
|
|
42
69
|
|
|
43
|
-
###
|
|
70
|
+
### Prerequisites
|
|
44
71
|
|
|
45
|
-
The following is a list of required packages for
|
|
72
|
+
The following is a list of required packages for installation on the system the adapter will run on:
|
|
46
73
|
|
|
47
74
|
```text
|
|
48
75
|
Node.js
|
|
@@ -50,26 +77,73 @@ npm
|
|
|
50
77
|
Git
|
|
51
78
|
```
|
|
52
79
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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.
|
|
81
|
+
|
|
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 Efficientip_solidserver.</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>
|
|
145
|
+
|
|
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.
|
|
73
147
|
|
|
74
148
|
```text
|
|
75
149
|
chai
|
|
@@ -77,355 +151,37 @@ eslint
|
|
|
77
151
|
eslint-config-airbnb-base
|
|
78
152
|
eslint-plugin-import
|
|
79
153
|
eslint-plugin-json
|
|
80
|
-
mocha
|
|
81
|
-
mocha-param
|
|
82
|
-
nyc
|
|
83
|
-
package-json-validator
|
|
84
154
|
testdouble
|
|
85
|
-
winston
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Creating a Workspace
|
|
89
|
-
|
|
90
|
-
The following provides a local copy of the repository along with adapter dependencies.
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
git clone git@gitlab.com:\@itentialopensource/adapters/adapter-efficientip_solidserver
|
|
94
|
-
npm install
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Adapter Properties and Descriptions
|
|
98
|
-
|
|
99
|
-
This section defines **all** the properties that are available for the adapter, including detailed information on what each property is for. If you are not using certain capabilities with this adapter, you do not need to define all of the properties. An example of how the properties for this adapter can be used with tests or IAP are provided in the **Installation** section.
|
|
100
|
-
|
|
101
|
-
```json
|
|
102
|
-
{
|
|
103
|
-
"id": "ALL ADAPTER PROPERTIES!!!",
|
|
104
|
-
"properties": {
|
|
105
|
-
"host": "system.access.resolved",
|
|
106
|
-
"port": 443,
|
|
107
|
-
"base_path": "/",
|
|
108
|
-
"version": "v1",
|
|
109
|
-
"cache_location": "local",
|
|
110
|
-
"encode_pathvars": true,
|
|
111
|
-
"save_metric": true,
|
|
112
|
-
"stub": false,
|
|
113
|
-
"protocol": "https",
|
|
114
|
-
"authentication": {
|
|
115
|
-
"auth_method": "basic user_password",
|
|
116
|
-
"username": "username",
|
|
117
|
-
"password": "password",
|
|
118
|
-
"token": "token",
|
|
119
|
-
"invalid_token_error": 401,
|
|
120
|
-
"token_timeout": 0,
|
|
121
|
-
"token_cache": "local",
|
|
122
|
-
"auth_field": "header.headers.X-AUTH-TOKEN",
|
|
123
|
-
"auth_field_format": "{token}",
|
|
124
|
-
"auth_logging": false
|
|
125
|
-
},
|
|
126
|
-
"healthcheck": {
|
|
127
|
-
"type": "startup",
|
|
128
|
-
"frequency": 300000,
|
|
129
|
-
"query_object": {}
|
|
130
|
-
},
|
|
131
|
-
"request": {
|
|
132
|
-
"number_redirects": 0,
|
|
133
|
-
"number_retries": 3,
|
|
134
|
-
"limit_retry_error": [401],
|
|
135
|
-
"failover_codes": [404, 405],
|
|
136
|
-
"attempt_timeout": 5000,
|
|
137
|
-
"global_request": {
|
|
138
|
-
"payload": {},
|
|
139
|
-
"uriOptions": {},
|
|
140
|
-
"addlHeaders": {},
|
|
141
|
-
"authData": {}
|
|
142
|
-
},
|
|
143
|
-
"healthcheck_on_timeout": false,
|
|
144
|
-
"return_raw": false,
|
|
145
|
-
"archiving": false,
|
|
146
|
-
"return_request": false
|
|
147
|
-
},
|
|
148
|
-
"ssl": {
|
|
149
|
-
"ecdhCurve": "",
|
|
150
|
-
"enabled": false,
|
|
151
|
-
"accept_invalid_cert": false,
|
|
152
|
-
"ca_file": "",
|
|
153
|
-
"key_file": "",
|
|
154
|
-
"cert_file": "",
|
|
155
|
-
"secure_protocol": "",
|
|
156
|
-
"ciphers": ""
|
|
157
|
-
},
|
|
158
|
-
"throttle": {
|
|
159
|
-
"throttle_enabled": false,
|
|
160
|
-
"number_pronghorns": 1,
|
|
161
|
-
"sync_async": "sync",
|
|
162
|
-
"max_in_queue": 1000,
|
|
163
|
-
"concurrent_max": 1,
|
|
164
|
-
"expire_timeout": 0,
|
|
165
|
-
"avg_runtime": 200,
|
|
166
|
-
"priorities": []
|
|
167
|
-
},
|
|
168
|
-
"proxy": {
|
|
169
|
-
"enabled": false,
|
|
170
|
-
"host": "localhost",
|
|
171
|
-
"port": 9999,
|
|
172
|
-
"protocol": "http",
|
|
173
|
-
"username": "",
|
|
174
|
-
"password": "",
|
|
175
|
-
},
|
|
176
|
-
"mongo": {
|
|
177
|
-
"host": "",
|
|
178
|
-
"port": 0,
|
|
179
|
-
"database": "",
|
|
180
|
-
"username": "",
|
|
181
|
-
"password": "",
|
|
182
|
-
"replSet": "",
|
|
183
|
-
"db_ssl": {
|
|
184
|
-
"enabled": false,
|
|
185
|
-
"accept_invalid_cert": false,
|
|
186
|
-
"ca_file": "",
|
|
187
|
-
"key_file": "",
|
|
188
|
-
"cert_file": ""
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
"type": "YOUR ADAPTER CLASS"
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Connection Properties
|
|
197
|
-
|
|
198
|
-
These base properties are used to connect to Efficientip_solidserver upon the adapter initially coming up. It is important to set these properties appropriately.
|
|
199
|
-
|
|
200
|
-
| Property | Description |
|
|
201
|
-
| ------- | ------- |
|
|
202
|
-
| host | Required. A fully qualified domain name or IP address.|
|
|
203
|
-
| port | Required. Used to connect to the server.|
|
|
204
|
-
| 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 ``.|
|
|
205
|
-
| 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 ``.|
|
|
206
|
-
| 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.|
|
|
207
|
-
| encode\_pathvars | Optional. Used to tell the adapter to encode path variables or not. The default behavior is to encode them so this property can b e used to stop that behavior.|
|
|
208
|
-
| 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.|
|
|
209
|
-
| stub | Optional. Indicates whether the stub should run instead of making calls to Efficientip_solidserver (very useful during basic testing). Default is false (which means connect to Efficientip_solidserver).|
|
|
210
|
-
| protocol | Optional. Notifies the adapter whether to use HTTP or HTTPS. Default is HTTP.|
|
|
211
|
-
|
|
212
|
-
A connectivity check tells IAP the adapter has loaded successfully.
|
|
213
|
-
|
|
214
|
-
### Authentication Properties
|
|
215
|
-
|
|
216
|
-
The following properties are used to define the authentication process to Efficientip_solidserver.
|
|
217
|
-
|
|
218
|
-
>**Note**: Depending on the method that is used to authenticate with Efficientip_solidserver, you may not need to set all of the authentication properties.
|
|
219
|
-
|
|
220
|
-
| Property | Description |
|
|
221
|
-
| ------- | ------- |
|
|
222
|
-
| auth\_method | Required. Used to define the type of authentication currently supported. Authentication methods currently supported are: `basic user_password`, `static_token`, `request_token`, and `no_authentication`.|
|
|
223
|
-
| username | Used to authenticate with Efficientip_solidserver on every request or when pulling a token that will be used in subsequent requests.|
|
|
224
|
-
| password | Used to authenticate with Efficientip_solidserver on every request or when pulling a token that will be used in subsequent requests.|
|
|
225
|
-
| token | Defines a static token that can be used on all requests. Only used with `static_token` as an authentication method (auth\_method).|
|
|
226
|
-
| 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.|
|
|
227
|
-
| 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 Efficientip_solidserver. 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.|
|
|
228
|
-
| token\_cache | Used to determine where the token should be stored (local memory or in Redis).|
|
|
229
|
-
| auth\_field | Defines the request field the authentication (e.g., token are basic auth credentials) needs to be placed in order for the calls to work.|
|
|
230
|
-
| 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. |
|
|
231
|
-
| auth\_logging | Setting this true will add some additional logs but this should only be done when trying to debug an issue as certain credential information may be logged out when this is true. |
|
|
232
|
-
|
|
233
|
-
#### Examples of authentication field format
|
|
234
|
-
|
|
235
|
-
```json
|
|
236
|
-
"{token}"
|
|
237
|
-
"Token {token}"
|
|
238
|
-
"{username}:{password}"
|
|
239
|
-
"Basic {b64}{username}:{password}{/b64}"
|
|
240
155
|
```
|
|
241
156
|
|
|
242
|
-
###
|
|
243
|
-
|
|
244
|
-
The healthcheck properties defines the API that runs the healthcheck to tell the adapter that it can reach Efficientip_solidserver. There are currently three types of healthchecks.
|
|
245
|
-
|
|
246
|
-
- None - Not recommended. Adapter will not run a healthcheck. Consequently, unable to determine before making a request if the adapter can reach Efficientip_solidserver.
|
|
247
|
-
- Startup - Adapter will check for connectivity when the adapter initially comes up, but it will not check afterwards.
|
|
248
|
-
- Intermittent - Adapter will check connectivity to Efficientip_solidserver at a frequency defined in the `frequency` property.
|
|
249
|
-
|
|
250
|
-
| Property | Description |
|
|
251
|
-
| ------- | ------- |
|
|
252
|
-
| type | Required. The type of health check to run. |
|
|
253
|
-
| frequency | Required if intermittent. Defines how often the health check should run. Measured in milliseconds. Default is 300000.|
|
|
254
|
-
| query_object | Query parameters to be added to the adapter healthcheck call.|
|
|
255
|
-
|
|
256
|
-
### Request Properties
|
|
257
|
-
|
|
258
|
-
The request section defines properties to help handle requests.
|
|
259
|
-
|
|
260
|
-
| Property | Description |
|
|
261
|
-
| ------- | ------- |
|
|
262
|
-
| 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.|
|
|
263
|
-
| 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.|
|
|
264
|
-
| 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].|
|
|
265
|
-
| 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.|
|
|
266
|
-
| 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 Efficientip_solidserver, and then will re-attempt the request that aborted. Default is 5000 milliseconds.|
|
|
267
|
-
| 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.|
|
|
268
|
-
| global\_request -> payload | Optional. Defines any information that should be included on all requests sent to the other system that have a payload/body.|
|
|
269
|
-
| 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.|
|
|
270
|
-
| global\_request -> addlHeaders | Optioonal. Defines any headers that should be sent on all requests to the other system.|
|
|
271
|
-
| 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.|
|
|
272
|
-
| 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.|
|
|
273
|
-
| 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.|
|
|
274
|
-
| archiving | Optional flag. Default is false. It archives the request, the results and the various times (wait time, Efficientip_solidserver 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.|
|
|
275
|
-
| return\_request | Optional flag. Default is false. Will return the actual request that is made including headers. This should only be used during debugging issues as there could be credentials in the actual request.|
|
|
276
|
-
|
|
277
|
-
### SSL Properties
|
|
278
|
-
|
|
279
|
-
The SSL section defines the properties utilized for ssl authentication with Efficientip_solidserver. SSL can work two different ways: set the `accept\_invalid\_certs` flag to true (only recommended for lab environments), or provide a `ca\_file`.
|
|
280
|
-
|
|
281
|
-
| Property | Description |
|
|
282
|
-
| ------- | ------- |
|
|
283
|
-
| enabled | If SSL is required, set to true. |
|
|
284
|
-
| accept\_invalid\_certs | Defines if the adapter should accept invalid certificates (only recommended for lab environments). Required if SSL is enabled. Default is false.|
|
|
285
|
-
| 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.|
|
|
286
|
-
| 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.|
|
|
287
|
-
| 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.|
|
|
288
|
-
| secure\_protocol | Defines the protocol (e.g., SSLv3_method) to use on the SSL request.|
|
|
289
|
-
| ciphers | Required if SSL enabled. Specifies a list of SSL ciphers to use.|
|
|
290
|
-
| 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. |
|
|
291
|
-
|
|
292
|
-
### Throttle Properties
|
|
293
|
-
|
|
294
|
-
The throttle section is used when requests to Efficientip_solidserver must be queued (throttled). All of the properties in this section are optional.
|
|
295
|
-
|
|
296
|
-
| Property | Description |
|
|
297
|
-
| ------- | ------- |
|
|
298
|
-
| throttle\_enabled | Default is false. Defines if the adapter should use throttling o rnot. |
|
|
299
|
-
| 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.|
|
|
300
|
-
| sync-async | This property is not used at the current time (it is for future expansion of the throttling engine).|
|
|
301
|
-
| 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.|
|
|
302
|
-
| concurrent\_max | Defines the number of requests the adapter can send to Efficientip_solidserver at one time (minimum = 1, maximum = 1000). The default is 1 meaning each request must be sent to Efficientip_solidserver in a serial manner. |
|
|
303
|
-
| 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).|
|
|
304
|
-
| average\_runtime | Represents the approximate average of how long it takes Efficientip_solidserver 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 Efficientip_solidserver performance is exceptional you might run a little slower than you might like, but when it is poor you still run efficiently.|
|
|
305
|
-
| priorities | An array of priorities and how to handle them in relation to the throttle queue. Array of objects that include priority value and percent of queue to put the item ex { value: 1, percent: 10 }|
|
|
306
|
-
|
|
307
|
-
### Proxy Properties
|
|
308
|
-
|
|
309
|
-
The proxy section defines the properties to utilize when Efficientip_solidserver is behind a proxy server.
|
|
310
|
-
|
|
311
|
-
| Property | Description |
|
|
312
|
-
| ------- | ------- |
|
|
313
|
-
| enabled | Required. Default is false. If Efficientip_solidserver is behind a proxy server, set enabled flag to true. |
|
|
314
|
-
| host | Host information for the proxy server. Required if `enabled` is true.|
|
|
315
|
-
| port | Port information for the proxy server. Required if `enabled` is true.|
|
|
316
|
-
| protocol | The protocol (i.e., http, https, etc.) used to connect to the proxy. Default is http.|
|
|
317
|
-
| username | If there is authentication for the proxy, provide the username here.|
|
|
318
|
-
| password | If there is authentication for the proxy, provide the password here.|
|
|
319
|
-
|
|
320
|
-
### Mongo Properties
|
|
321
|
-
|
|
322
|
-
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.
|
|
323
|
-
|
|
324
|
-
| Property | Description |
|
|
325
|
-
| ------- | ------- |
|
|
326
|
-
| host | Optional. Host information for the mongo server.|
|
|
327
|
-
| port | Optional. Port information for the mongo server.|
|
|
328
|
-
| database | Optional. The database for the adapter to use for its data.|
|
|
329
|
-
| username | Optional. If credentials are required to access mongo, this is the user to login as.|
|
|
330
|
-
| password | Optional. If credentials are required to access mongo, this is the password to login with.|
|
|
331
|
-
| replSet | Optional. If the database is set up to use replica sets, define it here so it can be added to the database connection.|
|
|
332
|
-
| db\_ssl | Optional. Contains information for SSL connectivity to the database.|
|
|
333
|
-
| db\_ssl -> enabled | If SSL is required, set to true.|
|
|
334
|
-
| 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.|
|
|
335
|
-
| 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.|
|
|
336
|
-
| 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.|
|
|
337
|
-
| 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.|
|
|
338
|
-
|
|
339
|
-
## Testing an Itential Product Adapter
|
|
340
|
-
|
|
341
|
-
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.
|
|
342
|
-
|
|
343
|
-
### Unit Testing
|
|
344
|
-
|
|
345
|
-
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.
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
```bash
|
|
349
|
-
node utils/testRunner --unit
|
|
350
|
-
|
|
351
|
-
npm run test:unit
|
|
352
|
-
npm run test:baseunit
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
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.
|
|
356
|
-
|
|
357
|
-
### Integration Testing - Standalone
|
|
358
|
-
|
|
359
|
-
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 Efficientip_solidserver. 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.
|
|
360
|
-
|
|
361
|
-
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.
|
|
362
|
-
|
|
363
|
-
```bash
|
|
364
|
-
node utils/testRunner
|
|
365
|
-
answer no at the first prompt
|
|
366
|
-
|
|
367
|
-
npm run test:integration
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
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.
|
|
371
|
-
|
|
372
|
-
### Integration Testing
|
|
373
|
-
|
|
374
|
-
Integration Testing requires connectivity to Efficientip_solidserver. 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.
|
|
375
|
-
|
|
376
|
-
> **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 Efficientip_solidserver. 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 Efficientip_solidserver which change order dependencies or required data.
|
|
377
|
-
|
|
378
|
-
```bash
|
|
379
|
-
node utils/testRunner
|
|
380
|
-
answer yes at the first prompt
|
|
381
|
-
answer all other questions on connectivity and credentials
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
Test should also be written to clean up after themselves. However, it is important to understand that in some cases this may not be possible. In addition, whenever exceptions occur, test execution may be stopped, which will prevent cleanup actions from running. It is recommended that tests be utilized in dev and test labs only.
|
|
385
|
-
|
|
386
|
-
> **Reminder**: Do not check in code with actual credentials to systems.
|
|
387
|
-
|
|
388
|
-
## Adapter Node Scripts
|
|
389
|
-
|
|
390
|
-
There are several node scripts that now accompany the adapter. These scripts are provided to make several activities easier. Each of these scripts are described below.
|
|
391
|
-
|
|
392
|
-
| Run | Description |
|
|
393
|
-
| ------- | ------- |
|
|
394
|
-
| npm run adapter:install | Provides an easier way to install the adapter.|
|
|
395
|
-
| npm run adapter:checkMigrate | Checks whether your adapter can and should be migrated to the latest foundation.|
|
|
396
|
-
| npm run adapter:findPath | Can be used to see if the adapter supports a particular API call.|
|
|
397
|
-
| npm run adapter:migrate | Provides an easier way to migrate your adapter after you download the migration zip from Itential DevSite|
|
|
398
|
-
| npm run adapter:update | Provides an easier way to update your adapter after you download the migration zip from Itential DevSite|
|
|
399
|
-
| npm run adapter:revert | Allows you to revert after a migration or update if it resulted in issues.|
|
|
400
|
-
| npm run troubleshoot | Provides a way to troubleshoot the adapter - runs connectivity, healthcheck and basic get.|
|
|
401
|
-
| npm run connectivity | Provides a connectivity check to the Efficientip_solidserver system.|
|
|
402
|
-
| npm run healthcheck | Checks whether the configured healthcheck call works to Efficientip_solidserver.|
|
|
403
|
-
| npm run basicget | Checks whether the basic get calls works to Efficientip_solidserver.|
|
|
404
|
-
|
|
405
|
-
## Installing an Itential Product Adapter
|
|
406
|
-
|
|
407
|
-
If you have App-Artifact installed in IAP, you can follow the instruction for that application to install the adapter into IAP. If not, follow these instructions.
|
|
157
|
+
### How to Install
|
|
408
158
|
|
|
409
159
|
1. Set up the name space location in your IAP node_modules.
|
|
410
160
|
|
|
411
161
|
```bash
|
|
412
|
-
cd /opt/pronghorn/current/node_modules
|
|
162
|
+
cd /opt/pronghorn/current/node_modules (* could be in a different place)
|
|
413
163
|
if the @itentialopensource directory does not exist, create it:
|
|
414
|
-
|
|
164
|
+
mkdir @itentialopensource
|
|
415
165
|
```
|
|
416
166
|
|
|
417
|
-
2. Clone the adapter into your IAP environment.
|
|
167
|
+
2. Clone/unzip/tar the adapter into your IAP environment.
|
|
418
168
|
|
|
419
169
|
```bash
|
|
420
170
|
cd \@itentialopensource
|
|
421
171
|
git clone git@gitlab.com:\@itentialopensource/adapters/adapter-efficientip_solidserver
|
|
172
|
+
or
|
|
173
|
+
unzip adapter-efficientip_solidserver.zip
|
|
174
|
+
or
|
|
175
|
+
tar -xvf adapter-efficientip_solidserver.tar
|
|
422
176
|
```
|
|
423
177
|
|
|
424
178
|
3. Run the adapter install script.
|
|
425
179
|
|
|
426
180
|
```bash
|
|
427
181
|
cd adapter-efficientip_solidserver
|
|
428
|
-
npm
|
|
182
|
+
npm install
|
|
183
|
+
npm run lint:errors
|
|
184
|
+
npm run test
|
|
429
185
|
```
|
|
430
186
|
|
|
431
187
|
4. Restart IAP
|
|
@@ -434,254 +190,157 @@ npm run adapter:install
|
|
|
434
190
|
systemctl restart pronghorn
|
|
435
191
|
```
|
|
436
192
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
If you built this as a custom adapter through the Adapter Builder, it is recommended you go through setting up a development environment and testing the adapter before installing it. There is often configuration and authentication work that is required before the adapter will work in IAP.
|
|
440
|
-
|
|
441
|
-
1. Move the adapter into the IAP `node_modules` directory.
|
|
442
|
-
|
|
443
|
-
```text
|
|
444
|
-
Depending on where your code is located, this process is different.
|
|
445
|
-
Could be a tar, move, untar
|
|
446
|
-
Could be a git clone of a repository
|
|
447
|
-
Could also be a cp -R from a coding directory
|
|
448
|
-
Adapter should be placed into: /opt/pronghorn/current/node_modules/\@itentialopensource
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
2. Follow Steps 3-4 (above) to install an Itential adapter to load your properties, dependencies and restart IAP.
|
|
452
|
-
|
|
453
|
-
## Using this Adapter
|
|
454
|
-
|
|
455
|
-
The `adapter.js` file contains the calls the adapter makes available to the rest of the Itential Platform. The API detailed for these calls should be available through JSDOC. The following is a brief summary of the calls.
|
|
456
|
-
|
|
457
|
-
### Generic Adapter Calls
|
|
193
|
+
5. Create an adapter service instance configuration in IAP Admin Essentials GUI
|
|
458
194
|
|
|
459
|
-
|
|
460
|
-
```js
|
|
461
|
-
connect()
|
|
462
|
-
```
|
|
195
|
+
6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
|
|
463
196
|
|
|
464
|
-
|
|
465
|
-
```js
|
|
466
|
-
healthCheck(callback)
|
|
467
|
-
```
|
|
197
|
+
7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
468
198
|
|
|
469
|
-
The `refreshProperties` call provides the adapter the ability to accept property changes without having to restart the adapter.
|
|
470
|
-
```js
|
|
471
|
-
refreshProperties(properties)
|
|
472
|
-
```
|
|
473
199
|
|
|
474
|
-
|
|
475
|
-
```js
|
|
476
|
-
encryptProperty(property, technique, callback)
|
|
477
|
-
```
|
|
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:
|
|
478
201
|
|
|
479
|
-
|
|
480
|
-
```js
|
|
481
|
-
addEntityCache(entityType, entities, key, callback)
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
The `capabilityResults` call will take the results from a verifyCompatibility and put them in the format to be passed back to the Itential Platform.
|
|
485
|
-
```js
|
|
486
|
-
capabilityResults(results, callback)
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
The `hasEntity` call verifies the adapter has the specific entity.
|
|
490
|
-
```js
|
|
491
|
-
hasEntity(entityType, entityId, callback)
|
|
492
|
-
```
|
|
493
|
-
|
|
494
|
-
The `verifyCapability` call verifies the adapter can perform the provided action on the specific entity.
|
|
495
|
-
```js
|
|
496
|
-
verifyCapability(entityType, actionType, entityId, callback)
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
The `updateEntityCache` call will update the entity cache.
|
|
500
|
-
```js
|
|
501
|
-
updateEntityCache()
|
|
502
|
-
```
|
|
503
|
-
|
|
504
|
-
The `updateAdapterConfiguration` call provides the ability to update the adapter configuration from IAP - includes actions, schema, mockdata and other configurations.
|
|
505
|
-
```js
|
|
506
|
-
updateAdapterConfiguration(configFile, changes, entity, type, action, callback)
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
The `suspend` call provides the ability to suspend the adapter and either have requests rejected or put into a queue to be processed after the adapter is resumed.
|
|
510
|
-
```js
|
|
511
|
-
suspend(mode, callback)
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
The `unsuspend` call provides the ability to resume a suspended adapter. Any requests in queue will be processed before new requests.
|
|
515
|
-
```js
|
|
516
|
-
unsuspend(callback)
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
The `findPath` call provides the ability to see if a particular API path is supported by the adapter.
|
|
520
|
-
```js
|
|
521
|
-
findPath(apiPath, callback)
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
The `troubleshoot` call can be used to check on the performance of the adapter - it checks connectivity, healthcheck and basic get calls.
|
|
525
|
-
```js
|
|
526
|
-
troubleshoot(props, persistFlag, adapter, callback)
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
The `runHealthcheck` call will return the results of a healthcheck.
|
|
530
|
-
```js
|
|
531
|
-
runHealthcheck(adapter, callback)
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
The `runConnectivity` call will return the results of a connectivity check.
|
|
535
|
-
```js
|
|
536
|
-
runConnectivity(callback)
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
The `runBasicGet` call will return the results of running basic get API calls.
|
|
540
|
-
```js
|
|
541
|
-
runBasicGet(callback)
|
|
542
|
-
```
|
|
543
|
-
|
|
544
|
-
The `getQueue` call will return the requests that are waiting in the queue if throttling is enabled.
|
|
545
|
-
```js
|
|
546
|
-
getQueue(callback)
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
### Specific Adapter Calls
|
|
550
|
-
|
|
551
|
-
Specific adapter calls are built based on the API of the Efficientip_solidserver. 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.
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
## Extending/Enhancing the Adapter
|
|
555
|
-
|
|
556
|
-
### Adding a Second Instance of an Adapter
|
|
557
|
-
|
|
558
|
-
You can add a second instance of this adapter without adding new code on the file system. To do this go into the IAP Admin Essentials and add a new service config for this adapter. The two instances of the adapter should have unique ids. In addition, they should point to different instances of the other system. For example, they should be configured to talk to different hosts.
|
|
559
|
-
|
|
560
|
-
### Adding Adapter Calls
|
|
561
|
-
|
|
562
|
-
There are multiple ways to add calls to an existing adapter.
|
|
563
|
-
|
|
564
|
-
The easiest way would be to use the Adapter Builder update process. This process takes in a Swagger or OpenAPI document, allows you to select the calls you want to add and then generates a zip file that can be used to update the adapter. Once you have the zip file simple put it in the adapter direcctory and execute `npm run adapter:update`.
|
|
202
|
+
3. Install adapter dependencies and check the adapter.
|
|
565
203
|
|
|
566
204
|
```bash
|
|
567
|
-
mv updatePackage.zip adapter-efficientip_solidserver
|
|
568
205
|
cd adapter-efficientip_solidserver
|
|
569
|
-
npm run adapter:
|
|
206
|
+
npm run adapter:install
|
|
570
207
|
```
|
|
571
208
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
If you want to manually update the adapter that can also be done the key thing is to make sure you update all of the right files. Within the entities directory you will find 1 or more entities. You can create a new entity or add to an existing entity. Each entity has an action.json file, any new call will need to be put in the action.json file. It will also need to be added to the enum for the ph_request_type in the appropriate schema files. Once this configuration is complete you will need to add the call to the adapter.js file and in order to make it available as a workflow task in IAP, it should also be added to the pronghorn.json file. You can optionally add it to the unit and integration test files. There is more information on how to work on each of these files in the Adapter Technical Resources on Dev Site [HERE](https://developer.itential.io/adapters-resources/)
|
|
209
|
+
4. Restart IAP
|
|
575
210
|
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
* entities/<entity>/action.json: add an action
|
|
579
|
-
* entities/<entity>/schema.json (or the schema defined on the action): add action to the enum for ph_request_type
|
|
580
|
-
* adapter.js: add the new method and make sure it calls the proper entity and action
|
|
581
|
-
* pronghorn.json: add the new method
|
|
582
|
-
* test/unit/adapterTestUnit.js (optional but best practice): add unit test(s) - function is there, any required parameters error when not passed in
|
|
583
|
-
* test/integration/adapterTestIntegration.js (optional but best practice): add integration test
|
|
211
|
+
```bash
|
|
212
|
+
systemctl restart pronghorn
|
|
584
213
|
```
|
|
585
214
|
|
|
586
|
-
|
|
215
|
+
5. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
587
216
|
|
|
588
|
-
While changing adapter properties is done in the service instance configuration section of IAP, adding properties has to be done in the adapter. To add a property you should edit the propertiesSchema.json with the proper information for the property. In addition, you should modify the sampleProperties to have the new property in it.
|
|
589
217
|
|
|
590
|
-
|
|
591
|
-
Files to update
|
|
592
|
-
* propertiesSchema.json: add the new property and how it is defined
|
|
593
|
-
* sampleProperties: add the new property with a default value
|
|
594
|
-
* test/unit/adapterTestUnit.js (optional but best practice): add the property to the global properties
|
|
595
|
-
* test/integration/adapterTestIntegration.js (optional but best practice): add the property to the global properties
|
|
596
|
-
```
|
|
597
|
-
|
|
598
|
-
### Changing Adapter Authentication
|
|
218
|
+
### Testing
|
|
599
219
|
|
|
600
|
-
|
|
220
|
+
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.
|
|
601
221
|
|
|
602
|
-
|
|
603
|
-
Files to update
|
|
604
|
-
* entities/<entity>/action.json: change the getToken action as needed
|
|
605
|
-
* entities/<entity>/schemaTokenReq.json: add input parameters (external name is name in other system)
|
|
606
|
-
* entities/<entity>/schemaTokenResp.json: add response parameters (external name is name in other system)
|
|
607
|
-
* propertiesSchema.json: add any new property and how it is defined
|
|
608
|
-
* sampleProperties: add any new property with a default value
|
|
609
|
-
* test/unit/adapterTestUnit.js (optional but best practice): add the property to the global properties
|
|
610
|
-
* test/integration/adapterTestIntegration.js (optional but best practice): add the property to the global properties
|
|
611
|
-
```
|
|
222
|
+
#### Unit Testing
|
|
612
223
|
|
|
613
|
-
|
|
224
|
+
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.
|
|
614
225
|
|
|
615
|
-
|
|
226
|
+
```bash
|
|
227
|
+
node utils/testRunner --unit
|
|
616
228
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
* test/integration/adapterTestIntegration.js: add better data for the create and update calls so that they will not fail.
|
|
229
|
+
npm run test:unit
|
|
230
|
+
npm run test:baseunit
|
|
620
231
|
```
|
|
621
232
|
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
## Troubleshooting the Adapter
|
|
625
|
-
|
|
626
|
-
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.
|
|
627
|
-
|
|
628
|
-
User also have the option to run individual command to perform specific test
|
|
233
|
+
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.
|
|
629
234
|
|
|
630
|
-
|
|
631
|
-
- `npm run basicget` will perform some non-parameter GET request with current setting.
|
|
632
|
-
- `npm run connectivity` will perform networking diagnostics of the adatper endpoint.
|
|
235
|
+
#### Integration Testing - Standalone
|
|
633
236
|
|
|
634
|
-
|
|
237
|
+
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 Efficientip_solidserver. 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.
|
|
635
238
|
|
|
636
|
-
|
|
239
|
+
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.
|
|
637
240
|
|
|
638
241
|
```bash
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
2. Verify the adapter properties are set up correctly.
|
|
242
|
+
node utils/testRunner
|
|
243
|
+
answer no at the first prompt
|
|
643
244
|
|
|
644
|
-
|
|
645
|
-
Go into the Itential Platform GUI and verify/update the properties
|
|
245
|
+
npm run test:integration
|
|
646
246
|
```
|
|
647
247
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
```text
|
|
651
|
-
ping the ip address of Efficientip_solidserver server
|
|
652
|
-
try telnet to the ip address port of Efficientip_solidserver
|
|
653
|
-
```
|
|
248
|
+
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.
|
|
654
249
|
|
|
655
|
-
|
|
250
|
+
#### Integration Testing
|
|
656
251
|
|
|
657
|
-
|
|
658
|
-
login to Efficientip_solidserver using the provided credentials
|
|
659
|
-
```
|
|
252
|
+
Integration Testing requires connectivity to Efficientip_solidserver. 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.
|
|
660
253
|
|
|
661
|
-
|
|
254
|
+
> **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 Efficientip_solidserver. 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 Efficientip_solidserver which change order dependencies or required data.
|
|
662
255
|
|
|
663
|
-
```
|
|
664
|
-
|
|
256
|
+
```bash
|
|
257
|
+
node utils/testRunner
|
|
258
|
+
answer yes at the first prompt
|
|
259
|
+
answer all other questions on connectivity and credentials
|
|
665
260
|
```
|
|
666
261
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
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.
|
|
670
|
-
|
|
671
|
-
## Contributing to Efficientip_solidserver
|
|
672
|
-
|
|
673
|
-
Please check out the [Contributing Guidelines](./CONTRIBUTING.md).
|
|
262
|
+
Test should also be written to clean up after themselves. However, it is important to understand that in some cases this may not be possible. In addition, whenever exceptions occur, test execution may be stopped, which will prevent cleanup actions from running. It is recommended that tests be utilized in dev and test labs only.
|
|
674
263
|
|
|
675
|
-
|
|
264
|
+
> **Reminder**: Do not check in code with actual credentials to systems.
|
|
676
265
|
|
|
677
|
-
|
|
266
|
+
## [Configuration](./PROPERTIES.md)
|
|
267
|
+
|
|
268
|
+
## [Using this Adapter](./CALLS.md)
|
|
269
|
+
|
|
270
|
+
### [Authentication](./AUTH.md)
|
|
271
|
+
|
|
272
|
+
## Additional Information
|
|
273
|
+
|
|
274
|
+
### [Enhancements](./ENHANCE.md)
|
|
275
|
+
|
|
276
|
+
### [Contributing](./CONTRIBUTING.md)
|
|
277
|
+
|
|
278
|
+
### Helpful Links
|
|
279
|
+
|
|
280
|
+
<a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a>
|
|
281
|
+
|
|
282
|
+
### Node Scripts
|
|
283
|
+
|
|
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.
|
|
285
|
+
|
|
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 Efficientip_solidserver 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 Efficientip_solidserver.</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 Efficientip_solidserver.</td>
|
|
330
|
+
</tr>
|
|
331
|
+
</table>
|
|
332
|
+
<br>
|
|
333
|
+
|
|
334
|
+
## [Troubleshoot](./TROUBLESHOOT.md)
|
|
335
|
+
|
|
336
|
+
## License and Maintainers
|
|
678
337
|
|
|
679
338
|
```text
|
|
680
|
-
Itential Product Adapters are maintained by the Itential
|
|
681
|
-
Itential OpenSource Adapters are maintained by the community at large.
|
|
339
|
+
Itential Product Adapters are maintained by the Itential Product Team.
|
|
340
|
+
Itential OpenSource Adapters are maintained by the Itential Adapter Team and the community at large.
|
|
682
341
|
Custom Adapters are maintained by other sources.
|
|
683
342
|
```
|
|
684
343
|
|
|
685
|
-
|
|
344
|
+
## Product License
|
|
686
345
|
|
|
687
346
|
[Apache 2.0](./LICENSE)
|