@itentialopensource/adapter-azure_aks 0.3.3 → 0.4.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/TAB2.md ADDED
@@ -0,0 +1,329 @@
1
+ # Microsoft Azure Kubernetes Service
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 Microsoft Azure Kubernetes Service adapter with Token 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
+ #### Token Authentication
17
+ The Microsoft Azure Kubernetes Service adapter requires Token Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
18
+
19
+ STEPS
20
+ 1. Ensure you have access to a Microsoft Azure Kubernetes Service server and that it is running
21
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
22
+ 3. Use the properties below for the ```properties.authentication``` field
23
+ ```json
24
+ "authentication": {
25
+ "auth_method": "request_token",
26
+ "username": "username",
27
+ "password": "password",
28
+ "token_timeout": 1800000,
29
+ "token_cache": "local",
30
+ "invalid_token_error": 401,
31
+ "auth_field": "header.headers.Authorization",
32
+ "auth_field_format": "Bearer {token}",
33
+ "auth_logging": false,
34
+ "tenant_id": "replace_tenant_id",
35
+ "client_id": "replace_client_id",
36
+ "client_secret": "replace_client_secret",
37
+ "grant_type": "client_credentials"
38
+ }
39
+ ```
40
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
41
+
42
+ #### Troubleshooting
43
+ - Make sure you copied over the correct credentials.
44
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
45
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
46
+ - Investigate the logs - in particular:
47
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
48
+ - The FULL BODY log to make sure the payload is accurate.
49
+ - The CALL RETURN log to see what the other system is telling us.
50
+ - 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.
51
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
52
+
53
+ ### Sample Properties
54
+
55
+ 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.
56
+
57
+ ```json
58
+ "properties": {
59
+ "host": "management.azure.com",
60
+ "port": 443,
61
+ "choosepath": "",
62
+ "base_path": "/",
63
+ "version": "",
64
+ "cache_location": "none",
65
+ "encode_pathvars": true,
66
+ "encode_queryvars": true,
67
+ "save_metric": false,
68
+ "stub": true,
69
+ "protocol": "https",
70
+ "apiVersion": "2019-11-01",
71
+ "subscriptionId": "replace_subscriptionId",
72
+ "resourceGroup": [
73
+ "sample-resourceGroup-1",
74
+ "sample-resourceGroup-2"
75
+ ],
76
+ "authentication": {
77
+ "auth_method": "request_token",
78
+ "username": "username",
79
+ "password": "password",
80
+ "token": "token",
81
+ "token_timeout": 1800000,
82
+ "token_cache": "local",
83
+ "invalid_token_error": 401,
84
+ "auth_field": "header.headers.Authorization",
85
+ "auth_field_format": "Bearer {token}",
86
+ "auth_logging": false,
87
+ "tenant_id": "replace_tenant_id",
88
+ "client_id": "replace_client_id",
89
+ "client_secret": "replace_client_secret",
90
+ "grant_type": "client_credentials",
91
+ "sensitive": [],
92
+ "sso": {
93
+ "protocol": "",
94
+ "host": "",
95
+ "port": 0
96
+ },
97
+ "multiStepAuthCalls": [
98
+ {
99
+ "name": "",
100
+ "requestFields": {},
101
+ "responseFields": {},
102
+ "successfullResponseCode": 200
103
+ }
104
+ ]
105
+ },
106
+ "healthcheck": {
107
+ "type": "none",
108
+ "frequency": 60000,
109
+ "query_object": {},
110
+ "addlHeaders": {}
111
+ },
112
+ "throttle": {
113
+ "throttle_enabled": false,
114
+ "number_pronghorns": 1,
115
+ "sync_async": "sync",
116
+ "max_in_queue": 1000,
117
+ "concurrent_max": 1,
118
+ "expire_timeout": 0,
119
+ "avg_runtime": 200,
120
+ "priorities": [
121
+ {
122
+ "value": 0,
123
+ "percent": 100
124
+ }
125
+ ]
126
+ },
127
+ "request": {
128
+ "number_redirects": 0,
129
+ "number_retries": 3,
130
+ "limit_retry_error": [
131
+ 0
132
+ ],
133
+ "failover_codes": [],
134
+ "attempt_timeout": 5000,
135
+ "global_request": {
136
+ "payload": {},
137
+ "uriOptions": {},
138
+ "addlHeaders": {},
139
+ "authData": {}
140
+ },
141
+ "healthcheck_on_timeout": true,
142
+ "return_raw": false,
143
+ "archiving": false,
144
+ "return_request": false
145
+ },
146
+ "proxy": {
147
+ "enabled": false,
148
+ "host": "",
149
+ "port": 1,
150
+ "protocol": "http",
151
+ "username": "",
152
+ "password": ""
153
+ },
154
+ "ssl": {
155
+ "ecdhCurve": "",
156
+ "enabled": false,
157
+ "accept_invalid_cert": false,
158
+ "ca_file": "",
159
+ "key_file": "",
160
+ "cert_file": "",
161
+ "secure_protocol": "",
162
+ "ciphers": ""
163
+ },
164
+ "mongo": {
165
+ "host": "",
166
+ "port": 0,
167
+ "database": "",
168
+ "username": "",
169
+ "password": "",
170
+ "replSet": "",
171
+ "db_ssl": {
172
+ "enabled": false,
173
+ "accept_invalid_cert": false,
174
+ "ca_file": "",
175
+ "key_file": "",
176
+ "cert_file": ""
177
+ }
178
+ },
179
+ "devicebroker": {
180
+ "enabled": false,
181
+ "getDevice": [
182
+ {
183
+ "path": "/not/mapped",
184
+ "method": "GET",
185
+ "query": {},
186
+ "body": {},
187
+ "headers": {},
188
+ "handleFailure": "ignore",
189
+ "requestFields": {
190
+ "insample": "{port}"
191
+ },
192
+ "responseDatakey": "",
193
+ "responseFields": {
194
+ "name": "{this}{||}{that}",
195
+ "ostype": "{osfield}",
196
+ "ostypePrefix": "meraki-",
197
+ "port": "{port}",
198
+ "ipaddress": "{ip_addr}",
199
+ "serial": "{serial}"
200
+ }
201
+ }
202
+ ],
203
+ "getDevicesFiltered": [
204
+ {
205
+ "path": "/not/mapped",
206
+ "method": "GET",
207
+ "pagination": {
208
+ "offsetVar": "",
209
+ "limitVar": "",
210
+ "incrementBy": "limit",
211
+ "requestLocation": "query"
212
+ },
213
+ "query": {},
214
+ "body": {},
215
+ "headers": {},
216
+ "handleFailure": "ignore",
217
+ "requestFields": {},
218
+ "responseDatakey": "",
219
+ "responseFields": {
220
+ "name": "{this}{||}{that}",
221
+ "ostype": "{osfield}",
222
+ "ostypePrefix": "meraki-",
223
+ "port": "{port}",
224
+ "ipaddress": "{ip_addr}",
225
+ "serial": "{serial}",
226
+ "id": "{myid}"
227
+ }
228
+ }
229
+ ],
230
+ "isAlive": [
231
+ {
232
+ "path": "/not/mapped/{devID}",
233
+ "method": "GET",
234
+ "query": {},
235
+ "body": {},
236
+ "headers": {},
237
+ "handleFailure": "ignore",
238
+ "requestFields": {
239
+ "devID": "{id}"
240
+ },
241
+ "responseDatakey": "",
242
+ "responseFields": {
243
+ "status": "return2xx",
244
+ "statusValue": "AD.200"
245
+ }
246
+ }
247
+ ],
248
+ "getConfig": [
249
+ {
250
+ "path": "/not/mapped/{devID}",
251
+ "method": "GET",
252
+ "query": {},
253
+ "body": {},
254
+ "headers": {},
255
+ "handleFailure": "ignore",
256
+ "requestFields": {
257
+ "devID": "{id}"
258
+ },
259
+ "responseDatakey": "",
260
+ "responseFields": {}
261
+ }
262
+ ],
263
+ "getCount": [
264
+ {
265
+ "path": "/not/mapped",
266
+ "method": "GET",
267
+ "query": {},
268
+ "body": {},
269
+ "headers": {},
270
+ "handleFailure": "ignore",
271
+ "requestFields": {},
272
+ "responseDatakey": "",
273
+ "responseFields": {}
274
+ }
275
+ ]
276
+ },
277
+ "cache": {
278
+ "enabled": false,
279
+ "entities": [
280
+ {
281
+ "entityType": "device",
282
+ "frequency": 3600,
283
+ "flushOnFail": false,
284
+ "limit": 10000,
285
+ "retryAttempts": 5,
286
+ "sort": true,
287
+ "populate": [
288
+ {
289
+ "path": "/not/mapped",
290
+ "method": "GET",
291
+ "pagination": {
292
+ "offsetVar": "",
293
+ "limitVar": "",
294
+ "incrementBy": "limit",
295
+ "requestLocation": "query"
296
+ },
297
+ "query": {},
298
+ "body": {},
299
+ "headers": {},
300
+ "handleFailure": "ignore",
301
+ "requestFields": {},
302
+ "responseDatakey": "",
303
+ "responseFields": {
304
+ "name": "{this}{||}{that}",
305
+ "ostype": "{osfield}",
306
+ "ostypePrefix": "meraki-",
307
+ "port": "{port}",
308
+ "ipaddress": "{ip_addr}",
309
+ "serial": "{serial}",
310
+ "id": "{myid}"
311
+ }
312
+ }
313
+ ],
314
+ "cachedTasks": [
315
+ {
316
+ "name": "",
317
+ "filterField": "",
318
+ "filterLoc": ""
319
+ }
320
+ ]
321
+ }
322
+ ]
323
+ }
324
+ }
325
+ ```
326
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/cloud/adapter-azure_aks/-/blob/master/report/adapter-openapi.json)
327
+
328
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/cloud/adapter-azure_aks/-/blob/master/README.md)
329
+
package/metadata.json CHANGED
@@ -42,20 +42,37 @@
42
42
  "isDeprecated": false
