@itentialopensource/adapter-onap_blueprint_processor 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.
Files changed (94) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/AUTH.md +37 -0
  5. package/BROKER.md +211 -0
  6. package/CALLS.md +476 -0
  7. package/CHANGELOG.md +9 -0
  8. package/CODE_OF_CONDUCT.md +43 -0
  9. package/CONTRIBUTING.md +13 -0
  10. package/ENHANCE.md +69 -0
  11. package/LICENSE +201 -0
  12. package/PROPERTIES.md +646 -0
  13. package/README.md +343 -0
  14. package/SUMMARY.md +9 -0
  15. package/SYSTEMINFO.md +19 -0
  16. package/TAB1.md +11 -0
  17. package/TAB2.md +319 -0
  18. package/TROUBLESHOOT.md +47 -0
  19. package/adapter.js +4563 -0
  20. package/adapterBase.js +1452 -0
  21. package/changelogs/CHANGELOG.md +0 -0
  22. package/entities/.generic/action.json +214 -0
  23. package/entities/.generic/schema.json +28 -0
  24. package/entities/.system/action.json +50 -0
  25. package/entities/.system/mockdatafiles/getToken-default.json +3 -0
  26. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  27. package/entities/.system/schema.json +19 -0
  28. package/entities/.system/schemaTokenReq.json +53 -0
  29. package/entities/.system/schemaTokenResp.json +53 -0
  30. package/entities/BlueprintModelCatalog/action.json +374 -0
  31. package/entities/BlueprintModelCatalog/mockdatafiles/getAllBlueprintModels-default.json +41 -0
  32. package/entities/BlueprintModelCatalog/mockdatafiles/getAllBlueprintModelsByKeyword-default.json +28 -0
  33. package/entities/BlueprintModelCatalog/mockdatafiles/searchBlueprintModelsByTags-default.json +28 -0
  34. package/entities/BlueprintModelCatalog/schema.json +36 -0
  35. package/entities/ExecutionServiceCatalog/action.json +24 -0
  36. package/entities/ExecutionServiceCatalog/schema.json +19 -0
  37. package/entities/ModelTypeCatalog/action.json +87 -0
  38. package/entities/ModelTypeCatalog/mockdatafiles/getModelTypeByDefinitionType-default.json +68 -0
  39. package/entities/ModelTypeCatalog/mockdatafiles/searchModelTypesByTags-default.json +68 -0
  40. package/entities/ModelTypeCatalog/schema.json +22 -0
  41. package/entities/ResourceConfiguration/action.json +107 -0
  42. package/entities/ResourceConfiguration/mockdatafiles/getAllConfigSnapshotsByID-default.json +26 -0
  43. package/entities/ResourceConfiguration/mockdatafiles/getAllConfigSnapshotsByType-default.json +18 -0
  44. package/entities/ResourceConfiguration/schema.json +23 -0
  45. package/entities/ResourceDictionary/action.json +209 -0
  46. package/entities/ResourceDictionary/mockdatafiles/getAllResourceDictionaryGroups-default.json +6 -0
  47. package/entities/ResourceDictionary/mockdatafiles/searchResourceDictionaryByNames-default.json +14609 -0
  48. package/entities/ResourceDictionary/mockdatafiles/searchResourceDictionaryByTags-default.json +5329 -0
  49. package/entities/ResourceDictionary/schema.json +28 -0
  50. package/entities/ResourceTemplate/action.json +65 -0
  51. package/entities/ResourceTemplate/mockdatafiles/getTemplatesWithOccurrences-default.json +26 -0
  52. package/entities/ResourceTemplate/schema.json +21 -0
  53. package/entities/Resources/action.json +87 -0
  54. package/entities/Resources/mockdatafiles/getAllResourcesUsingResolutionKey-default.json +70 -0
  55. package/entities/Resources/mockdatafiles/getResourcesWithOccurrences-default.json +70 -0
  56. package/entities/Resources/schema.json +22 -0
  57. package/error.json +190 -0
  58. package/metadata.json +89 -0
  59. package/package.json +80 -0
  60. package/pronghorn.json +22633 -0
  61. package/propertiesDecorators.json +14 -0
  62. package/propertiesSchema.json +1658 -0
  63. package/refs?service=git-upload-pack +0 -0
  64. package/report/adapter-openapi.json +3789 -0
  65. package/report/adapter-openapi.yaml +2624 -0
  66. package/report/adapterInfo.json +10 -0
  67. package/report/cds-bp-processor-api-swagger.json +3203 -0
  68. package/report/creationReport.json +460 -0
  69. package/report/updateReport1727443189469.json +120 -0
  70. package/sampleProperties.json +268 -0
  71. package/test/integration/adapterTestBasicGet.js +83 -0
  72. package/test/integration/adapterTestConnectivity.js +142 -0
  73. package/test/integration/adapterTestIntegration.js +1693 -0
  74. package/test/unit/adapterBaseTestUnit.js +1024 -0
  75. package/test/unit/adapterTestUnit.js +3287 -0
  76. package/utils/adapterInfo.js +206 -0
  77. package/utils/addAuth.js +94 -0
  78. package/utils/artifactize.js +146 -0
  79. package/utils/basicGet.js +50 -0
  80. package/utils/checkMigrate.js +63 -0
  81. package/utils/entitiesToDB.js +179 -0
  82. package/utils/findPath.js +74 -0
  83. package/utils/methodDocumentor.js +273 -0
  84. package/utils/modify.js +152 -0
  85. package/utils/packModificationScript.js +35 -0
  86. package/utils/patches2bundledDeps.js +90 -0
  87. package/utils/pre-commit.sh +32 -0
  88. package/utils/removeHooks.js +20 -0
  89. package/utils/setup.js +33 -0
  90. package/utils/taskMover.js +309 -0
  91. package/utils/tbScript.js +239 -0
  92. package/utils/tbUtils.js +489 -0
  93. package/utils/testRunner.js +298 -0
  94. package/utils/troubleshootingAdapter.js +193 -0
