@itentialopensource/adapter-alkira 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 +6 -0
- package/.eslintrc.js +18 -0
- package/.gitlab/.gitkeep +0 -0
- package/.gitlab/issue_templates/.gitkeep +0 -0
- package/.gitlab/issue_templates/Default.md +17 -0
- package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
- package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
- package/.jshintrc +0 -0
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +2818 -0
- package/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +172 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +641 -0
- package/README.md +337 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +39117 -0
- package/adapterBase.js +1787 -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/ASPathLists/action.json +126 -0
- package/entities/ASPathLists/mockdatafiles/getAllAsPathLists-default.json +13 -0
- package/entities/ASPathLists/schema.json +24 -0
- package/entities/AWSVPCConnectors/action.json +106 -0
- package/entities/AWSVPCConnectors/mockdatafiles/getAWSVPCConnector-default.json +91 -0
- package/entities/AWSVPCConnectors/mockdatafiles/getawsvpcconnectors-default.json +312 -0
- package/entities/AWSVPCConnectors/schema.json +23 -0
- package/entities/AWSVPCCredentials/action.json +64 -0
- package/entities/AWSVPCCredentials/schema.json +21 -0
- package/entities/ActiveNATTranslation/action.json +44 -0
- package/entities/ActiveNATTranslation/schema.json +20 -0
- package/entities/AkamaiProlexicConnectors/action.json +106 -0
- package/entities/AkamaiProlexicConnectors/mockdatafiles/getAkamaiProlexicConnector-default.json +167 -0
- package/entities/AkamaiProlexicConnectors/mockdatafiles/getAkamaiProlexicconnectors-default.json +863 -0
- package/entities/AkamaiProlexicConnectors/schema.json +23 -0
- package/entities/AkamaiProlexicCredentials/action.json +44 -0
- package/entities/AkamaiProlexicCredentials/schema.json +20 -0
- package/entities/Alerts/action.json +67 -0
- package/entities/Alerts/schema.json +21 -0
- package/entities/ArubaEdgeConnectConnectors/action.json +127 -0
- package/entities/ArubaEdgeConnectConnectors/mockdatafiles/getArubaEdgeConnectConnector-default.json +98 -0
- package/entities/ArubaEdgeConnectConnectors/mockdatafiles/getArubaEdgeconnectconnectors-default.json +89 -0
- package/entities/ArubaEdgeConnectConnectors/schema.json +24 -0
- package/entities/ArubaEdgeConnectCredentials/action.json +44 -0
- package/entities/ArubaEdgeConnectCredentials/schema.json +20 -0
- package/entities/AuditLogs/action.json +46 -0
- package/entities/AuditLogs/schema.json +20 -0
- package/entities/Authentication/action.json +165 -0
- package/entities/Authentication/schema.json +26 -0
- package/entities/AzureCredentials/action.json +64 -0
- package/entities/AzureCredentials/schema.json +21 -0
- package/entities/AzureErConnectors/action.json +127 -0
- package/entities/AzureErConnectors/mockdatafiles/getAzureErConnector-default.json +154 -0
- package/entities/AzureErConnectors/mockdatafiles/getAzureErConnectors-default.json +88 -0
- package/entities/AzureErConnectors/schema.json +24 -0
- package/entities/AzureVNETConnectors/action.json +106 -0
- package/entities/AzureVNETConnectors/mockdatafiles/getazurevnetconnectors-default.json +308 -0
- package/entities/AzureVNETConnectors/schema.json +23 -0
- package/entities/BYOIP/action.json +147 -0
- package/entities/BYOIP/mockdatafiles/createBYOIP-default.json +14 -0
- package/entities/BYOIP/mockdatafiles/getAllBYOIP-default.json +16 -0
- package/entities/BYOIP/mockdatafiles/getBYOIP-default.json +58 -0
- package/entities/BYOIP/mockdatafiles/getBYOIPReferences-default.json +110 -0
- package/entities/BYOIP/schema.json +25 -0
- package/entities/BaseConnectors/action.json +46 -0
- package/entities/BaseConnectors/mockdatafiles/getConnector-default.json +78 -0
- package/entities/BaseConnectors/mockdatafiles/getconnectors-default.json +350 -0
- package/entities/BaseConnectors/schema.json +20 -0
- package/entities/BaseServices/action.json +46 -0
- package/entities/BaseServices/mockdatafiles/getservices-default.json +296 -0
- package/entities/BaseServices/schema.json +20 -0
- package/entities/BillingInfo/action.json +25 -0
- package/entities/BillingInfo/schema.json +19 -0
- package/entities/BillingTags/action.json +106 -0
- package/entities/BillingTags/mockdatafiles/getbillingtags-default.json +46 -0
- package/entities/BillingTags/schema.json +23 -0
- package/entities/CXPs/action.json +25 -0
- package/entities/CXPs/mockdatafiles/getCXPs-default.json +44 -0
- package/entities/CXPs/schema.json +19 -0
- package/entities/CheckPointFWManagementServerCredentials/action.json +64 -0
- package/entities/CheckPointFWManagementServerCredentials/schema.json +21 -0
- package/entities/CheckPointFWServiceCredentials/action.json +64 -0
- package/entities/CheckPointFWServiceCredentials/schema.json +21 -0
- package/entities/CheckPointFWServiceInstanceCredentials/action.json +64 -0
- package/entities/CheckPointFWServiceInstanceCredentials/schema.json +21 -0
- package/entities/CheckPointFWServices/action.json +127 -0
- package/entities/CheckPointFWServices/mockdatafiles/getCheckPointFWServices-default.json +94 -0
- package/entities/CheckPointFWServices/schema.json +24 -0
- package/entities/CiscoFTDvFWCredentials/action.json +64 -0
- package/entities/CiscoFTDvFWCredentials/schema.json +21 -0
- package/entities/CiscoFTDvFWInstanceCredentials/action.json +64 -0
- package/entities/CiscoFTDvFWInstanceCredentials/schema.json +21 -0
- package/entities/CiscoFTDvFWServices/action.json +127 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/createCiscoFTDvFWService-default.json +78 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/deleteCiscoFTDvFWService-default.json +87 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/getCiscoFTDvFWService-default.json +51 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/getCiscoFTDvFWServices-default.json +245 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/updateCiscoFTDvFWService-default.json +114 -0
- package/entities/CiscoFTDvFWServices/schema.json +24 -0
- package/entities/CiscoSDWANConnectors/action.json +127 -0
- package/entities/CiscoSDWANConnectors/mockdatafiles/getciscosdwaningresses-default.json +559 -0
- package/entities/CiscoSDWANConnectors/schema.json +24 -0
- package/entities/CiscoSDWANInstanceCredentials/action.json +64 -0
- package/entities/CiscoSDWANInstanceCredentials/schema.json +21 -0
- package/entities/CloudInsight/action.json +107 -0
- package/entities/CloudInsight/mockdatafiles/getCloudInsight-default.json +93 -0
- package/entities/CloudInsight/mockdatafiles/getCloudInsightCategorySummaries-default.json +348 -0
- package/entities/CloudInsight/schema.json +23 -0
- package/entities/CloudInsightDefinition/action.json +87 -0
- package/entities/CloudInsightDefinition/schema.json +22 -0
- package/entities/CloudInsightRefreshRequest/action.json +86 -0
- package/entities/CloudInsightRefreshRequest/mockdatafiles/getCloudInsightRefreshRequest-default.json +6 -0
- package/entities/CloudInsightRefreshRequest/schema.json +22 -0
- package/entities/CloudInsightReport/action.json +86 -0
- package/entities/CloudInsightReport/mockdatafiles/getCloudInsightReport-default.json +617 -0
- package/entities/CloudInsightReport/schema.json +22 -0
- package/entities/CloudInsightReportConfiguration/action.json +86 -0
- package/entities/CloudInsightReportConfiguration/mockdatafiles/getCloudInsightReportConfiguration-default.json +34 -0
- package/entities/CloudInsightReportConfiguration/schema.json +22 -0
- package/entities/CloudNativeServices/action.json +25 -0
- package/entities/CloudNativeServices/mockdatafiles/getCloudNativeServices-default.json +83 -0
- package/entities/CloudNativeServices/schema.json +19 -0
- package/entities/CloudProviderAccount/action.json +126 -0
- package/entities/CloudProviderAccount/mockdatafiles/getCloudProviderAccount-default.json +10 -0
- package/entities/CloudProviderAccount/mockdatafiles/getCloudProviderAccounts-default.json +32 -0
- package/entities/CloudProviderAccount/schema.json +24 -0
- package/entities/CloudProviderObject/action.json +109 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObject-default.json +52 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObjectCountByTimes-default.json +27 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObjectCounts-default.json +22 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObjectTags-default.json +23 -0
- package/entities/CloudProviderObject/schema.json +23 -0
- package/entities/CloudProviderObjectSyncRequest/action.json +86 -0
- package/entities/CloudProviderObjectSyncRequest/mockdatafiles/getCloudProviderObjectSyncRequest-default.json +10 -0
- package/entities/CloudProviderObjectSyncRequest/schema.json +22 -0
- package/entities/CommunityLists/action.json +126 -0
- package/entities/CommunityLists/mockdatafiles/getAllCommunityLists-default.json +42 -0
- package/entities/CommunityLists/schema.json +24 -0
- package/entities/Credentials/action.json +25 -0
- package/entities/Credentials/mockdatafiles/getallcredentials-default.json +14 -0
- package/entities/Credentials/schema.json +19 -0
- package/entities/DirectConnectConnectors/action.json +127 -0
- package/entities/DirectConnectConnectors/mockdatafiles/getdirectconnectconnectors-default.json +862 -0
- package/entities/DirectConnectConnectors/schema.json +24 -0
- package/entities/ExtendedCommunityLists/action.json +126 -0
- package/entities/ExtendedCommunityLists/mockdatafiles/getAllExtendedCommunityLists-default.json +50 -0
- package/entities/ExtendedCommunityLists/schema.json +24 -0
- package/entities/FeatureFlags/action.json +46 -0
- package/entities/FeatureFlags/mockdatafiles/getTenantEnabledFeatures-default.json +3 -0
- package/entities/FeatureFlags/schema.json +20 -0
- package/entities/FirewallZones/action.json +46 -0
- package/entities/FirewallZones/mockdatafiles/getfirewallzones-default.json +91 -0
- package/entities/FirewallZones/schema.json +20 -0
- package/entities/FlowCapture/action.json +44 -0
- package/entities/FlowCapture/schema.json +20 -0
- package/entities/Flows/action.json +151 -0
- package/entities/Flows/schema.json +25 -0
- package/entities/FortinetFWServiceCredentials/action.json +64 -0
- package/entities/FortinetFWServiceCredentials/schema.json +21 -0
- package/entities/FortinetFWServiceInstanceCredentials/action.json +64 -0
- package/entities/FortinetFWServiceInstanceCredentials/schema.json +21 -0
- package/entities/FortinetFWServices/action.json +127 -0
- package/entities/FortinetFWServices/mockdatafiles/createFortinetFWService-default.json +64 -0
- package/entities/FortinetFWServices/mockdatafiles/getFortinetFWService-default.json +64 -0
- package/entities/FortinetFWServices/mockdatafiles/getFortinetFWServices-default.json +155 -0
- package/entities/FortinetFWServices/mockdatafiles/updateFortinetFWService-default.json +93 -0
- package/entities/FortinetFWServices/schema.json +24 -0
- package/entities/GCPConnectors/action.json +106 -0
- package/entities/GCPConnectors/mockdatafiles/getgcpconnectors-default.json +71 -0
- package/entities/GCPConnectors/schema.json +23 -0
- package/entities/GCPCredentials/action.json +64 -0
- package/entities/GCPCredentials/schema.json +21 -0
- package/entities/GetMessages/action.json +25 -0
- package/entities/GetMessages/mockdatafiles/getMessages-default.json +46 -0
- package/entities/GetMessages/schema.json +19 -0
- package/entities/GlobalCidrLists/action.json +106 -0
- package/entities/GlobalCidrLists/mockdatafiles/createGlobalCidrList-default.json +12 -0
- package/entities/GlobalCidrLists/mockdatafiles/getGlobalCidrList-default.json +12 -0
- package/entities/GlobalCidrLists/mockdatafiles/getGlobalCidrLists-default.json +50 -0
- package/entities/GlobalCidrLists/mockdatafiles/updateGlobalCidrList-default.json +12 -0
- package/entities/GlobalCidrLists/schema.json +34 -0
- package/entities/Groups/action.json +106 -0
- package/entities/Groups/mockdatafiles/getgroups-default.json +107 -0
- package/entities/Groups/schema.json +23 -0
- package/entities/Health/action.json +151 -0
- package/entities/Health/mockdatafiles/retrieveshealthforallconnectorsandservicesinthistenant-default.json +399 -0
- package/entities/Health/mockdatafiles/retrieveshealthforallinternetapplicationsinthistenant-default.json +1254 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificconnectorinthistenant-default.json +751 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificfirewalzoneinthistenant-default.json +1086 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificinstanceofaconnectorinthistenant-default.json +1352 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificinstanceofaserviceinthistenant-default.json +803 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificserviceinthistenant-default.json +730 -0
- package/entities/Health/schema.json +25 -0
- package/entities/Healthv3/action.json +25 -0
- package/entities/Healthv3/schema.json +19 -0
- package/entities/IPSecConnectors/action.json +127 -0
- package/entities/IPSecConnectors/mockdatafiles/getipsecconnectors-default.json +826 -0
- package/entities/IPSecConnectors/schema.json +24 -0
- package/entities/IdentityProviders/action.json +106 -0
- package/entities/IdentityProviders/mockdatafiles/getIdentityProvidersUsingGET-default.json +37 -0
- package/entities/IdentityProviders/schema.json +23 -0
- package/entities/InfoBloxCredentials/action.json +24 -0
- package/entities/InfoBloxCredentials/schema.json +19 -0
- package/entities/InfoBloxGridMasterCredentials/action.json +24 -0
- package/entities/InfoBloxGridMasterCredentials/schema.json +19 -0
- package/entities/InfoBloxInstanceCredentials/action.json +24 -0
- package/entities/InfoBloxInstanceCredentials/schema.json +19 -0
- package/entities/InfoBloxServices/action.json +106 -0
- package/entities/InfoBloxServices/mockdatafiles/getInfoBloxServices-default.json +220 -0
- package/entities/InfoBloxServices/schema.json +23 -0
- package/entities/Integration/action.json +126 -0
- package/entities/Integration/mockdatafiles/createIntegration-default.json +6 -0
- package/entities/Integration/mockdatafiles/deleteIntegration-default.json +6 -0
- package/entities/Integration/mockdatafiles/deleteIntegrations-default.json +8 -0
- package/entities/Integration/mockdatafiles/getIntegrations-default.json +26 -0
- package/entities/Integration/mockdatafiles/getIntegrationsByTypeAndSubType-default.json +20 -0
- package/entities/Integration/mockdatafiles/updateIntegration-default.json +6 -0
- package/entities/Integration/schema.json +24 -0
- package/entities/InternetApplications/action.json +106 -0
- package/entities/InternetApplications/mockdatafiles/getinternetapplications-default.json +383 -0
- package/entities/InternetApplications/schema.json +23 -0
- package/entities/InternetConnectors/action.json +127 -0
- package/entities/InternetConnectors/mockdatafiles/getInternetConnectorConfiguration-default.json +35 -0
- package/entities/InternetConnectors/mockdatafiles/getinternetconnectors-default.json +30 -0
- package/entities/InternetConnectors/schema.json +24 -0
- package/entities/InvoiceSummaries/action.json +46 -0
- package/entities/InvoiceSummaries/schema.json +20 -0
- package/entities/Invoices/action.json +46 -0
- package/entities/Invoices/schema.json +20 -0
- package/entities/Jobs/action.json +46 -0
- package/entities/Jobs/schema.json +20 -0
- package/entities/KeyPairCredentials/action.json +44 -0
- package/entities/KeyPairCredentials/schema.json +20 -0
- package/entities/LDAPCredentials/action.json +64 -0
- package/entities/LDAPCredentials/schema.json +21 -0
- package/entities/LoginSpecification/action.json +65 -0
- package/entities/LoginSpecification/mockdatafiles/createOrUpdateLoginSpecification-default.json +6 -0
- package/entities/LoginSpecification/mockdatafiles/getLoginSpecification-default.json +6 -0
- package/entities/LoginSpecification/schema.json +21 -0
- package/entities/Logs/action.json +44 -0
- package/entities/Logs/schema.json +20 -0
- package/entities/Meters/action.json +46 -0
- package/entities/Meters/schema.json +20 -0
- package/entities/NATPolicies/action.json +106 -0
- package/entities/NATPolicies/mockdatafiles/getNATPolicies-default.json +46 -0
- package/entities/NATPolicies/schema.json +34 -0
- package/entities/NATRules/action.json +106 -0
- package/entities/NATRules/mockdatafiles/getNATRules-default.json +312 -0
- package/entities/NATRules/schema.json +34 -0
- package/entities/OCIVCNConnectors/action.json +106 -0
- package/entities/OCIVCNConnectors/mockdatafiles/getOCIVCNConnectors-default.json +148 -0
- package/entities/OCIVCNConnectors/schema.json +34 -0
- package/entities/OCIVCNCredentials/action.json +64 -0
- package/entities/OCIVCNCredentials/schema.json +21 -0
- package/entities/OneTimePassword/action.json +85 -0
- package/entities/OneTimePassword/mockdatafiles/createOneTimePassword-default.json +10 -0
- package/entities/OneTimePassword/mockdatafiles/getAllUnexpiredOTP-default.json +42 -0
- package/entities/OneTimePassword/schema.json +22 -0
- package/entities/PANCredentials/action.json +64 -0
- package/entities/PANCredentials/schema.json +21 -0
- package/entities/PANFWServices/action.json +188 -0
- package/entities/PANFWServices/mockdatafiles/getpanfwservices-default.json +455 -0
- package/entities/PANFWServices/schema.json +27 -0
- package/entities/PANInstanceCredentials/action.json +64 -0
- package/entities/PANInstanceCredentials/schema.json +21 -0
- package/entities/PANMasterKeyCredentials/action.json +64 -0
- package/entities/PANMasterKeyCredentials/schema.json +21 -0
- package/entities/PANRegistrationCredentials/action.json +64 -0
- package/entities/PANRegistrationCredentials/schema.json +21 -0
- package/entities/PacketCapture/action.json +66 -0
- package/entities/PacketCapture/mockdatafiles/getPacketCaptureResponses-default.json +35 -0
- package/entities/PacketCapture/schema.json +32 -0
- package/entities/PasswordSpecification/action.json +65 -0
- package/entities/PasswordSpecification/mockdatafiles/createOrUpdatePasswordSpecification-default.json +9 -0
- package/entities/PasswordSpecification/mockdatafiles/getPasswordSpecification-default.json +9 -0
- package/entities/PasswordSpecification/schema.json +21 -0
- package/entities/Permissions/action.json +25 -0
- package/entities/Permissions/mockdatafiles/getPermissionsUsingGET-default.json +5 -0
- package/entities/Permissions/schema.json +19 -0
- package/entities/Ping/action.json +44 -0
- package/entities/Ping/schema.json +20 -0
- package/entities/Policies/action.json +106 -0
- package/entities/Policies/mockdatafiles/getPolicies-default.json +42 -0
- package/entities/Policies/schema.json +23 -0
- package/entities/Prefixlists/action.json +106 -0
- package/entities/Prefixlists/mockdatafiles/getPrefixlists-default.json +75 -0
- package/entities/Prefixlists/schema.json +23 -0
- package/entities/Products/action.json +25 -0
- package/entities/Products/mockdatafiles/listofallproducts-default.json +136 -0
- package/entities/Products/schema.json +19 -0
- package/entities/RemoteAccess/action.json +172 -0
- package/entities/RemoteAccess/schema.json +26 -0
- package/entities/RemoteAccessConnectorTemplates/action.json +106 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/createConnectorTemplate-default.json +683 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/deleteConnectorTemplate-default.json +146 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/getConnectorTemplate-default.json +89 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/getConnectorTemplates-default.json +2408 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/updateConnectorTemplate-default.json +632 -0
- package/entities/RemoteAccessConnectorTemplates/schema.json +23 -0
- package/entities/RemoteAccessConnectors/action.json +107 -0
- package/entities/RemoteAccessConnectors/mockdatafiles/getRemoteAccessConnectors-default.json +629 -0
- package/entities/RemoteAccessConnectors/mockdatafiles/getRemoteAccesssConnector-default.json +662 -0
- package/entities/RemoteAccessConnectors/schema.json +23 -0
- package/entities/ResourceLimits/action.json +25 -0
- package/entities/ResourceLimits/mockdatafiles/getTenantResourceLimits-default.json +10 -0
- package/entities/ResourceLimits/schema.json +19 -0
- package/entities/ResourceUsage/action.json +25 -0
- package/entities/ResourceUsage/mockdatafiles/getResourceUsage-default.json +183 -0
- package/entities/ResourceUsage/schema.json +19 -0
- package/entities/Roles/action.json +106 -0
- package/entities/Roles/mockdatafiles/getRolesUsingGET-default.json +22 -0
- package/entities/Roles/schema.json +23 -0
- package/entities/RoutePolicies/action.json +126 -0
- package/entities/RoutePolicies/mockdatafiles/getAllRoutePolicies-default.json +388 -0
- package/entities/RoutePolicies/schema.json +24 -0
- package/entities/Routes/action.json +25 -0
- package/entities/Routes/schema.json +19 -0
- package/entities/Rulelists/action.json +106 -0
- package/entities/Rulelists/mockdatafiles/getRulelists-default.json +18 -0
- package/entities/Rulelists/schema.json +23 -0
- package/entities/Rules/action.json +106 -0
- package/entities/Rules/mockdatafiles/getRules-default.json +76 -0
- package/entities/Rules/schema.json +23 -0
- package/entities/SegmentResourceShares/action.json +106 -0
- package/entities/SegmentResourceShares/mockdatafiles/getSegmentResourceShares-default.json +64 -0
- package/entities/SegmentResourceShares/schema.json +34 -0
- package/entities/SegmentResources/action.json +106 -0
- package/entities/SegmentResources/mockdatafiles/getsegmentResources-default.json +108 -0
- package/entities/SegmentResources/schema.json +23 -0
- package/entities/Segments/action.json +106 -0
- package/entities/Segments/mockdatafiles/getsegments-default.json +196 -0
- package/entities/Segments/schema.json +23 -0
- package/entities/SplunkHECTokenCredentials/action.json +64 -0
- package/entities/SplunkHECTokenCredentials/schema.json +21 -0
- package/entities/Tenant/action.json +45 -0
- package/entities/Tenant/mockdatafiles/getTenant-default.json +14 -0
- package/entities/Tenant/mockdatafiles/updateTenant-default.json +14 -0
- package/entities/Tenant/schema.json +20 -0
- package/entities/TenantNetworks/action.json +126 -0
- package/entities/TenantNetworks/mockdatafiles/getTenantNetworks-default.json +5816 -0
- package/entities/TenantNetworks/schema.json +24 -0
- package/entities/TenantPreferences/action.json +45 -0
- package/entities/TenantPreferences/mockdatafiles/getTenantPreferences-default.json +10 -0
- package/entities/TenantPreferences/schema.json +20 -0
- package/entities/TraceRoute/action.json +44 -0
- package/entities/TraceRoute/schema.json +20 -0
- package/entities/Traffic/action.json +130 -0
- package/entities/Traffic/mockdatafiles/retrievesactivesessionscountforservicesinthistenant-default.json +18 -0
- package/entities/Traffic/mockdatafiles/retrievesinstancecountforservicesinthistenant-default.json +18 -0
- package/entities/Traffic/mockdatafiles/retrievestheInterCXPtraffic-default.json +53 -0
- package/entities/Traffic/mockdatafiles/retrievestheoveralltrafficgoingtointernetfromCXP-default.json +140 -0
- package/entities/Traffic/mockdatafiles/retrievestrafficstatsforconnectorsinthistenant-default.json +126 -0
- package/entities/Traffic/mockdatafiles/retrievestrafficstatsforservicesinthistenant-default.json +126 -0
- package/entities/Traffic/schema.json +24 -0
- package/entities/UserGroups/action.json +208 -0
- package/entities/UserGroups/mockdatafiles/getUserFromUserGroup-default.json +17 -0
- package/entities/UserGroups/mockdatafiles/getUsersInUserGroup-default.json +19 -0
- package/entities/UserGroups/mockdatafiles/getusergroups-default.json +23 -0
- package/entities/UserGroups/schema.json +28 -0
- package/entities/UsernamePasswordCredentials/action.json +64 -0
- package/entities/UsernamePasswordCredentials/schema.json +21 -0
- package/entities/Users/action.json +147 -0
- package/entities/Users/mockdatafiles/createUsersUsingPOST-default.json +17 -0
- package/entities/Users/mockdatafiles/getAllUsersUsingGET-default.json +70 -0
- package/entities/Users/mockdatafiles/getUsersByIdUsingGET-default.json +17 -0
- package/entities/Users/mockdatafiles/updateUsersByIdUsingPUT-default.json +17 -0
- package/entities/Users/schema.json +25 -0
- package/entities/ZscalerInternetAccessServices/action.json +106 -0
- package/entities/ZscalerInternetAccessServices/mockdatafiles/getZscalerInternetAccessServices-default.json +84 -0
- package/entities/ZscalerInternetAccessServices/schema.json +23 -0
- package/error.json +190 -0
- package/package.json +86 -0
- package/pronghorn.json +44773 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1248 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/alkira_swagger.json-OpenApi3Json.json +50699 -0
- package/report/creationReport.json +3472 -0
- package/sampleProperties.json +195 -0
- package/test/integration/adapterTestBasicGet.js +83 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +12410 -0
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +19120 -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 +178 -0
- package/utils/findPath.js +74 -0
- package/utils/methodDocumentor.js +225 -0
- package/utils/modify.js +154 -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/tbScript.js +246 -0
- package/utils/tbUtils.js +490 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +195 -0
- package/workflows/README.md +3 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const semverSatisfies = require('semver/functions/satisfies');
|
|
3
|
+
const packageJson = require('../package.json');
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
// pattern supplied by semver.org via https://regex101.com/r/vkijKf/1/ but removed gm from end to only match a single semver
|
|
7
|
+
// const semverPat = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
8
|
+
// pattern supplied by semver.org via https://regex101.com/r/Ly7O1x/3/ with following changes
|
|
9
|
+
// removed P's from before capturing group names and
|
|
10
|
+
// removed gm from end to only match a single semver
|
|
11
|
+
// const semverPat = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
12
|
+
|
|
13
|
+
const patches = (fs.existsSync('./patches')) ? fs.readdirSync('./patches', { withFileTypes: true }) : [];
|
|
14
|
+
if (!patches.length) {
|
|
15
|
+
console.error('\nno patches - nothing to do\n');
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const dependencies = packageJson.dependencies || {};
|
|
20
|
+
if (!Object.keys(dependencies).length) {
|
|
21
|
+
console.error('\nno dependencies - nothing to do\n');
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let changed = false;
|
|
26
|
+
console.error('\nprocessing patches');
|
|
27
|
+
const bundledDependencies = packageJson.bundledDependencies || packageJson.bundleDependencies || [];
|
|
28
|
+
|
|
29
|
+
patches.forEach((patch) => {
|
|
30
|
+
if (!patch.isFile()) {
|
|
31
|
+
console.error(`${patch.name} skipped, is not a regular file`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (!patch.name.endsWith('.patch')) {
|
|
35
|
+
console.error(`${patch.name} skipped, does not end with .patch`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const splits = patch.name.slice(0, -6).split('+');
|
|
39
|
+
if (splits.length > 4) {
|
|
40
|
+
console.error(`${patch.name} skipped, does not follow the naming convention (cannot use '+' other than to separate scope/package/semver and at most once within semver)`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const scope = splits[0][0] === '@' ? splits.shift() : null;
|
|
44
|
+
const packageName = splits.shift();
|
|
45
|
+
const semver = splits.join('+');
|
|
46
|
+
// const { groups } = semver.match(semverPat);
|
|
47
|
+
const file = scope ? `${scope}/${packageName}` : packageName;
|
|
48
|
+
if (dependencies[file] && semverSatisfies(semver, dependencies[file])) {
|
|
49
|
+
if (!bundledDependencies.includes(file)) {
|
|
50
|
+
bundledDependencies.push(file);
|
|
51
|
+
console.error(`added ${file} to bundledDependencies`);
|
|
52
|
+
changed = true;
|
|
53
|
+
} else {
|
|
54
|
+
console.error(`bundledDependencies already has ${file}`);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
const depmsg = dependencies[file] ? `version mismatch (${dependencies[file]}) in dependencies` : 'not found in dependencies';
|
|
58
|
+
console.error(`patch ${patch.name} ${depmsg}`);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (!packageJson.bundledDependencies && bundledDependencies.length) {
|
|
63
|
+
delete packageJson.bundleDependencies;
|
|
64
|
+
packageJson.bundledDependencies = bundledDependencies;
|
|
65
|
+
console.error('renaming bundleDependencies to bundledDependencies');
|
|
66
|
+
changed = true;
|
|
67
|
+
}
|
|
68
|
+
if (changed) {
|
|
69
|
+
fs.writeFileSync('./package.json.new', JSON.stringify(packageJson, null, 2));
|
|
70
|
+
console.error('wrote package.json.new');
|
|
71
|
+
fs.renameSync('./package.json', './package.json.old');
|
|
72
|
+
console.error('moved package.json to package.json.old');
|
|
73
|
+
fs.renameSync('./package.json.new', './package.json');
|
|
74
|
+
console.error('moved package.json.new to package.json');
|
|
75
|
+
} else {
|
|
76
|
+
console.error('no changes\n');
|
|
77
|
+
process.exitCode = 1;
|
|
78
|
+
}
|
|
79
|
+
} catch (e) {
|
|
80
|
+
if (e) {
|
|
81
|
+
// caught error, exit with status 2 to signify abject failure
|
|
82
|
+
console.error(`\ncaught exception - ${e}\n`);
|
|
83
|
+
process.exitCode = 2;
|
|
84
|
+
} else {
|
|
85
|
+
// caught false, exit with status 1 to signify nothing done
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
}
|
|
88
|
+
} finally {
|
|
89
|
+
console.error('done\n');
|
|
90
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# @copyright Itential, LLC 2019
|
|
3
|
+
|
|
4
|
+
#exit on any failure in the pipeline
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# --------------------------------------------------
|
|
8
|
+
# pre-commit
|
|
9
|
+
# --------------------------------------------------
|
|
10
|
+
# Contains the standard set of tasks to runbefore
|
|
11
|
+
# committing changes to the repo. If any tasks fail
|
|
12
|
+
# then the commit will be aborted.
|
|
13
|
+
# --------------------------------------------------
|
|
14
|
+
|
|
15
|
+
printf "%b" "Running pre-commit hooks...\\n"
|
|
16
|
+
|
|
17
|
+
# verify testing script is stubbed and no credentials
|
|
18
|
+
node utils/testRunner.js -r
|
|
19
|
+
|
|
20
|
+
# update the adapter information file
|
|
21
|
+
node utils/adapterInfo.js
|
|
22
|
+
node utils/methodDocumentor.js
|
|
23
|
+
git add CALLS.md report/adapterInfo.json
|
|
24
|
+
|
|
25
|
+
# security audit on the code
|
|
26
|
+
npm audit --registry=https://registry.npmjs.org --audit-level=moderate
|
|
27
|
+
|
|
28
|
+
# lint the code
|
|
29
|
+
npm run lint
|
|
30
|
+
|
|
31
|
+
# test the code
|
|
32
|
+
npm run test
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This script will uninstall pre-commit or pre-push hooks in case there's ever a need to
|
|
5
|
+
* commit/push something that has issues
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const precommitPath = '.git/hooks/pre-commit';
|
|
9
|
+
const prepushPath = '.git/hooks/pre-push';
|
|
10
|
+
fs.unlink(precommitPath, (err) => {
|
|
11
|
+
if (err && err.code !== 'ENOENT') {
|
|
12
|
+
console.log(`${err.message}`);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
fs.unlink(prepushPath, (err) => {
|
|
17
|
+
if (err && err.code !== 'ENOENT') {
|
|
18
|
+
console.log(`${err.message}`);
|
|
19
|
+
}
|
|
20
|
+
});
|
package/utils/setup.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* @copyright Itential, LLC 2019 */
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This script will execute before an npm install command. The purpose is to
|
|
8
|
+
* write out some standard git hooks that will enable folks working on this
|
|
9
|
+
* project to benefit from the protections that the hooks provide.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const precommit = fs.readFileSync('utils/pre-commit.sh', 'utf8');
|
|
13
|
+
|
|
14
|
+
fs.stat('.git', (err) => {
|
|
15
|
+
if (err == null) {
|
|
16
|
+
// git repo, not an npm repo.
|
|
17
|
+
// add pre-commit hook if it doesn't exist
|
|
18
|
+
fs.stat('.git/hooks/pre-commit', (statErr) => {
|
|
19
|
+
if (statErr == null || statErr.code === 'ENOENT') {
|
|
20
|
+
fs.writeFile('.git/hooks/pre-commit', precommit, {
|
|
21
|
+
mode: 0o755
|
|
22
|
+
}, (writeErr) => {
|
|
23
|
+
if (writeErr) {
|
|
24
|
+
return console.log(writeErr.message);
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
console.log(statErr.message);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,246 @@
|
|
|
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(
|
|
147
|
+
{ id: pronghornProps.id }, update
|
|
148
|
+
);
|
|
149
|
+
console.log(`${serviceItem.name} removed from profileItem.services.`);
|
|
150
|
+
console.log(`Rerun the script to reinstall ${serviceItem.name}.`);
|
|
151
|
+
process.exit(0);
|
|
152
|
+
} else {
|
|
153
|
+
process.exit(0);
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
console.log('Exiting...');
|
|
157
|
+
process.exit(0);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
const dirname = utils.getCurrentExecutionPath();
|
|
161
|
+
utils.verifyInstallationDir(dirname, name);
|
|
162
|
+
utils.runTest();
|
|
163
|
+
if (rls.keyInYN(`Do you want to install ${name} to IAP?`)) {
|
|
164
|
+
console.log('Creating database entries...');
|
|
165
|
+
const adapter = utils.createAdapter(
|
|
166
|
+
pronghornProps, profileItem, sampleProperties, adapterPronghorn
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
adapter.properties.properties = await addAuthInfo(adapter.properties.properties);
|
|
170
|
+
|
|
171
|
+
await database.collection(utils.SERVICE_CONFIGS_COLLECTION).insertOne(adapter);
|
|
172
|
+
profileItem.services.push(adapter.name);
|
|
173
|
+
const update = { $set: { services: profileItem.services } };
|
|
174
|
+
await database.collection(utils.IAP_PROFILES_COLLECTION).updateOne(
|
|
175
|
+
{ id: pronghornProps.id }, update
|
|
176
|
+
);
|
|
177
|
+
console.log('Database entry creation complete.');
|
|
178
|
+
}
|
|
179
|
+
console.log('Exiting...');
|
|
180
|
+
process.exit(0);
|
|
181
|
+
}
|
|
182
|
+
} else if (['healthcheck', 'basicget', 'connectivity', 'troubleshoot'].includes(command)) {
|
|
183
|
+
await executeCommandOnInstance(command);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const main = async (command) => {
|
|
188
|
+
if (!utils.areWeUnderIAPinstallationDirectory()) {
|
|
189
|
+
executeInStandaloneMode(command); // configuration from sampleproperties.json
|
|
190
|
+
} else {
|
|
191
|
+
executeUnderIAPInstallationDirectory(command); // configuration from $IAP_HOME/properties.json
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
program
|
|
196
|
+
.command('connectivity')
|
|
197
|
+
.alias('c')
|
|
198
|
+
.description('networking diagnostics')
|
|
199
|
+
.action(() => {
|
|
200
|
+
main('connectivity');
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
program
|
|
204
|
+
.command('install')
|
|
205
|
+
.alias('i')
|
|
206
|
+
.description('install current adapter')
|
|
207
|
+
.action(() => {
|
|
208
|
+
main('install');
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
program
|
|
212
|
+
.command('healthcheck')
|
|
213
|
+
.alias('hc')
|
|
214
|
+
.description('perfom none interative healthcheck with current setting')
|
|
215
|
+
.action(() => {
|
|
216
|
+
main('healthcheck');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
program
|
|
220
|
+
.command('basicget')
|
|
221
|
+
.alias('bg')
|
|
222
|
+
.description('perfom basicget')
|
|
223
|
+
.action(() => {
|
|
224
|
+
main('basicget');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
program
|
|
228
|
+
.command('troubleshoot')
|
|
229
|
+
.alias('tb')
|
|
230
|
+
.description('perfom troubleshooting')
|
|
231
|
+
.action(() => {
|
|
232
|
+
main('troubleshoot');
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// Allow commander to parse `process.argv`
|
|
236
|
+
program.parse(process.argv);
|
|
237
|
+
|
|
238
|
+
if (process.argv.length < 3) {
|
|
239
|
+
main();
|
|
240
|
+
}
|
|
241
|
+
const allowedParams = ['install', 'healthcheck', 'basicget', 'connectivity', 'troubleshoot'];
|
|
242
|
+
if (process.argv.length === 3 && !allowedParams.includes(process.argv[2])) {
|
|
243
|
+
console.log(`unknown parameter ${process.argv[2]}`);
|
|
244
|
+
console.log('try `node troubleshootingAdapter.js -h` to see allowed parameters. Exiting...');
|
|
245
|
+
process.exit(0);
|
|
246
|
+
}
|