43
43
  },
44
44
  "brokerSince": "",
45
+ "authMethods": [
46
+ {
47
+ "type": "Token",
48
+ "primary": true
49
+ }
50
+ ],
45
51
  "documentation": {
46
52
  "storeLink": "",
47
53
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-azure_aks",
48
- "repoLink": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-azure_aks",
54
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-azure_aks",
49
55
  "docLink": "",
50
56
  "demoLinks": [],
51
- "trainingLinks": [],
57
+ "trainingLinks": [
58
+ {
59
+ "title": "Itential Academy",
60
+ "link": "https://www.itential.com/itential-academy/"
61
+ }
62
+ ],
52
63
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
53
64
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
54
65
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
55
66
  "webLink": "https://www.itential.com/adapters/azure-kubernetes-service/",
56
- "vendorLink": "",
57
- "productLink": "",
58
- "apiLinks": []
67
+ "vendorLink": "https://www.microsoft.com/en-us/",
68
+ "productLink": "https://azure.microsoft.com/en-us/products/kubernetes-service",
69
+ "apiLinks": [
70
+ {
71
+ "title": "Azure Kubernetes Service API",
72
+ "link": "https://learn.microsoft.com/en-us/rest/api/aks/?view=rest-aks-2024-02-01",
73
+ "public": true
74
+ }
75
+ ]
59
76
  },