package/TAB2.md ADDED
@@ -0,0 +1,319 @@
1
+ # ONAP Blueprint Processor
2
+
3
+ ## Table of Contents
4
+
5
+ - [Specific Adapter Information](#specific-adapter-information)
6
+ - [Authentication](#authentication)
7
+ - [Sample Properties](#sample-properties)
8
+ - [Swagger](#swagger)
9
+ - [Generic Adapter Information](#generic-adapter-information)
10
+
11
+ ## Specific Adapter Information
12
+ ### Authentication
13
+
14
+ This document will go through the steps for authenticating the ONAP Blueprint Processor adapter with Basic Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
15
+
16
+ Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
17
+
18
+ #### Basic Authentication
19
+ The ONAP Blueprint Processor adapter requires Basic Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
20
+
21
+ STEPS
22
+ 1. Ensure you have access to a ONAP Blueprint Processor server and that it is running
23
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
24
+ 3. Use the properties below for the ```properties.authentication``` field
25
+ ```json
26
+ "authentication": {
27
+ "auth_method": "basic user_password",
28
+ "username": "<username>",
29
+ "password": "<password>",
30
+ "auth_field": "header.headers.Authorization",
31
+ "auth_field_format": "Basic {b64}{username}:{password}{/b64}",
32
+ "auth_logging": false
33
+ }
34
+ ```
35
+ you can leave all of the other properties in the authentication section, they will not be used when the auth_method is basic user_password.
36
+
37
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
38
+
39
+ #### Troubleshooting
40
+ - Make sure you copied over the correct username and password.
41
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
42
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
43
+ - Investigate the logs - in particular:
44
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
45
+ - The FULL BODY log to make sure the payload is accurate.
46
+ - The CALL RETURN log to see what the other system is telling us.
47
+ - Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
48
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
49
+
50
+ ### Sample Properties
51
+
52
+ Sample Properties can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
53
+
54
+ ```json
55
+ "properties": {
56
+ "host": "localhost",
57
+ "port": 8080,
58
+ "choosepath": "",
59
+ "base_path": "/api",
60
+ "version": "v1",
61
+ "cache_location": "none",
62
+ "encode_pathvars": true,
63
+ "encode_queryvars": true,
64
+ "save_metric": false,
65
+ "stub": true,
66
+ "protocol": "https",
67
+ "authentication": {
68
+ "auth_method": "basic user_password",
69
+ "username": "username",
70
+ "password": "password",
71
+ "token": "token",
72
+ "token_timeout": 600000,
73
+ "token_cache": "local",
74
+ "invalid_token_error": 401,
75
+ "auth_field": "header.headers.Authorization",
76
+ "auth_field_format": "{token}",
77
+ "auth_logging": false,
78
+ "client_id": "",
79
+ "client_secret": "",
80
+ "grant_type": "",
81
+ "sensitive": [],
82
+ "sso": {
83
+ "protocol": "",
84
+ "host": "",
85
+ "port": 0
86
+ },
87
+ "multiStepAuthCalls": [
88
+ {
89
+ "name": "",
90
+ "requestFields": {},
91
+ "responseFields": {},
92
+ "successfullResponseCode": 200
93
+ }
94
+ ]
95
+ },
96
+ "healthcheck": {
97
+ "type": "none",
98
+ "frequency": 60000,
99
+ "query_object": {},
100
+ "addlHeaders": {}
101
+ },
102
+ "throttle": {
103
+ "throttle_enabled": false,
104
+ "number_pronghorns": 1,
105
+ "sync_async": "sync",
106
+ "max_in_queue": 1000,
107
+ "concurrent_max": 1,
108
+ "expire_timeout": 0,
109
+ "avg_runtime": 200,
110
+ "priorities": [
111
+ {
112
+ "value": 0,
113
+ "percent": 100
114
+ }
115
+ ]
116
+ },
117
+ "request": {
118
+ "number_redirects": 0,
119
+ "number_retries": 3,
120
+ "limit_retry_error": [
121
+ 0
122
+ ],
123
+ "failover_codes": [],
124
+ "attempt_timeout": 5000,
125
+ "global_request": {
126
+ "payload": {},
127
+ "uriOptions": {},
128
+ "addlHeaders": {},
129
+ "authData": {}
130
+ },
131
+ "healthcheck_on_timeout": true,
132
+ "return_raw": false,
133
+ "archiving": false,
134
+ "return_request": false
135
+ },
136
+ "proxy": {
137
+ "enabled": false,
138
+ "host": "",
139
+ "port": 1,
140
+ "protocol": "http",
141
+ "username": "",
142
+ "password": ""
143
+ },
144
+ "ssl": {
145
+ "ecdhCurve": "",
146
+ "enabled": false,
147
+ "accept_invalid_cert": false,
148
+ "ca_file": "",
149
+ "key_file": "",
150
+ "cert_file": "",
151
+ "secure_protocol": "",
152
+ "ciphers": ""
153
+ },
154
+ "mongo": {
155
+ "host": "",
156
+ "port": 0,
157
+ "database": "",
158
+ "username": "",
159
+ "password": "",
160
+ "replSet": "",
161
+ "db_ssl": {
162
+ "enabled": false,
163
+ "accept_invalid_cert": false,
164
+ "ca_file": "",
165
+ "key_file": "",
166
+ "cert_file": ""
167
+ }
168
+ },
169
+ "devicebroker": {
170
+ "enabled": false,
171
+ "getDevice": [
172
+ {
173
+ "path": "/not/mapped",
174
+ "method": "GET",
175
+ "query": {},
176
+ "body": {},
177
+ "headers": {},
178
+ "handleFailure": "ignore",
179
+ "requestFields": {
180
+ "insample": "{port}"
181
+ },
182
+ "responseDatakey": "",
183
+ "responseFields": {
184
+ "name": "{this}{||}{that}",
185
+ "ostype": "{osfield}",
186
+ "ostypePrefix": "meraki-",
187
+ "port": "{port}",
188
+ "ipaddress": "{ip_addr}",
189
+ "serial": "{serial}"
190
+ }
191
+ }
192
+ ],
193
+ "getDevicesFiltered": [
194
+ {
195
+ "path": "/not/mapped",
196
+ "method": "GET",
197
+ "pagination": {
198
+ "offsetVar": "",
199
+ "limitVar": "",
200
+ "incrementBy": "limit",
201
+ "requestLocation": "query"
202
+ },
203
+ "query": {},
204
+ "body": {},
205
+ "headers": {},
206
+ "handleFailure": "ignore",
207
+ "requestFields": {},
208
+ "responseDatakey": "",
209
+ "responseFields": {
210
+ "name": "{this}{||}{that}",
211
+ "ostype": "{osfield}",
212
+ "ostypePrefix": "meraki-",
213
+ "port": "{port}",
214
+ "ipaddress": "{ip_addr}",
215
+ "serial": "{serial}",
216
+ "id": "{myid}"
217
+ }
218
+ }
219
+ ],
220
+ "isAlive": [
221
+ {
222
+ "path": "/not/mapped/{devID}",
223
+ "method": "GET",
224
+ "query": {},
225
+ "body": {},
226
+ "headers": {},
227
+ "handleFailure": "ignore",
228
+ "requestFields": {
229
+ "devID": "{id}"
230
+ },
231
+ "responseDatakey": "",
232
+ "responseFields": {
233
+ "status": "return2xx",
234
+ "statusValue": "AD.200"
235
+ }
236
+ }
237
+ ],
238
+ "getConfig": [
239
+ {
240
+ "path": "/not/mapped/{devID}",
241
+ "method": "GET",
242
+ "query": {},
243
+ "body": {},
244
+ "headers": {},
245
+ "handleFailure": "ignore",
246
+ "requestFields": {
247
+ "devID": "{id}"
248
+ },
249
+ "responseDatakey": "",
250
+ "responseFields": {}
251
+ }
252
+ ],
253
+ "getCount": [
254
+ {
255
+ "path": "/not/mapped",
256
+ "method": "GET",
257
+ "query": {},
258
+ "body": {},
259
+ "headers": {},
260
+ "handleFailure": "ignore",
261
+ "requestFields": {},
262
+ "responseDatakey": "",
263
+ "responseFields": {}
264
+ }
265
+ ]
266
+ },
267
+ "cache": {
268
+ "enabled": false,
269
+ "entities": [
270
+ {
271
+ "entityType": "device",
272
+ "frequency": 3600,
273
+ "flushOnFail": false,
274
+ "limit": 10000,
275
+ "retryAttempts": 5,
276
+ "sort": true,
277
+ "populate": [
278
+ {
279
+ "path": "/not/mapped",
280
+ "method": "GET",
281
+ "pagination": {
282
+ "offsetVar": "",
283
+ "limitVar": "",
284
+ "incrementBy": "limit",
285
+ "requestLocation": "query"
286
+ },
287
+ "query": {},
288
+ "body": {},
289
+ "headers": {},
290
+ "handleFailure": "ignore",
291
+ "requestFields": {},
292
+ "responseDatakey": "",
293
+ "responseFields": {
294
+ "name": "{this}{||}{that}",
295
+ "ostype": "{osfield}",
296
+ "ostypePrefix": "meraki-",
297
+ "port": "{port}",
298
+ "ipaddress": "{ip_addr}",
299
+ "serial": "{serial}",
300
+ "id": "{myid}"
301
+ }
302
+ }
303
+ ],
304
+ "cachedTasks": [
305
+ {
306
+ "name": "",
307
+ "filterField": "",
308
+ "filterLoc": ""
309
+ }
310
+ ]
311
+ }
312
+ ]
313
+ }
314
+ }
315
+ ```
316
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/adapter-onap_blueprint_processor/-/blob/master/report/adapter-openapi.json)
317
+
318
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/adapter-onap_blueprint_processor/-/blob/master/README.md)
319
+
@@ -0,0 +1,47 @@
1
+ ## Troubleshoot
2
+
3
+ Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into IAP.
4
+
5
+ You also have the option to run individual commands to perform specific test:
6
+
7
+ - `npm run healthcheck` will perform a healthcheck request of with current setting.
8
+ - `npm run basicget` will perform some non-parameter GET request with current setting.
9
+ - `npm run connectivity` will perform networking diagnostics of the adatper endpoint.
10
+
11
+ ### Connectivity Issues
12
+
13
+ 1. You can run the adapter troubleshooting script which will check connectivity, run the healthcheck and run basic get calls.
14
+
15
+ ```bash
16
+ npm run troubleshoot
17
+ ```
18
+
19
+ 2. Verify the adapter properties are set up correctly.
20
+
21
+ ```text
22
+ Go into the Itential Platform GUI and verify/update the properties
23
+ ```
24
+
25
+ 3. Verify there is connectivity between the Itential Platform Server and Onap_blueprint_processor Server.
26
+
27
+ ```text
28
+ ping the ip address of Onap_blueprint_processor server
29
+ try telnet to the ip address port of Onap_blueprint_processor
30
+ execute a curl command to the other system
31
+ ```
32
+
33
+ 4. Verify the credentials provided for Onap_blueprint_processor.
34
+
35
+ ```text
36
+ login to Onap_blueprint_processor using the provided credentials
37
+ ```
38
+
39
+ 5. Verify the API of the call utilized for Onap_blueprint_processor Healthcheck.
40
+
41
+ ```text
42
+ Go into the Itential Platform GUI and verify/update the properties
43
+ ```
44
+
45
+ ### Functional Issues
46
+
47
+ Adapter logs are located in `/var/log/pronghorn`. In older releases of the Itential Platform, there is a `pronghorn.log` file which contains logs for all of the Itential Platform. In newer versions, adapters can be configured to log into their own files.