@itentialopensource/adapter-winston_syslog 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +18 -0
- package/.jshintrc +3 -0
- package/CHANGELOG.md +9 -0
- package/LICENSE +201 -0
- package/README.md +285 -0
- package/adapter.js +250 -0
- package/adapterBase.js +1782 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/error.json +190 -0
- package/package.json +87 -0
- package/pronghorn.json +93 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1243 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/sampleProperties.json +60 -0
- package/test/integration/adapterTestIntegration.js +329 -0
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +1207 -0
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +146 -0
- 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 +35 -0
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +30 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/tbScript.js +184 -0
- package/utils/tbUtils.js +469 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +190 -0
- package/workflows/README.md +3 -0
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
browser: true,
|
|
4
|
+
es6: true,
|
|
5
|
+
node: true
|
|
6
|
+
},
|
|
7
|
+
extends: 'airbnb-base',
|
|
8
|
+
plugins: [
|
|
9
|
+
'json'
|
|
10
|
+
],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
sourceType: 'module'
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
'max-len': 'warn',
|
|
16
|
+
'comma-dangle': ['error', 'never']
|
|
17
|
+
}
|
|
18
|
+
};
|
package/.jshintrc
ADDED
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2019 Itential, LLC
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# Adapter for Winston Syslog
|
|
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)
|
|
27
|
+
|
|
28
|
+
## Versioning
|
|
29
|
+
|
|
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>.
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
## Supported IAP Versions
|
|
35
|
+
|
|
36
|
+
Itential Product adapters are built for particular versions of IAP and packaged with the versions they work with.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
## Getting Started
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
### Helpful Background Information
|
|
47
|
+
|
|
48
|
+
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:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
Authentication
|
|
52
|
+
Properties
|
|
53
|
+
Code Files
|
|
54
|
+
Action Files
|
|
55
|
+
Schema Files
|
|
56
|
+
Mock Data Files
|
|
57
|
+
Linting and Testing
|
|
58
|
+
Troubleshooting
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Others will be added over time.
|
|
62
|
+
Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
|
|
63
|
+
|
|
64
|
+
### Prerequisites
|
|
65
|
+
|
|
66
|
+
The following is a list of required packages for installation on the system the adapter will run on:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
Node.js
|
|
70
|
+
npm
|
|
71
|
+
Git
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The following list of packages are required for Itential opensource adapters or custom adapters that have been built utilizing the Itential Adapter Builder. You can install these packages by running npm install inside the adapter directory.
|
|
75
|
+
|
|
76
|
+
<table border="1" class="bordered-table">
|
|
77
|
+
<tr>
|
|
78
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Package</span></th>
|
|
79
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
80
|
+
</tr>
|
|
81
|
+
<tr>
|
|
82
|
+
<td style="padding:15px">@itentialopensource/adapter-utils</td>
|
|
83
|
+
<td style="padding:15px">Runtime library classes for all adapters; includes request handling, connection, authentication throttling, and translation.</td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td style="padding:15px">ajv</td>
|
|
87
|
+
<td style="padding:15px">Required for validation of adapter properties to integrate with Winsotn Syslog.</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td style="padding:15px">axios</td>
|
|
91
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
92
|
+
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td style="padding:15px">commander</td>
|
|
95
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
96
|
+
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td style="padding:15px">fs-extra</td>
|
|
99
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td style="padding:15px">mocha</td>
|
|
103
|
+
<td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
104
|
+
</tr>
|
|
105
|
+
<tr>
|
|
106
|
+
<td style="padding:15px">mocha-param</td>
|
|
107
|
+
<td style="padding:15px">Testing library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
108
|
+
</tr>
|
|
109
|
+
<tr>
|
|
110
|
+
<td style="padding:15px">mongodb</td>
|
|
111
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td style="padding:15px">network-diagnostics</td>
|
|
115
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td style="padding:15px">nyc</td>
|
|
119
|
+
<td style="padding:15px">Testing coverage library that is utilized by some of the node scripts that are included with the adapter.</td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td style="padding:15px">readline-sync</td>
|
|
123
|
+
<td style="padding:15px">Utilized by the node script that comes with the adapter; helps to test unit and integration functionality.</td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td style="padding:15px">semver</td>
|
|
127
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
128
|
+
</tr>
|
|
129
|
+
<tr>
|
|
130
|
+
<td style="padding:15px">winston</td>
|
|
131
|
+
<td style="padding:15px">Utilized by the node scripts that are included with the adapter; helps to build and extend the functionality.</td>
|
|
132
|
+
</tr>
|
|
133
|
+
</table>
|
|
134
|
+
<br>
|
|
135
|
+
|
|
136
|
+
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.
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
chai
|
|
140
|
+
eslint
|
|
141
|
+
eslint-config-airbnb-base
|
|
142
|
+
eslint-plugin-import
|
|
143
|
+
eslint-plugin-json
|
|
144
|
+
package-json-validator
|
|
145
|
+
testdouble
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### How to Install
|
|
149
|
+
|
|
150
|
+
1. Set up the name space location in your IAP node_modules.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cd /opt/pronghorn/current/node_modules (* could be in a different place)
|
|
154
|
+
if the @itentialopensource directory does not exist, create it:
|
|
155
|
+
mkdir @itentialopensource
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
2. Clone/unzip/tar the adapter into your IAP environment.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
cd \@itentialopensource
|
|
162
|
+
git clone git@gitlab.com:\@itentialopensource/adapters/adapter-winston_syslog
|
|
163
|
+
or
|
|
164
|
+
unzip adapter-winston_syslog.zip
|
|
165
|
+
or
|
|
166
|
+
tar -xvf adapter-winston_syslog.tar
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
3. Run the adapter install script.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
cd adapter-winston_syslog
|
|
173
|
+
npm run adapter:install
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
3. Install adapter dependencies and check the adapter.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
cd adapter-winston_syslog
|
|
180
|
+
npm install
|
|
181
|
+
npm run lint:errors
|
|
182
|
+
npm run test
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
4. Restart IAP
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
systemctl restart pronghorn
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
5. Create an adapter service instance configuration in IAP Admin Essentials GUI
|
|
192
|
+
|
|
193
|
+
6. Copy the properties from the sampleProperties.json and paste them into the service instance configuration in the inner/second properties field.
|
|
194
|
+
|
|
195
|
+
7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
196
|
+
|
|
197
|
+
### Testing
|
|
198
|
+
|
|
199
|
+
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.
|
|
200
|
+
|
|
201
|
+
#### Unit Testing
|
|
202
|
+
|
|
203
|
+
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.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
node utils/testRunner --unit
|
|
207
|
+
|
|
208
|
+
npm run test:unit
|
|
209
|
+
npm run test:baseunit
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
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.
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
## Configuration
|
|
216
|
+
|
|
217
|
+
The critical information required for this adapter to work as expected are the host, port, and log protocol (udp4, tcp4, etc.). These options ensure we can connect to the correct syslog server. An optional property is minLogLevel. This will tell the adapter which log levels to send logs at. If this is not set, it will default to info and above. Note that the options in the task will not change when this is set, so the user will need to be careful and only select the appropriate log levels. An example of what these properties might look like are included in the sampleProperties.json file. Note that the healthcheck type for this adapter should always be set to `none`, as there is no way to ensure connectivity over UDP which is the mechanism for writing to the syslog.
|
|
218
|
+
|
|
219
|
+
## Using this Adapter
|
|
220
|
+
|
|
221
|
+
This adapter has one task, `postLog` that can be used to post a log to the the server whose details have been provided in the adapter's properties. This task takes in three arguments: severity, facility and the message to send.
|
|
222
|
+
|
|
223
|
+
## Additional Information
|
|
224
|
+
|
|
225
|
+
### [Enhancements](./ENHANCE.md)
|
|
226
|
+
|
|
227
|
+
### [Contributing](./CONTRIBUTING.md)
|
|
228
|
+
|
|
229
|
+
### Helpful Links
|
|
230
|
+
|
|
231
|
+
<a href="https://www.itential.com/automation-platform/integrations/adapters-resources/" target="_blank">Adapter Technical Resources</a>
|
|
232
|
+
|
|
233
|
+
### Node Scripts
|
|
234
|
+
|
|
235
|
+
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.
|
|
236
|
+
|
|
237
|
+
<table border="1" class="bordered-table">
|
|
238
|
+
<tr>
|
|
239
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Run</span></th>
|
|
240
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td style="padding:15px">npm run adapter:install</td>
|
|
244
|
+
<td style="padding:15px">Provides an easier way to install the adapter.</td>
|
|
245
|
+
</tr>
|
|
246
|
+
<tr>
|
|
247
|
+
<td style="padding:15px">npm run adapter:checkMigrate</td>
|
|
248
|
+
<td style="padding:15px">Checks whether your adapter can and should be migrated to the latest foundation.</td>
|
|
249
|
+
</tr>
|
|
250
|
+
<tr>
|
|
251
|
+
<td style="padding:15px">npm run adapter:findPath</td>
|
|
252
|
+
<td style="padding:15px">Can be used to see if the adapter supports a particular API call.</td>
|
|
253
|
+
</tr>
|
|
254
|
+
<tr>
|
|
255
|
+
<td style="padding:15px">npm run adapter:migrate</td>
|
|
256
|
+
<td style="padding:15px">Provides an easier way to update your adapter after you download the migration zip from Itential DevSite.</td>
|
|
257
|
+
</tr>
|
|
258
|
+
<tr>
|
|
259
|
+
<td style="padding:15px">npm run adapter:update</td>
|
|
260
|
+
<td style="padding:15px">Provides an easier way to update your adapter after you download the update zip from Itential DevSite.</td>
|
|
261
|
+
</tr>
|
|
262
|
+
<tr>
|
|
263
|
+
<td style="padding:15px">npm run adapter:revert</td>
|
|
264
|
+
<td style="padding:15px">Allows you to revert after a migration or update if it resulted in issues.</td>
|
|
265
|
+
</tr>
|
|
266
|
+
<tr>
|
|
267
|
+
<td style="padding:15px">npm run healthcheck</td>
|
|
268
|
+
<td style="padding:15px">Checks whether the configured healthcheck call works to Winston Syslog.</td>
|
|
269
|
+
</tr>
|
|
270
|
+
</table>
|
|
271
|
+
<br>
|
|
272
|
+
|
|
273
|
+
## [Troubleshoot](./TROUBLESHOOT.md)
|
|
274
|
+
|
|
275
|
+
## License and Maintainers
|
|
276
|
+
|
|
277
|
+
```text
|
|
278
|
+
Itential Product Adapters are maintained by the Itential Product Team.
|
|
279
|
+
Itential OpenSource Adapters are maintained by the Itential Adapter Team and the community at large.
|
|
280
|
+
Custom Adapters are maintained by other sources.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Product License
|
|
284
|
+
|
|
285
|
+
[Apache 2.0](./LICENSE)
|