60
77
  "assets": [],
61
78
  "relatedItems": {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-azure_aks",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "This adapter integrates with system described as: Azure AKS.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.14",
7
+ "engineVersion": "1.67.20",
8
8
  "adapterType": "http",
9
9
  "scripts": {
10
10
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -15,7 +15,6 @@
15
15
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
16
16
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
17
17
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
18
- "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
19
18
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
20
19
  "adapter:install": "npm i && node utils/tbScript.js install",
21
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
@@ -44,20 +43,20 @@
44
43
  ],
45
44
  "license": "Apache-2.0",
46
45
  "engines": {
47
- "node": ">= 8.0.0",
46
+ "node": ">= 14.0.0",
48
47
  "npm": ">= 6.0.0"
49
48
  },
50
49
  "repository": {
51
50
  "type": "git",
52
- "url": "git@gitlab.com:itentialopensource/adapters/cloud/adapter-azure_aks.git"
51
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-azure_aks.git"
53
52
  },
54
53
  "author": "Itential",
55
- "homepage": "https://gitlab.com/itentialopensource/adapters/cloud/adapter-azure_aks#readme",
54
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-azure_aks#readme",
56
55
  "dependencies": {
57
- "@itentialopensource/adapter-utils": "^5.3.8",
56
+ "@itentialopensource/adapter-utils": "^5.5.0",
58
57
  "acorn": "^8.10.0",
59
58
  "ajv": "^8.12.0",
60
- "axios": "^1.6.7",
59
+ "axios": "^1.6.8",
61
60
  "commander": "^11.0.0",
62
61
  "dns-lookup-promise": "^1.0.4",
63
62
  "fs-extra": "^11.1.1",
@@ -65,7 +64,6 @@
65
64
  "mocha": "^10.3.0",
66
65
  "mocha-param": "^2.0.1",
67
66
  "mongodb": "^4.16.0",
68
- "nyc": "^15.1.0",
69
67
  "ping": "^0.4.4",
70
68
  "prompts": "^2.4.2",
71
69
  "readline-sync": "^1.4.10",
@@ -945,6 +945,11 @@
945
945
  "devicebroker": {
946
946
  "type": "object",
947
947
  "properties": {
948
+ "enabled": {
949
+ "type": "boolean",
950
+ "description": "Whether or not the device broker calls have been mapped",
951
+ "default": false
952
+ },
948
953
  "getDevice": {
949
954
  "type": "array",
950
955
  "description": "Broker call(s) to getDevice",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.2.0",
3
- "configLines": 10932,
2
+ "version": "0.3.4",
3
+ "configLines": 10937,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 4038,
6
- "testLines": 4865,
6
+ "testLines": 4864,
7
7
  "testCases": 236,
8
- "totalCodeLines": 10686,
8
+ "totalCodeLines": 10685,
9
9
  "wfTasks": 46
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 16
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 21
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.5.0"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 78
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 344
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 647
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 2558
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 136
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 1054
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 30
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 5065
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 166
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }