@itentialopensource/adapter-selector_ai 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.jshintrc +3 -0
- package/AUTH.md +39 -0
- package/BROKER.md +211 -0
- package/CALLS.md +405 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +13 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +661 -0
- package/README.md +344 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +14 -0
- package/TAB1.md +8 -0
- package/TAB2.md +314 -0
- package/TROUBLESHOOT.md +56 -0
- package/UTILITIES.md +473 -0
- package/adapter.js +4039 -0
- package/adapterBase.js +1488 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/InventorySchemaCreation/action.json +24 -0
- package/entities/InventorySchemaCreation/schema.json +19 -0
- package/entities/InventorySchemaDelete/action.json +24 -0
- package/entities/InventorySchemaDelete/schema.json +19 -0
- package/entities/InventorySchemaDeleteType/action.json +24 -0
- package/entities/InventorySchemaDeleteType/schema.json +19 -0
- package/entities/InventorySchemaFileDownload/action.json +24 -0
- package/entities/InventorySchemaFileDownload/schema.json +19 -0
- package/entities/InventorySchemaFileUpload/action.json +24 -0
- package/entities/InventorySchemaFileUpload/schema.json +19 -0
- package/entities/InventorySchemaUpdate/action.json +24 -0
- package/entities/InventorySchemaUpdate/schema.json +19 -0
- package/entities/InventoryV2SchemaDeleteAll/action.json +24 -0
- package/entities/InventoryV2SchemaDeleteAll/schema.json +19 -0
- package/entities/InventoryV2SchemaDeleteType/action.json +24 -0
- package/entities/InventoryV2SchemaDeleteType/schema.json +19 -0
- package/entities/InventoryV2SchemaUpdate/action.json +24 -0
- package/entities/InventoryV2SchemaUpdate/schema.json +19 -0
- package/entities/InventoryV2SchemaUpload/action.json +24 -0
- package/entities/InventoryV2SchemaUpload/schema.json +19 -0
- package/entities/MetastoreInventoryBulkDataUpload/action.json +24 -0
- package/entities/MetastoreInventoryBulkDataUpload/schema.json +19 -0
- package/entities/MetastoreInventoryCSVDataUpload/action.json +24 -0
- package/entities/MetastoreInventoryCSVDataUpload/schema.json +19 -0
- package/entities/MetastoreInventoryCsvFileExport/action.json +25 -0
- package/entities/MetastoreInventoryCsvFileExport/schema.json +19 -0
- package/entities/MetastoreInventoryDataDelete/action.json +24 -0
- package/entities/MetastoreInventoryDataDelete/schema.json +19 -0
- package/entities/MetastoreInventoryDataDownload/action.json +46 -0
- package/entities/MetastoreInventoryDataDownload/schema.json +20 -0
- package/entities/MetastoreInventoryDataEdit/action.json +24 -0
- package/entities/MetastoreInventoryDataEdit/schema.json +19 -0
- package/entities/MetastoreInventoryDataUpload/action.json +24 -0
- package/entities/MetastoreInventoryDataUpload/schema.json +19 -0
- package/entities/MetastoreInventoryFilesExport/action.json +24 -0
- package/entities/MetastoreInventoryFilesExport/schema.json +19 -0
- package/entities/MetastoreInventoryFilesImport/action.json +24 -0
- package/entities/MetastoreInventoryFilesImport/schema.json +30 -0
- package/entities/MetastoreInventoryItems/action.json +25 -0
- package/entities/MetastoreInventoryItems/schema.json +19 -0
- package/entities/MetastoreInventoryNameDelete/action.json +24 -0
- package/entities/MetastoreInventoryNameDelete/schema.json +19 -0
- package/entities/MetastoreInventoryNameUpdate/action.json +24 -0
- package/entities/MetastoreInventoryNameUpdate/schema.json +19 -0
- package/entities/MetastoreInventoryNameUpload/action.json +24 -0
- package/entities/MetastoreInventoryNameUpload/schema.json +19 -0
- package/entities/MetastoreInventoryNamesDownload/action.json +25 -0
- package/entities/MetastoreInventoryNamesDownload/schema.json +19 -0
- package/entities/MetastoreInventorySchemaGet/action.json +25 -0
- package/entities/MetastoreInventorySchemaGet/schema.json +19 -0
- package/entities/MetastoreInventorySystem/action.json +130 -0
- package/entities/MetastoreInventorySystem/schema.json +24 -0
- package/entities/MetastoreV2InventorySchemaGet/action.json +25 -0
- package/entities/MetastoreV2InventorySchemaGet/schema.json +19 -0
- package/error.json +190 -0
- package/metadata.json +58 -0
- package/package.json +77 -0
- package/pronghorn.json +2508 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1635 -0
- package/report/adapterInfo.json +10 -0
- package/report/auto-adapter-openapi.json +1330 -0
- package/report/creationReport.json +765 -0
- package/report/metastore-inventory-manager.yaml-OpenApi3Json.json +2366 -0
- package/sampleProperties.json +260 -0
- package/test/integration/adapterTestBasicGet.js +117 -0
- package/test/integration/adapterTestConnectivity.js +117 -0
- package/test/integration/adapterTestIntegration.js +1295 -0
- package/test/unit/adapterBaseTestUnit.js +1626 -0
- package/test/unit/adapterTestUnit.js +2288 -0
- package/utils/adapterInfo.js +156 -0
- package/utils/argParser.js +44 -0
- package/utils/checkMigrate.js +102 -0
- package/utils/entitiesToDB.js +190 -0
- package/utils/findPath.js +74 -0
- package/utils/logger.js +26 -0
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +153 -0
- package/utils/mongoDbConnection.js +79 -0
- package/utils/mongoUtils.js +162 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/taskMover.js +308 -0
- package/utils/tbScript.js +103 -0
- package/utils/tbUtils.js +347 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +177 -0
- package/utils/updateAdapterConfig.js +158 -0
package/CALLS.md
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
## Using this Adapter
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
### Generic Adapter Calls
|
|
6
|
+
|
|
7
|
+
These are adapter methods that Itential Platform or you might use. There are some other methods not shown here that might be used for internal adapter functionality.
|
|
8
|
+
|
|
9
|
+
<table border="1" class="bordered-table">
|
|
10
|
+
<tr>
|
|
11
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
|
|
12
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
13
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
|
|
14
|
+
</tr>
|
|
15
|
+
<tr>
|
|
16
|
+
<td style="padding:15px">connect()</td>
|
|
17
|
+
<td style="padding:15px">This call is run when the Adapter is first loaded by he Itential Platform. It validates the properties have been provided correctly.</td>
|
|
18
|
+
<td style="padding:15px">No</td>
|
|
19
|
+
</tr>
|
|
20
|
+
<tr>
|
|
21
|
+
<td style="padding:15px">healthCheck(callback)</td>
|
|
22
|
+
<td style="padding:15px">This call ensures that the adapter can communicate with Selector_ai. The actual call that is used is defined in the adapter properties and .system entities action.json file.</td>
|
|
23
|
+
<td style="padding:15px">No</td>
|
|
24
|
+
</tr>
|
|
25
|
+
<tr>
|
|
26
|
+
<td style="padding:15px">refreshProperties(properties)</td>
|
|
27
|
+
<td style="padding:15px">This call provides the adapter the ability to accept property changes without having to restart the adapter.</td>
|
|
28
|
+
<td style="padding:15px">No</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr>
|
|
31
|
+
<td style="padding:15px">encryptProperty(property, technique, callback)</td>
|
|
32
|
+
<td style="padding:15px">This call will take the provided property and technique, and return the property encrypted with the technique. This allows the property to be used in the adapterProps section for the credential password so that the password does not have to be in clear text. The adapter will decrypt the property as needed for communications with Selector_ai.</td>
|
|
33
|
+
<td style="padding:15px">No</td>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td style="padding:15px">iapUpdateAdapterConfiguration(configFile, changes, entity, type, action, callback)</td>
|
|
37
|
+
<td style="padding:15px">This call provides the ability to update the adapter configuration from Itential Platform - includes actions, schema, mockdata and other configurations.</td>
|
|
38
|
+
<td style="padding:15px">Yes</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td style="padding:15px">iapSuspendAdapter(mode, callback)</td>
|
|
42
|
+
<td style="padding:15px">This 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.</td>
|
|
43
|
+
<td style="padding:15px">Yes</td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td style="padding:15px">iapUnsuspendAdapter(callback)</td>
|
|
47
|
+
<td style="padding:15px">This call provides the ability to resume a suspended adapter. Any requests in queue will be processed before new requests.</td>
|
|
48
|
+
<td style="padding:15px">Yes</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<td style="padding:15px">iapGetAdapterQueue(callback)</td>
|
|
52
|
+
<td style="padding:15px">This call will return the requests that are waiting in the queue if throttling is enabled.</td>
|
|
53
|
+
<td style="padding:15px">Yes</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td style="padding:15px">iapFindAdapterPath(apiPath, callback)</td>
|
|
57
|
+
<td style="padding:15px">This call provides the ability to see if a particular API path is supported by the adapter.</td>
|
|
58
|
+
<td style="padding:15px">Yes</td>
|
|
59
|
+
</tr>
|
|
60
|
+
<tr>
|
|
61
|
+
<td style="padding:15px">iapTroubleshootAdapter(props, adapter, callback)</td>
|
|
62
|
+
<td style="padding:15px">This call can be used to check on the performance of the adapter - it checks connectivity, healthcheck and basic get calls.</td>
|
|
63
|
+
<td style="padding:15px">Yes</td>
|
|
64
|
+
</tr>
|
|
65
|
+
<tr>
|
|
66
|
+
<td style="padding:15px">iapRunAdapterHealthcheck(adapter, callback)</td>
|
|
67
|
+
<td style="padding:15px">This call will return the results of a healthcheck.</td>
|
|
68
|
+
<td style="padding:15px">Yes</td>
|
|
69
|
+
</tr>
|
|
70
|
+
<tr>
|
|
71
|
+
<td style="padding:15px">iapRunAdapterConnectivity(callback)</td>
|
|
72
|
+
<td style="padding:15px">This call will return the results of a connectivity check.</td>
|
|
73
|
+
<td style="padding:15px">Yes</td>
|
|
74
|
+
</tr>
|
|
75
|
+
<tr>
|
|
76
|
+
<td style="padding:15px">iapRunAdapterBasicGet(maxCalls, callback)</td>
|
|
77
|
+
<td style="padding:15px">This call will return the results of running basic get API calls. By default 5 get calls without parameters will be run. You can ask for more or less by setting maxCalls.</td>
|
|
78
|
+
<td style="padding:15px">Yes</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr>
|
|
81
|
+
<td style="padding:15px">iapMoveAdapterEntitiesToDB(callback)</td>
|
|
82
|
+
<td style="padding:15px">This call will push the adapter configuration from the entities directory into the Adapter or Itential Platform Database.</td>
|
|
83
|
+
<td style="padding:15px">Yes</td>
|
|
84
|
+
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td style="padding:15px">iapDeactivateTasks(tasks, callback)</td>
|
|
87
|
+
<td style="padding:15px">This call provides the ability to remove tasks from the adapter.</td>
|
|
88
|
+
<td style="padding:15px">Yes</td>
|
|
89
|
+
</tr>
|
|
90
|
+
<tr>
|
|
91
|
+
<td style="padding:15px">iapActivateTasks(tasks, callback)</td>
|
|
92
|
+
<td style="padding:15px">This call provides the ability to add deactivated tasks back into the adapter.</td>
|
|
93
|
+
<td style="padding:15px">Yes</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td style="padding:15px">iapExpandedGenericAdapterRequest(metadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback)</td>
|
|
97
|
+
<td style="padding:15px">This is an expanded Generic Call. The metadata object allows us to provide many new capabilities within the generic request.</td>
|
|
98
|
+
<td style="padding:15px">Yes</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td style="padding:15px">genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback)</td>
|
|
102
|
+
<td style="padding:15px">This call allows you to provide the path to have the adapter call. It is an easy way to incorporate paths that have not been built into the adapter yet.</td>
|
|
103
|
+
<td style="padding:15px">Yes</td>
|
|
104
|
+
</tr>
|
|
105
|
+
<tr>
|
|
106
|
+
<td style="padding:15px">genericAdapterRequestNoBasePath(uriPath, restMethod, queryData, requestBody, addlHeaders, callback)</td>
|
|
107
|
+
<td style="padding:15px">This call is the same as the genericAdapterRequest only it does not add a base_path or version to the call.</td>
|
|
108
|
+
<td style="padding:15px">Yes</td>
|
|
109
|
+
</tr>
|
|
110
|
+
<tr>
|
|
111
|
+
<td style="padding:15px">iapRunAdapterLint(callback)</td>
|
|
112
|
+
<td style="padding:15px">Runs lint on the adapter and provides the information back.</td>
|
|
113
|
+
<td style="padding:15px">Yes</td>
|
|
114
|
+
</tr>
|
|
115
|
+
<tr>
|
|
116
|
+
<td style="padding:15px">iapRunAdapterTests(callback)</td>
|
|
117
|
+
<td style="padding:15px">Runs baseunit and unit tests on the adapter and provides the information back.</td>
|
|
118
|
+
<td style="padding:15px">Yes</td>
|
|
119
|
+
</tr>
|
|
120
|
+
<tr>
|
|
121
|
+
<td style="padding:15px">iapGetAdapterInventory(callback)</td>
|
|
122
|
+
<td style="padding:15px">This call provides some inventory related information about the adapter.</td>
|
|
123
|
+
<td style="padding:15px">Yes</td>
|
|
124
|
+
</tr>
|
|
125
|
+
</table>
|
|
126
|
+
<br>
|
|
127
|
+
|
|
128
|
+
### Adapter Cache Calls
|
|
129
|
+
|
|
130
|
+
These are adapter methods that are used for adapter caching. If configured, the adapter will cache based on the interval provided. However, you can force a population of the cache manually as well.
|
|
131
|
+
|
|
132
|
+
<table border="1" class="bordered-table">
|
|
133
|
+
<tr>
|
|
134
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
|
|
135
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
136
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
|
|
137
|
+
</tr>
|
|
138
|
+
<tr>
|
|
139
|
+
<td style="padding:15px">iapPopulateEntityCache(entityTypes, callback)</td>
|
|
140
|
+
<td style="padding:15px">This call populates the adapter cache.</td>
|
|
141
|
+
<td style="padding:15px">Yes</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td style="padding:15px">iapRetrieveEntitiesCache(entityType, options, callback)</td>
|
|
145
|
+
<td style="padding:15px">This call retrieves the specific items from the adapter cache.</td>
|
|
146
|
+
<td style="padding:15px">Yes</td>
|
|
147
|
+
</tr>
|
|
148
|
+
</table>
|
|
149
|
+
<br>
|
|
150
|
+
|
|
151
|
+
### Adapter Broker Calls
|
|
152
|
+
|
|
153
|
+
These are adapter methods that are used to integrate to Itential Platform Brokers. This adapter currently supports the following broker calls.
|
|
154
|
+
|
|
155
|
+
<table border="1" class="bordered-table">
|
|
156
|
+
<tr>
|
|
157
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
|
|
158
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
159
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
|
|
160
|
+
</tr>
|
|
161
|
+
<tr>
|
|
162
|
+
<td style="padding:15px">hasEntities(entityType, entityList, callback)</td>
|
|
163
|
+
<td style="padding:15px">This call is utilized by the Itential Platform Device Broker to determine if the adapter has a specific entity and item of the entity.</td>
|
|
164
|
+
<td style="padding:15px">No</td>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr>
|
|
167
|
+
<td style="padding:15px">getDevice(deviceName, callback)</td>
|
|
168
|
+
<td style="padding:15px">This call returns the details of the requested device.</td>
|
|
169
|
+
<td style="padding:15px">No</td>
|
|
170
|
+
</tr>
|
|
171
|
+
<tr>
|
|
172
|
+
<td style="padding:15px">getDevicesFiltered(options, callback)</td>
|
|
173
|
+
<td style="padding:15px">This call returns the list of devices that match the criteria provided in the options filter.</td>
|
|
174
|
+
<td style="padding:15px">No</td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr>
|
|
177
|
+
<td style="padding:15px">isAlive(deviceName, callback)</td>
|
|
178
|
+
<td style="padding:15px">This call returns whether the device status is active</td>
|
|
179
|
+
<td style="padding:15px">No</td>
|
|
180
|
+
</tr>
|
|
181
|
+
<tr>
|
|
182
|
+
<td style="padding:15px">getConfig(deviceName, format, callback)</td>
|
|
183
|
+
<td style="padding:15px">This call returns the configuration for the selected device.</td>
|
|
184
|
+
<td style="padding:15px">No</td>
|
|
185
|
+
</tr>
|
|
186
|
+
<tr>
|
|
187
|
+
<td style="padding:15px">iapGetDeviceCount(callback)</td>
|
|
188
|
+
<td style="padding:15px">This call returns the count of devices.</td>
|
|
189
|
+
<td style="padding:15px">No</td>
|
|
190
|
+
</tr>
|
|
191
|
+
</table>
|
|
192
|
+
<br>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
### Specific Adapter Calls
|
|
196
|
+
|
|
197
|
+
Specific adapter calls are built based on the API of the Selector_ai. 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.
|
|
198
|
+
|
|
199
|
+
<table border="1" class="bordered-table">
|
|
200
|
+
<tr>
|
|
201
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
|
|
202
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
203
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Path</span></th>
|
|
204
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
|
|
205
|
+
</tr>
|
|
206
|
+
<tr>
|
|
207
|
+
<td style="padding:15px">getAllInventoryV1InventoryGet(iapMetadata, callback)</td>
|
|
208
|
+
<td style="padding:15px">Get_all_inventory_v1_inventory_get</td>
|
|
209
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory?{query}</td>
|
|
210
|
+
<td style="padding:15px">Yes</td>
|
|
211
|
+
</tr>
|
|
212
|
+
<tr>
|
|
213
|
+
<td style="padding:15px">inventoryCreationV1InventoryPost(body, iapMetadata, callback)</td>
|
|
214
|
+
<td style="padding:15px">Inventory_creation_v1_inventory_post</td>
|
|
215
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory?{query}</td>
|
|
216
|
+
<td style="padding:15px">Yes</td>
|
|
217
|
+
</tr>
|
|
218
|
+
<tr>
|
|
219
|
+
<td style="padding:15px">inventoryUpdateV1InventoryNamePut(name, body, iapMetadata, callback)</td>
|
|
220
|
+
<td style="padding:15px">Inventory_update_v1_inventory__name__put</td>
|
|
221
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}?{query}</td>
|
|
222
|
+
<td style="padding:15px">Yes</td>
|
|
223
|
+
</tr>
|
|
224
|
+
<tr>
|
|
225
|
+
<td style="padding:15px">deletingSpecificInventoryV1InventoryNameDelete(name, iapMetadata, callback)</td>
|
|
226
|
+
<td style="padding:15px">Deleting_Specific_Inventory_v1_inventory__name__delete</td>
|
|
227
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}?{query}</td>
|
|
228
|
+
<td style="padding:15px">Yes</td>
|
|
229
|
+
</tr>
|
|
230
|
+
<tr>
|
|
231
|
+
<td style="padding:15px">inventoryItemGetV1InventoryNameGet(name, pattern, iapMetadata, callback)</td>
|
|
232
|
+
<td style="padding:15px">Inventory_Item_get_v1_inventory__name__get</td>
|
|
233
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}?{query}</td>
|
|
234
|
+
<td style="padding:15px">Yes</td>
|
|
235
|
+
</tr>
|
|
236
|
+
<tr>
|
|
237
|
+
<td style="padding:15px">inventoryItemGetV1InventoryNameIdGet(name, id, iapMetadata, callback)</td>
|
|
238
|
+
<td style="padding:15px">Inventory_Item_get_v1_inventory__name___id__get</td>
|
|
239
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}/{pathv2}?{query}</td>
|
|
240
|
+
<td style="padding:15px">Yes</td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td style="padding:15px">inventoryItemCreationV1InventoryNamePost(name, body, iapMetadata, callback)</td>
|
|
244
|
+
<td style="padding:15px">Inventory_Item_creation_v1_inventory__name__post</td>
|
|
245
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}?{query}</td>
|
|
246
|
+
<td style="padding:15px">Yes</td>
|
|
247
|
+
</tr>
|
|
248
|
+
<tr>
|
|
249
|
+
<td style="padding:15px">inventoryItemCreationV1InventoryNameIdPut(name, id, body, iapMetadata, callback)</td>
|
|
250
|
+
<td style="padding:15px">Inventory_Item_creation_v1_inventory__name___id__put</td>
|
|
251
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}/{pathv2}?{query}</td>
|
|
252
|
+
<td style="padding:15px">Yes</td>
|
|
253
|
+
</tr>
|
|
254
|
+
<tr>
|
|
255
|
+
<td style="padding:15px">inventoryItemDeletionV1InventoryNameIdDelete(name, id, iapMetadata, callback)</td>
|
|
256
|
+
<td style="padding:15px">Inventory_Item_deletion_v1_inventory__name___id__delete</td>
|
|
257
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/{pathv1}/{pathv2}?{query}</td>
|
|
258
|
+
<td style="padding:15px">Yes</td>
|
|
259
|
+
</tr>
|
|
260
|
+
<tr>
|
|
261
|
+
<td style="padding:15px">inventoryItemCreationV1InventoryBulkNamePost(name, merge, body, iapMetadata, callback)</td>
|
|
262
|
+
<td style="padding:15px">Inventory_Item_creation_v1_inventory_bulk__name__post</td>
|
|
263
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/bulk/{pathv1}?{query}</td>
|
|
264
|
+
<td style="padding:15px">Yes</td>
|
|
265
|
+
</tr>
|
|
266
|
+
<tr>
|
|
267
|
+
<td style="padding:15px">inventoryItemCreationV1InventoryCsvNamePost(name, merge, file, iapMetadata, callback)</td>
|
|
268
|
+
<td style="padding:15px">Inventory_Item_creation_v1_inventory_csv__name__post</td>
|
|
269
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory/csv/{pathv1}?{query}</td>
|
|
270
|
+
<td style="padding:15px">Yes</td>
|
|
271
|
+
</tr>
|
|
272
|
+
<tr>
|
|
273
|
+
<td style="padding:15px">inventoryItemGetV1InventoryItemsGet(type, iapMetadata, callback)</td>
|
|
274
|
+
<td style="padding:15px">Inventory_Item_get_v1_inventory_items_get</td>
|
|
275
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-items?{query}</td>
|
|
276
|
+
<td style="padding:15px">Yes</td>
|
|
277
|
+
</tr>
|
|
278
|
+
<tr>
|
|
279
|
+
<td style="padding:15px">getAllInventoryV1InventorySchemaGet(iapMetadata, callback)</td>
|
|
280
|
+
<td style="padding:15px">Get_all_inventory_v1_inventory_schema_get</td>
|
|
281
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema?{query}</td>
|
|
282
|
+
<td style="padding:15px">Yes</td>
|
|
283
|
+
</tr>
|
|
284
|
+
<tr>
|
|
285
|
+
<td style="padding:15px">postInventoryV1InventorySchema(file, iapMetadata, callback)</td>
|
|
286
|
+
<td style="padding:15px">Post_inventory_v1_inventory_schema</td>
|
|
287
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema?{query}</td>
|
|
288
|
+
<td style="padding:15px">Yes</td>
|
|
289
|
+
</tr>
|
|
290
|
+
<tr>
|
|
291
|
+
<td style="padding:15px">putInventoryV1InventorySchema(file, iapMetadata, callback)</td>
|
|
292
|
+
<td style="padding:15px">Put_inventory_v1_inventory_schema</td>
|
|
293
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema?{query}</td>
|
|
294
|
+
<td style="padding:15px">Yes</td>
|
|
295
|
+
</tr>
|
|
296
|
+
<tr>
|
|
297
|
+
<td style="padding:15px">processinventoryschemadelete(iapMetadata, callback)</td>
|
|
298
|
+
<td style="padding:15px">Process inventory schema delete</td>
|
|
299
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema?{query}</td>
|
|
300
|
+
<td style="padding:15px">Yes</td>
|
|
301
|
+
</tr>
|
|
302
|
+
<tr>
|
|
303
|
+
<td style="padding:15px">deleteProcessinventoryschemadelete(type, iapMetadata, callback)</td>
|
|
304
|
+
<td style="padding:15px">Process inventory schema delete</td>
|
|
305
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema/{pathv1}?{query}</td>
|
|
306
|
+
<td style="padding:15px">Yes</td>
|
|
307
|
+
</tr>
|
|
308
|
+
<tr>
|
|
309
|
+
<td style="padding:15px">getsAllInventoryschema(iapMetadata, callback)</td>
|
|
310
|
+
<td style="padding:15px">Gets All Inventory schema</td>
|
|
311
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v2/inventory-schema?{query}</td>
|
|
312
|
+
<td style="padding:15px">Yes</td>
|
|
313
|
+
</tr>
|
|
314
|
+
<tr>
|
|
315
|
+
<td style="padding:15px">processinventoryschemaJSONinput(body, iapMetadata, callback)</td>
|
|
316
|
+
<td style="padding:15px">Process inventory schema JSON input</td>
|
|
317
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v2/inventory-schema?{query}</td>
|
|
318
|
+
<td style="padding:15px">Yes</td>
|
|
319
|
+
</tr>
|
|
320
|
+
<tr>
|
|
321
|
+
<td style="padding:15px">deleteProcessinventoryschemadelete1(iapMetadata, callback)</td>
|
|
322
|
+
<td style="padding:15px">Process inventory schema delete</td>
|
|
323
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v2/inventory-schema?{query}</td>
|
|
324
|
+
<td style="padding:15px">Yes</td>
|
|
325
|
+
</tr>
|
|
326
|
+
<tr>
|
|
327
|
+
<td style="padding:15px">putProcessinventoryschemaJSONinput(type, body, iapMetadata, callback)</td>
|
|
328
|
+
<td style="padding:15px">Process inventory schema JSON input</td>
|
|
329
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v2/inventory-schema/{pathv1}?{query}</td>
|
|
330
|
+
<td style="padding:15px">Yes</td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr>
|
|
333
|
+
<td style="padding:15px">deleteProcessinventoryschemadelete2(type, iapMetadata, callback)</td>
|
|
334
|
+
<td style="padding:15px">Process inventory schema delete</td>
|
|
335
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v2/inventory-schema/{pathv1}?{query}</td>
|
|
336
|
+
<td style="padding:15px">Yes</td>
|
|
337
|
+
</tr>
|
|
338
|
+
<tr>
|
|
339
|
+
<td style="padding:15px">porcessuploadJSONfile(encodeType = 'json', file, iapMetadata, callback)</td>
|
|
340
|
+
<td style="padding:15px">Porcess upload JSON file</td>
|
|
341
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema-files/import?{query}</td>
|
|
342
|
+
<td style="padding:15px">Yes</td>
|
|
343
|
+
</tr>
|
|
344
|
+
<tr>
|
|
345
|
+
<td style="padding:15px">downloadinventoryschemaJSONfile(encodeType = 'json', body, iapMetadata, callback)</td>
|
|
346
|
+
<td style="padding:15px">Download inventory schema JSON file</td>
|
|
347
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-schema-files/export?{query}</td>
|
|
348
|
+
<td style="padding:15px">Yes</td>
|
|
349
|
+
</tr>
|
|
350
|
+
<tr>
|
|
351
|
+
<td style="padding:15px">handleInventoryFilesPostInventoryFilesImportPost(encodeType, zipFile, iapMetadata, callback)</td>
|
|
352
|
+
<td style="padding:15px">handle_inventory_files_post_inventory_files_import_post</td>
|
|
353
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-files/import?{query}</td>
|
|
354
|
+
<td style="padding:15px">Yes</td>
|
|
355
|
+
</tr>
|
|
356
|
+
<tr>
|
|
357
|
+
<td style="padding:15px">handleInventoryFilesGetInventoryFilesExportPost(encodeType, body, iapMetadata, callback)</td>
|
|
358
|
+
<td style="padding:15px">handle_inventory_files_get_inventory_files_export_post</td>
|
|
359
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-files/export?{query}</td>
|
|
360
|
+
<td style="padding:15px">Yes</td>
|
|
361
|
+
</tr>
|
|
362
|
+
<tr>
|
|
363
|
+
<td style="padding:15px">handleInventoryCsvFileGet(name, iapMetadata, callback)</td>
|
|
364
|
+
<td style="padding:15px">handle_inventory_csv_file_get</td>
|
|
365
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/v1/inventory-file/csv/{pathv1}?{query}</td>
|
|
366
|
+
<td style="padding:15px">Yes</td>
|
|
367
|
+
</tr>
|
|
368
|
+
<tr>
|
|
369
|
+
<td style="padding:15px">get(iapMetadata, callback)</td>
|
|
370
|
+
<td style="padding:15px">home_page__get</td>
|
|
371
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/?{query}</td>
|
|
372
|
+
<td style="padding:15px">Yes</td>
|
|
373
|
+
</tr>
|
|
374
|
+
<tr>
|
|
375
|
+
<td style="padding:15px">getOpstats(iapMetadata, callback)</td>
|
|
376
|
+
<td style="padding:15px">opstats_opstats_get</td>
|
|
377
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/opstats?{query}</td>
|
|
378
|
+
<td style="padding:15px">Yes</td>
|
|
379
|
+
</tr>
|
|
380
|
+
<tr>
|
|
381
|
+
<td style="padding:15px">getVersion(iapMetadata, callback)</td>
|
|
382
|
+
<td style="padding:15px">version_version_get</td>
|
|
383
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/version?{query}</td>
|
|
384
|
+
<td style="padding:15px">Yes</td>
|
|
385
|
+
</tr>
|
|
386
|
+
<tr>
|
|
387
|
+
<td style="padding:15px">getAIConfig(iapMetadata, callback)</td>
|
|
388
|
+
<td style="padding:15px">config_config_get</td>
|
|
389
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/config?{query}</td>
|
|
390
|
+
<td style="padding:15px">Yes</td>
|
|
391
|
+
</tr>
|
|
392
|
+
<tr>
|
|
393
|
+
<td style="padding:15px">getHealth(iapMetadata, callback)</td>
|
|
394
|
+
<td style="padding:15px">health_health_get</td>
|
|
395
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/health?{query}</td>
|
|
396
|
+
<td style="padding:15px">Yes</td>
|
|
397
|
+
</tr>
|
|
398
|
+
<tr>
|
|
399
|
+
<td style="padding:15px">healthLogsGet(iapMetadata, callback)</td>
|
|
400
|
+
<td style="padding:15px">health_logs_get</td>
|
|
401
|
+
<td style="padding:15px">{base_path}/{version}/inventory_manager/logs?{query}</td>
|
|
402
|
+
<td style="padding:15px">Yes</td>
|
|
403
|
+
</tr>
|
|
404
|
+
</table>
|
|
405
|
+
<br>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behavior that contributes to creating a positive environment include:
|
|
10
|
+
|
|
11
|
+
- Using welcoming and inclusive language
|
|
12
|
+
- Being respectful of differing viewpoints and experiences
|
|
13
|
+
- Gracefully accepting constructive criticism
|
|
14
|
+
- Focusing on what is best for the community
|
|
15
|
+
- Showing empathy towards other community members
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behavior by participants include:
|
|
18
|
+
|
|
19
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
20
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
21
|
+
- Public or private harassment
|
|
22
|
+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
23
|
+
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
24
|
+
|
|
25
|
+
## Our Responsibilities
|
|
26
|
+
|
|
27
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
28
|
+
|
|
29
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
34
|
+
|
|
35
|
+
## Enforcement
|
|
36
|
+
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@itential.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
38
|
+
|
|
39
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
40
|
+
|
|
41
|
+
## Attribution
|
|
42
|
+
|
|
43
|
+
This Code of Conduct is adapted from the <a href="http://contributor-covenant.org" target="_blank">Contributor Covenant</a>, version 1.4, available at <a href="http://contributor-covenant.org/version/1/4/" target="_blank">version</a>
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
First off, thanks for taking the time to contribute!
|
|
4
|
+
|
|
5
|
+
The following is a set of rules for contributing.
|
|
6
|
+
|
|
7
|
+
## Code of Conduct
|
|
8
|
+
|
|
9
|
+
This project and everyone participating in it is governed by the Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to support@itential.com.
|
|
10
|
+
|
|
11
|
+
## How to Contribute
|
|
12
|
+
|
|
13
|
+
Follow the contributing guide (here)[https://gitlab.com/itentialopensource/adapters/contributing-guide]
|
package/ENHANCE.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
## Enhancements
|
|
2
|
+
|
|
3
|
+
### Adding a Second Instance of an Adapter
|
|
4
|
+
|
|
5
|
+
You can add a second instance of this adapter without adding new code on the file system. To do this go into the Itential Platform 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 (unique host and port) of the other system.
|
|
6
|
+
|
|
7
|
+
### Adding Adapter Calls
|
|
8
|
+
|
|
9
|
+
There are multiple ways to add calls to an existing adapter.
|
|
10
|
+
|
|
11
|
+
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 simply put it in the adapter directory and execute `npm run adapter:update`.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
mv updatePackage.zip adapter-selector_ai
|
|
15
|
+
cd adapter-selector_ai
|
|
16
|
+
npm run adapter:update
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If you do not have a Swagger or OpenAPI document, you can use a Postman Collection and convert that to an OpenAPI document using APIMatic and then follow the first process.
|
|
20
|
+
|
|
21
|
+
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 Itential Platform, 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 <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a> on our Documentation Site.
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
Files to update
|
|
25
|
+
* entities/<entity>/action.json: add an action
|
|
26
|
+
* entities/<entity>/schema.json (or the schema defined on the action): add action to the enum for ph_request_type
|
|
27
|
+
* adapter.js: add the new method and make sure it calls the proper entity and action
|
|
28
|
+
* pronghorn.json: add the new method
|
|
29
|
+
* test/unit/adapterTestUnit.js (optional but best practice): add unit test(s) - function is there, any required parameters error when not passed in
|
|
30
|
+
* test/integration/adapterTestIntegration.js (optional but best practice): add integration test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Adding Adapter Properties
|
|
34
|
+
|
|
35
|
+
While changing adapter properties is done in the service instance configuration section of Itential Platform, 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.
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Files to update
|
|
39
|
+
* propertiesSchema.json: add the new property and how it is defined
|
|
40
|
+
* sampleProperties: add the new property with a default value
|
|
41
|
+
* test/unit/adapterTestUnit.js (optional but best practice): add the property to the global properties
|
|
42
|
+
* test/integration/adapterTestIntegration.js (optional but best practice): add the property to the global properties
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Changing Adapter Authentication
|
|
46
|
+
|
|
47
|
+
Often an adapter is built before knowing the authentication and authentication processes can also change over time. The adapter supports many different kinds of authentication but it does require configuration. Some forms of authentication can be defined entirely with the adapter properties but others require configuration.
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Files to update
|
|
51
|
+
* entities/.system/action.json: change the getToken action as needed
|
|
52
|
+
* entities/.system/schemaTokenReq.json: add input parameters (external name is name in other system)
|
|
53
|
+
* entities/.system/schemaTokenResp.json: add response parameters (external name is name in other system)
|
|
54
|
+
* propertiesSchema.json: add any new property and how it is defined
|
|
55
|
+
* sampleProperties: add any new property with a default value
|
|
56
|
+
* test/unit/adapterTestUnit.js (optional but best practice): add the property to the global properties
|
|
57
|
+
* test/integration/adapterTestIntegration.js (optional but best practice): add the property to the global properties
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Enhancing Adapter Integration Tests
|
|
61
|
+
|
|
62
|
+
The adapter integration tests are written to be able to test in either stub (standalone) mode or integrated to the other system. However, if integrating to the other system, you may need to provide better data than what the adapter provides by default as that data is likely to fail for create and update. To provide better data, edit the adapter integration test file. Make sure you do not remove the marker and keep custom code below the marker so you do not impact future migrations. Once the edits are complete, run the integration test as it instructs you to above. When you run integrated to the other system, you can also save mockdata for future use by changing the isSaveMockData flag to true.
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
Files to update
|
|
66
|
+
* test/integration/adapterTestIntegration.js: add better data for the create and update calls so that they will not fail.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
As mentioned previously, for most of these changes as well as other possible changes, there is more information on how to work on an adapter in the <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a> on our Documentation Site.
|