@itentialopensource/adapter-cisco_ise 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 +18 -0
- package/.jshintrc +3 -0
- package/AUTH.md +34 -0
- package/BROKER.md +211 -0
- package/CALLS.md +2991 -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 +646 -0
- package/README.md +349 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +23 -0
- package/TAB1.md +13 -0
- package/TAB2.md +306 -0
- package/TROUBLESHOOT.md +56 -0
- package/adapter.js +53480 -0
- package/adapterBase.js +1452 -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/ACIConnection/action.json +330 -0
- package/entities/ACIConnection/schema.json +34 -0
- package/entities/ACIData/action.json +205 -0
- package/entities/ACIData/schema.json +28 -0
- package/entities/ADGroups/action.json +25 -0
- package/entities/ADGroups/schema.json +19 -0
- package/entities/ActiveDirectories/action.json +25 -0
- package/entities/ActiveDirectories/schema.json +19 -0
- package/entities/BackupAndRestore/action.json +125 -0
- package/entities/BackupAndRestore/schema.json +24 -0
- package/entities/Certificates/action.json +452 -0
- package/entities/Certificates/schema.json +40 -0
- package/entities/ClassificationRule/action.json +146 -0
- package/entities/ClassificationRule/schema.json +25 -0
- package/entities/Configuration/action.json +24 -0
- package/entities/Configuration/schema.json +19 -0
- package/entities/CustomAttributes/action.json +106 -0
- package/entities/CustomAttributes/schema.json +23 -0
- package/entities/DataconnectServices/action.json +106 -0
- package/entities/DataconnectServices/schema.json +23 -0
- package/entities/DeviceAdminMFARules/action.json +126 -0
- package/entities/DeviceAdminMFARules/schema.json +24 -0
- package/entities/DeviceAdministrationAuthenticationRules/action.json +126 -0
- package/entities/DeviceAdministrationAuthenticationRules/schema.json +24 -0
- package/entities/DeviceAdministrationAuthorizationExceptionRules/action.json +126 -0
- package/entities/DeviceAdministrationAuthorizationExceptionRules/schema.json +24 -0
- package/entities/DeviceAdministrationAuthorizationGlobalExceptionRules/action.json +126 -0
- package/entities/DeviceAdministrationAuthorizationGlobalExceptionRules/schema.json +24 -0
- package/entities/DeviceAdministrationAuthorizationRules/action.json +126 -0
- package/entities/DeviceAdministrationAuthorizationRules/schema.json +24 -0
- package/entities/DeviceAdministrationCommandSets/action.json +25 -0
- package/entities/DeviceAdministrationCommandSets/schema.json +19 -0
- package/entities/DeviceAdministrationConditions/action.json +230 -0
- package/entities/DeviceAdministrationConditions/schema.json +29 -0
- package/entities/DeviceAdministrationDictionaryAttributesList/action.json +67 -0
- package/entities/DeviceAdministrationDictionaryAttributesList/schema.json +21 -0
- package/entities/DeviceAdministrationIdentityStores/action.json +25 -0
- package/entities/DeviceAdministrationIdentityStores/schema.json +19 -0
- package/entities/DeviceAdministrationNetworkConditions/action.json +106 -0
- package/entities/DeviceAdministrationNetworkConditions/schema.json +23 -0
- package/entities/DeviceAdministrationPolicySets/action.json +126 -0
- package/entities/DeviceAdministrationPolicySets/schema.json +24 -0
- package/entities/DeviceAdministrationServiceNames/action.json +25 -0
- package/entities/DeviceAdministrationServiceNames/schema.json +19 -0
- package/entities/DeviceAdministrationShellProfiles/action.json +25 -0
- package/entities/DeviceAdministrationShellProfiles/schema.json +19 -0
- package/entities/DeviceAdministrationTimeDateConditions/action.json +106 -0
- package/entities/DeviceAdministrationTimeDateConditions/schema.json +23 -0
- package/entities/DuoIdentitySync/action.json +168 -0
- package/entities/DuoIdentitySync/schema.json +26 -0
- package/entities/DuoMfa/action.json +147 -0
- package/entities/DuoMfa/schema.json +25 -0
- package/entities/EnableMFA/action.json +24 -0
- package/entities/EnableMFA/schema.json +19 -0
- package/entities/EndpointStopReplicationService/action.json +45 -0
- package/entities/EndpointStopReplicationService/schema.json +20 -0
- package/entities/Endpoints/action.json +207 -0
- package/entities/Endpoints/schema.json +28 -0
- package/entities/ExternalConnection/action.json +25 -0
- package/entities/ExternalConnection/schema.json +19 -0
- package/entities/InboundRule/action.json +166 -0
- package/entities/InboundRule/schema.json +26 -0
- package/entities/LSDSettings/action.json +25 -0
- package/entities/LSDSettings/schema.json +19 -0
- package/entities/Licensing/action.json +231 -0
- package/entities/Licensing/schema.json +29 -0
- package/entities/NBARApplicationManagement/action.json +106 -0
- package/entities/NBARApplicationManagement/schema.json +23 -0
- package/entities/NativeIPsec/action.json +187 -0
- package/entities/NativeIPsec/schema.json +27 -0
- package/entities/NetworkAccessAuthenticationRules/action.json +126 -0
- package/entities/NetworkAccessAuthenticationRules/schema.json +24 -0
- package/entities/NetworkAccessAuthorizationExceptionRules/action.json +126 -0
- package/entities/NetworkAccessAuthorizationExceptionRules/schema.json +24 -0
- package/entities/NetworkAccessAuthorizationGlobalExceptionRules/action.json +126 -0
- package/entities/NetworkAccessAuthorizationGlobalExceptionRules/schema.json +24 -0
- package/entities/NetworkAccessAuthorizationProfiles/action.json +25 -0
- package/entities/NetworkAccessAuthorizationProfiles/schema.json +19 -0
- package/entities/NetworkAccessAuthorizationRules/action.json +126 -0
- package/entities/NetworkAccessAuthorizationRules/schema.json +24 -0
- package/entities/NetworkAccessConditions/action.json +230 -0
- package/entities/NetworkAccessConditions/schema.json +29 -0
- package/entities/NetworkAccessDictionaries/action.json +106 -0
- package/entities/NetworkAccessDictionaries/schema.json +23 -0
- package/entities/NetworkAccessDictionaryAttributes/action.json +106 -0
- package/entities/NetworkAccessDictionaryAttributes/schema.json +23 -0
- package/entities/NetworkAccessDictionaryAttributesList/action.json +67 -0
- package/entities/NetworkAccessDictionaryAttributesList/schema.json +21 -0
- package/entities/NetworkAccessIdentityStores/action.json +25 -0
- package/entities/NetworkAccessIdentityStores/schema.json +19 -0
- package/entities/NetworkAccessMFARules/action.json +126 -0
- package/entities/NetworkAccessMFARules/schema.json +24 -0
- package/entities/NetworkAccessNetworkConditions/action.json +106 -0
- package/entities/NetworkAccessNetworkConditions/schema.json +23 -0
- package/entities/NetworkAccessPolicySets/action.json +126 -0
- package/entities/NetworkAccessPolicySets/schema.json +24 -0
- package/entities/NetworkAccessSecurityGroups/action.json +25 -0
- package/entities/NetworkAccessSecurityGroups/schema.json +19 -0
- package/entities/NetworkAccessServiceNames/action.json +25 -0
- package/entities/NetworkAccessServiceNames/schema.json +19 -0
- package/entities/NetworkAccessTimeDateConditions/action.json +106 -0
- package/entities/NetworkAccessTimeDateConditions/schema.json +23 -0
- package/entities/NodeDeployment/action.json +186 -0
- package/entities/NodeDeployment/schema.json +27 -0
- package/entities/NodeGroup/action.json +167 -0
- package/entities/NodeGroup/schema.json +26 -0
- package/entities/NodeServices/action.json +107 -0
- package/entities/NodeServices/schema.json +23 -0
- package/entities/OutboundRule/action.json +146 -0
- package/entities/OutboundRule/schema.json +25 -0
- package/entities/PANHA/action.json +45 -0
- package/entities/PANHA/schema.json +20 -0
- package/entities/Patch/action.json +252 -0
- package/entities/Patch/schema.json +30 -0
- package/entities/PatchAndHotPatch/action.json +126 -0
- package/entities/PatchAndHotPatch/schema.json +24 -0
- package/entities/PrometheusAlertmanager/action.json +330 -0
- package/entities/PrometheusAlertmanager/schema.json +34 -0
- package/entities/Proxy/action.json +45 -0
- package/entities/Proxy/schema.json +20 -0
- package/entities/PxGridCloud/action.json +107 -0
- package/entities/PxGridCloud/schema.json +23 -0
- package/entities/PxGridDirect/action.json +290 -0
- package/entities/PxGridDirect/schema.json +32 -0
- package/entities/Repository/action.json +127 -0
- package/entities/Repository/schema.json +24 -0
- package/entities/RuleFlow/action.json +24 -0
- package/entities/RuleFlow/schema.json +19 -0
- package/entities/RuleSummary/action.json +24 -0
- package/entities/RuleSummary/schema.json +19 -0
- package/entities/SXP/action.json +67 -0
- package/entities/SXP/schema.json +21 -0
- package/entities/SXPDomainsWithMappingAndDevicesCounts/action.json +25 -0
- package/entities/SXPDomainsWithMappingAndDevicesCounts/schema.json +19 -0
- package/entities/SecurityGroupManagement/action.json +25 -0
- package/entities/SecurityGroupManagement/schema.json +19 -0
- package/entities/Sgt/action.json +25 -0
- package/entities/Sgt/schema.json +19 -0
- package/entities/SgtReservation/action.json +106 -0
- package/entities/SgtReservation/schema.json +23 -0
- package/entities/SharedMappings/action.json +25 -0
- package/entities/SharedMappings/schema.json +19 -0
- package/entities/Subscriber/action.json +147 -0
- package/entities/Subscriber/schema.json +25 -0
- package/entities/TaskService/action.json +46 -0
- package/entities/TaskService/schema.json +20 -0
- package/entities/Telemetry/action.json +45 -0
- package/entities/Telemetry/schema.json +20 -0
- package/entities/TrustSecMatrixPolicy/action.json +46 -0
- package/entities/TrustSecMatrixPolicy/schema.json +20 -0
- package/entities/TrustsecIntegrationRuleDefaultTrustsecIntegrationRuleSet/action.json +25 -0
- package/entities/TrustsecIntegrationRuleDefaultTrustsecIntegrationRuleSet/schema.json +19 -0
- package/entities/TrustsecIntegrationRuleDictionaries/action.json +67 -0
- package/entities/TrustsecIntegrationRuleDictionaries/schema.json +21 -0
- package/entities/TrustsecIntegrationRuleDictionaryAttributes/action.json +130 -0
- package/entities/TrustsecIntegrationRuleDictionaryAttributes/schema.json +24 -0
- package/entities/Upgrade/action.json +168 -0
- package/entities/Upgrade/schema.json +26 -0
- package/entities/UserEquipment/action.json +188 -0
- package/entities/UserEquipment/schema.json +27 -0
- package/entities/VirtualNetworkManagement/action.json +166 -0
- package/entities/VirtualNetworkManagement/schema.json +26 -0
- package/entities/WorkloadConnection/action.json +717 -0
- package/entities/WorkloadConnection/schema.json +53 -0
- package/error.json +190 -0
- package/metadata.json +85 -0
- package/package.json +81 -0
- package/pronghorn.json +22101 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1582 -0
- package/report/adapterInfo.json +10 -0
- package/report/auto-adapter-openapi.json +18045 -0
- package/report/creationReport.json +3745 -0
- package/report/ise.json +40324 -0
- package/sampleProperties.json +257 -0
- package/test/integration/adapterTestBasicGet.js +83 -0
- package/test/integration/adapterTestConnectivity.js +118 -0
- package/test/integration/adapterTestIntegration.js +12350 -0
- package/test/unit/adapterBaseTestUnit.js +1024 -0
- package/test/unit/adapterTestUnit.js +11628 -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/methodDocumentor.js +273 -0
- package/utils/modify.js +152 -0
- package/utils/packModificationScript.js +35 -0
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +239 -0
- package/utils/tbUtils.js +489 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +193 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
/* eslint import/no-unresolved: warn */
|
|
3
|
+
/* eslint global-require: warn */
|
|
4
|
+
|
|
5
|
+
// suppress eslint rule in adapter
|
|
6
|
+
/* eslint arrow-parens: warn */
|
|
7
|
+
/* eslint import/no-extraneous-dependencies: warn */
|
|
8
|
+
/* eslint import/no-dynamic-require: warn */
|
|
9
|
+
|
|
10
|
+
const program = require('commander');
|
|
11
|
+
const rls = require('readline-sync');
|
|
12
|
+
const prompts = require('prompts');
|
|
13
|
+
const utils = require('./tbUtils');
|
|
14
|
+
const basicGet = require('./basicGet');
|
|
15
|
+
const { name } = require('../package.json');
|
|
16
|
+
const sampleProperties = require('../sampleProperties.json');
|
|
17
|
+
const adapterPronghorn = require('../pronghorn.json');
|
|
18
|
+
const { addAuthInfo } = require('./addAuth');
|
|
19
|
+
|
|
20
|
+
const { troubleshoot, offline } = require('./troubleshootingAdapter');
|
|
21
|
+
|
|
22
|
+
const executeInStandaloneMode = async (command) => {
|
|
23
|
+
console.info('\n> Executing the script outside of IAP installation directory');
|
|
24
|
+
console.info('> Using sampleProperties.json configuration');
|
|
25
|
+
switch (command) {
|
|
26
|
+
case 'install': {
|
|
27
|
+
console.error('Not currently in IAP directory - installation not possible');
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
case 'connectivity': {
|
|
31
|
+
const { host } = sampleProperties.properties;
|
|
32
|
+
console.log(`perform networking diagnositics to ${host}`);
|
|
33
|
+
utils.runConnectivity(host);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
case 'healthcheck': {
|
|
37
|
+
const a = basicGet.getAdapterInstance({ properties: sampleProperties });
|
|
38
|
+
await utils.healthCheck(a);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case 'basicget': {
|
|
42
|
+
utils.runBasicGet();
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
default: {
|
|
46
|
+
if (rls.keyInYN('Troubleshooting without IAP?')) {
|
|
47
|
+
await offline();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
process.exit(0);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const getAdapterInstanceConfig = async (command) => {
|
|
55
|
+
const instances = await utils.getAllAdapterInstances();
|
|
56
|
+
if (!instances || instances.length === 0) {
|
|
57
|
+
return console.log('None adapter instances found!');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let instance;
|
|
61
|
+
if (instances.length === 1) {
|
|
62
|
+
[instance] = instances;
|
|
63
|
+
} else {
|
|
64
|
+
const choices = instances.map((item) => ({ title: item.name }));
|
|
65
|
+
const menu = {
|
|
66
|
+
type: 'select',
|
|
67
|
+
name: 'index',
|
|
68
|
+
message: `Pick an adapter for ${command} check`,
|
|
69
|
+
choices
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
console.log('\n');
|
|
73
|
+
const selected = await prompts(menu);
|
|
74
|
+
console.log('\n');
|
|
75
|
+
instance = instances[selected.index];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!instance) {
|
|
79
|
+
console.error('No adapter instance selected');
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const { serviceItem: adapterConfig } = await utils.getAdapterConfig(instance._id); /* eslint-disable-line no-underscore-dangle */
|
|
84
|
+
|
|
85
|
+
console.log('\nAdapter instance configuration =>');
|
|
86
|
+
console.log('======================================');
|
|
87
|
+
console.log(adapterConfig);
|
|
88
|
+
console.log('======================================');
|
|
89
|
+
|
|
90
|
+
return adapterConfig;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const executeCommandOnInstance = async (command) => {
|
|
94
|
+
const adapterConfig = await getAdapterInstanceConfig(command);
|
|
95
|
+
if (!adapterConfig) {
|
|
96
|
+
process.exit(0);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
switch (command) {
|
|
100
|
+
case 'connectivity': {
|
|
101
|
+
const { host } = adapterConfig.properties.properties;
|
|
102
|
+
console.log(`perform networking diagnositics to ${host}`);
|
|
103
|
+
utils.runConnectivity(host, true);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case 'healthcheck': {
|
|
107
|
+
const adapterInstance = basicGet.getAdapterInstance(adapterConfig);
|
|
108
|
+
await utils.healthCheck(adapterInstance);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'basicget': {
|
|
112
|
+
utils.runBasicGet(true);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
case 'troubleshoot': {
|
|
116
|
+
const adapter = { properties: adapterConfig };
|
|
117
|
+
await troubleshoot({}, true, true, adapter);
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
default: {
|
|
121
|
+
console.error(`Unknown command: ${command}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return process.exit(0);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const executeUnderIAPInstallationDirectory = async (command) => {
|
|
128
|
+
if (command === 'install') {
|
|
129
|
+
const { database, serviceItem, pronghornProps } = await utils.getAdapterConfig();
|
|
130
|
+
const filter = { id: pronghornProps.id };
|
|
131
|
+
const profileItem = await database.collection(utils.IAP_PROFILES_COLLECTION).findOne(filter);
|
|
132
|
+
if (!profileItem) {
|
|
133
|
+
console.log(`Could not find IAP profile for id ${pronghornProps.id}`);
|
|
134
|
+
process.exit(0);
|
|
135
|
+
}
|
|
136
|
+
if (serviceItem) {
|
|
137
|
+
console.log(`A service by the name ${name} already exits!`);
|
|
138
|
+
if (rls.keyInYN(`Do you want to completely remove ${name}?`)) {
|
|
139
|
+
console.log(`Removing ${name} from db...`);
|
|
140
|
+
await database.collection(utils.SERVICE_CONFIGS_COLLECTION).deleteOne({ model: name });
|
|
141
|
+
console.log(`${name} removed from db.`);
|
|
142
|
+
if (profileItem.services.includes(serviceItem.name)) {
|
|
143
|
+
const serviceIndex = profileItem.services.indexOf(serviceItem.name);
|
|
144
|
+
profileItem.services.splice(serviceIndex, 1);
|
|
145
|
+
const update = { $set: { services: profileItem.services } };
|
|
146
|
+
await database.collection(utils.IAP_PROFILES_COLLECTION).updateOne({ id: pronghornProps.id }, update);
|
|
147
|
+
console.log(`${serviceItem.name} removed from profileItem.services.`);
|
|
148
|
+
console.log(`Rerun the script to reinstall ${serviceItem.name}.`);
|
|
149
|
+
process.exit(0);
|
|
150
|
+
} else {
|
|
151
|
+
process.exit(0);
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
console.log('Exiting...');
|
|
155
|
+
process.exit(0);
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
const dirname = utils.getCurrentExecutionPath();
|
|
159
|
+
utils.verifyInstallationDir(dirname, name);
|
|
160
|
+
utils.runTest();
|
|
161
|
+
if (rls.keyInYN(`Do you want to install ${name} to IAP?`)) {
|
|
162
|
+
console.log('Creating database entries...');
|
|
163
|
+
const adapter = utils.createAdapter(pronghornProps, profileItem, sampleProperties, adapterPronghorn);
|
|
164
|
+
adapter.properties.properties = await addAuthInfo(adapter.properties.properties);
|
|
165
|
+
|
|
166
|
+
await database.collection(utils.SERVICE_CONFIGS_COLLECTION).insertOne(adapter);
|
|
167
|
+
profileItem.services.push(adapter.name);
|
|
168
|
+
const update = { $set: { services: profileItem.services } };
|
|
169
|
+
await database.collection(utils.IAP_PROFILES_COLLECTION).updateOne({ id: pronghornProps.id }, update);
|
|
170
|
+
console.log('Database entry creation complete.');
|
|
171
|
+
}
|
|
172
|
+
console.log('Exiting...');
|
|
173
|
+
process.exit(0);
|
|
174
|
+
}
|
|
175
|
+
} else if (['healthcheck', 'basicget', 'connectivity', 'troubleshoot'].includes(command)) {
|
|
176
|
+
await executeCommandOnInstance(command);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const main = async (command) => {
|
|
181
|
+
if (!utils.areWeUnderIAPinstallationDirectory()) {
|
|
182
|
+
executeInStandaloneMode(command); // configuration from sampleproperties.json
|
|
183
|
+
} else {
|
|
184
|
+
executeUnderIAPInstallationDirectory(command); // configuration from $IAP_HOME/properties.json
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
program
|
|
189
|
+
.command('connectivity')
|
|
190
|
+
.alias('c')
|
|
191
|
+
.description('networking diagnostics')
|
|
192
|
+
.action(() => {
|
|
193
|
+
main('connectivity');
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
program
|
|
197
|
+
.command('install')
|
|
198
|
+
.alias('i')
|
|
199
|
+
.description('install current adapter')
|
|
200
|
+
.action(() => {
|
|
201
|
+
main('install');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
program
|
|
205
|
+
.command('healthcheck')
|
|
206
|
+
.alias('hc')
|
|
207
|
+
.description('perfom none interative healthcheck with current setting')
|
|
208
|
+
.action(() => {
|
|
209
|
+
main('healthcheck');
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
program
|
|
213
|
+
.command('basicget')
|
|
214
|
+
.alias('bg')
|
|
215
|
+
.description('perfom basicget')
|
|
216
|
+
.action(() => {
|
|
217
|
+
main('basicget');
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
program
|
|
221
|
+
.command('troubleshoot')
|
|
222
|
+
.alias('tb')
|
|
223
|
+
.description('perfom troubleshooting')
|
|
224
|
+
.action(() => {
|
|
225
|
+
main('troubleshoot');
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// Allow commander to parse `process.argv`
|
|
229
|
+
program.parse(process.argv);
|
|
230
|
+
|
|
231
|
+
if (process.argv.length < 3) {
|
|
232
|
+
main();
|
|
233
|
+
}
|
|
234
|
+
const allowedParams = ['install', 'healthcheck', 'basicget', 'connectivity', 'troubleshoot'];
|
|
235
|
+
if (process.argv.length === 3 && !allowedParams.includes(process.argv[2])) {
|
|
236
|
+
console.log(`unknown parameter ${process.argv[2]}`);
|
|
237
|
+
console.log('try `node troubleshootingAdapter.js -h` to see allowed parameters. Exiting...');
|
|
238
|
+
process.exit(0);
|
|
239
|
+
}
|