From 3bc14393460b90207af7d99aab97cbab0b019853 Mon Sep 17 00:00:00 2001 From: Garrett Dieckmann Date: Mon, 24 Jan 2022 10:13:44 -0800 Subject: [PATCH] merge v1.26.0 into master branch --- CHANGELOG.md | 8 + README.md | 2 +- SUPPORT.md | 3 +- contributing/README.md | 2 +- contributing/process_release.md | 3 + docs/conf.py | 2 +- docs/output-example.rst | 45 +- docs/revision-history.rst | 6 +- docs/setting-up-consumer.rst | 4 + docs/troubleshooting.rst | 110 +- examples/output/system_poller/output.json | 36 + package-lock.json | 256 +++- package.json | 24 +- src/lib/actionProcessor.js | 2 +- src/lib/config.js | 2 +- src/lib/constants.js | 11 +- src/lib/consumers.js | 2 +- src/lib/consumers/AWS_CloudWatch/index.js | 2 +- src/lib/consumers/AWS_S3/index.js | 2 +- .../Azure_Application_Insights/index.js | 2 +- .../consumers/Azure_Log_Analytics/index.js | 2 +- src/lib/consumers/DataDog/index.js | 2 +- src/lib/consumers/ElasticSearch/index.js | 2 +- src/lib/consumers/F5_Cloud/index.js | 2 +- src/lib/consumers/Generic_HTTP/index.js | 2 +- .../consumers/Google_Cloud_Logging/index.js | 2 +- .../Google_Cloud_Monitoring/index.js | 2 +- src/lib/consumers/Graphite/index.js | 2 +- src/lib/consumers/Kafka/index.js | 2 +- .../consumers/OpenTelemetry_Exporter/index.js | 4 +- src/lib/consumers/Splunk/dataMapping.js | 6 +- src/lib/consumers/Splunk/index.js | 2 +- .../Splunk/multiMetricEventConverter.js | 2 +- src/lib/consumers/Statsd/index.js | 2 +- src/lib/consumers/Sumo_Logic/index.js | 2 +- src/lib/consumers/default/index.js | 2 +- src/lib/consumers/shared/awsUtil.js | 2 +- src/lib/consumers/shared/azureUtil.js | 2 +- src/lib/consumers/shared/gcpUtil.js | 2 +- src/lib/consumers/shared/httpUtil.js | 2 +- src/lib/consumers/shared/metricsUtil.js | 4 +- src/lib/customKeywords.js | 6 +- src/lib/dataFilter.js | 2 +- src/lib/dataPipeline.js | 2 +- src/lib/dataTagging.js | 8 +- src/lib/declarationValidator.js | 2 +- src/lib/endpointLoader.js | 14 +- src/lib/errors.js | 2 +- src/lib/eventListener/baseDataReceiver.js | 2 +- src/lib/eventListener/dataPublisher.js | 2 +- src/lib/eventListener/index.js | 2 +- src/lib/eventListener/messageStream.js | 2 +- src/lib/eventListener/tcpUdpDataReceiver.js | 2 +- src/lib/forwarder.js | 2 +- src/lib/ihealth.js | 12 +- src/lib/ihealthPoller.js | 2 +- src/lib/logger.js | 6 +- src/lib/normalize.js | 2 +- src/lib/paths.json | 2 +- src/lib/persistentStorage.js | 2 +- src/lib/properties.json | 2 +- src/lib/pullConsumers.js | 5 +- src/lib/pullConsumers/Prometheus/index.js | 2 +- src/lib/pullConsumers/default/index.js | 2 +- src/lib/requestHandlers/baseHandler.js | 2 +- src/lib/requestHandlers/connections.js | 2 +- src/lib/requestHandlers/declareHandler.js | 2 +- src/lib/requestHandlers/errorHandler.js | 2 +- .../requestHandlers/eventListenerHandler.js | 9 +- src/lib/requestHandlers/httpErrors.js | 2 +- .../requestHandlers/ihealthPollerHandler.js | 4 +- src/lib/requestHandlers/infoHandler.js | 2 +- .../requestHandlers/pullConsumerHandler.js | 2 +- src/lib/requestHandlers/router.js | 8 +- .../requestHandlers/systemPollerHandler.js | 2 +- src/lib/systemPoller.js | 7 +- src/lib/systemStats.js | 2 +- src/lib/teemReporter.js | 2 +- src/lib/utils/config.js | 2 +- src/lib/utils/data.js | 2 +- src/lib/utils/datetime.js | 2 +- src/lib/utils/device.js | 15 +- src/lib/utils/eventEmitter.js | 2 +- src/lib/utils/ihealth.js | 6 +- src/lib/utils/metadata.js | 2 +- src/lib/utils/misc.js | 145 +- src/lib/utils/moduleLoader.js | 2 +- src/lib/utils/monitor.js | 2 +- src/lib/utils/normalize.js | 69 +- src/lib/utils/promise.js | 2 +- src/lib/utils/requests.js | 2 +- src/lib/utils/systemStats.js | 2 +- src/lib/utils/timers.js | 14 +- src/lib/utils/tracer.js | 6 +- src/nodejs/restWorker.js | 2 +- src/schema/1.26.0/actions_schema.json | 187 +++ src/schema/1.26.0/base_schema.json | 310 ++++ src/schema/1.26.0/consumer_schema.json | 1357 +++++++++++++++++ src/schema/1.26.0/controls_schema.json | 52 + src/schema/1.26.0/endpoints_schema.json | 158 ++ src/schema/1.26.0/ihealth_poller_schema.json | 238 +++ src/schema/1.26.0/listener_schema.json | 85 ++ src/schema/1.26.0/namespace_schema.json | 92 ++ src/schema/1.26.0/pull_consumer_schema.json | 101 ++ src/schema/1.26.0/shared_schema.json | 50 + src/schema/1.26.0/system_poller_schema.json | 242 +++ src/schema/1.26.0/system_schema.json | 121 ++ src/schema/latest/base_schema.json | 4 +- test/customMochaReporter.js | 2 +- test/functional/cloud/awsTests.js | 8 +- test/functional/cloud/azureTests.js | 8 +- test/functional/consumerSystemTests.js | 2 +- .../azureApplicationInsightsTests.js | 2 +- .../consumersTests/azureLogAnalyticsTests.js | 6 +- .../consumersTests/elasticsearchTests.js | 8 +- .../functional/consumersTests/f5CloudTests.js | 2 +- .../functional/consumersTests/fluentdTests.js | 6 +- .../googleCloudMonitoringTests.js | 4 +- test/functional/consumersTests/kafkaTests.js | 2 +- .../openTelemetryExporterTests.js | 7 +- test/functional/consumersTests/splunkTests.js | 19 +- test/functional/consumersTests/statsdTests.js | 10 +- test/functional/dutTests.js | 8 +- test/functional/pullConsumerSystemTests.js | 2 +- .../pullConsumersTests/defaultTests.js | 27 +- .../pullConsumersTests/prometheusTests.js | 27 +- test/functional/shared/azureUtil.js | 2 +- test/functional/shared/constants.js | 2 +- test/functional/shared/util.js | 4 +- test/functional/testRunner.js | 2 +- test/unit/actionProcessorTests.js | 15 +- test/unit/configTests.js | 2 +- test/unit/constantsTests.js | 9 +- .../consumers/awsCloudWatchConsumerTests.js | 14 +- test/unit/consumers/awsS3ConsumerTests.js | 8 +- test/unit/consumers/awsUtilTests.js | 14 +- .../azureApplicationInsightsConsumerTests.js | 14 +- .../azureLogAnalyticsConsumerTests.js | 2 +- test/unit/consumers/azureUtilTests.js | 2 +- test/unit/consumers/data/awsUtilTestsData.js | 2 +- .../azureLogAnalyticsConsumerTestsData.js | 40 +- .../unit/consumers/data/azureUtilTestsData.js | 2 +- .../openTelemetryExporterConsumerTestsData.js | 930 +++++++++-- .../consumers/data/splunkConsumerTestsData.js | 96 +- .../consumers/data/statsdConsumerTestsData.js | 226 ++- test/unit/consumers/dataDogConsumerTests.js | 2 +- test/unit/consumers/defaultConsumerTests.js | 2 +- .../consumers/elasticSearchConsumerTests.js | 2 +- test/unit/consumers/f5CloudConsumerTests.js | 2 +- test/unit/consumers/gcpUtilTests.js | 2 +- .../consumers/genericHTTPConsumerTests.js | 2 +- .../unit/consumers/googleCloudLoggingTests.js | 18 +- .../googleCloudMonitoringConsumerTests.js | 16 +- test/unit/consumers/graphiteConsumerTests.js | 2 +- test/unit/consumers/httpUtilTests.js | 2 +- test/unit/consumers/kafkaConsumerTests.js | 2 +- test/unit/consumers/metricsUtilTests.js | 2 +- .../consumers/openTelemetryExporterTests.js | 17 +- test/unit/consumers/splunkConsumerTests.js | 102 +- test/unit/consumers/statsdConsumerTests.js | 8 +- test/unit/consumers/sumoLogicConsumerTests.js | 2 +- test/unit/consumersTests.js | 9 +- test/unit/customEndpointsTests.js | 2 +- test/unit/data/actionProcessorTestsData.js | 2 +- test/unit/data/configTestsData.js | 2 +- .../configUtilTests/getComponentsTestsData.js | 2 +- .../hasEnabledComponentsTestsData.js | 2 +- test/unit/data/configUtilTests/index.js | 2 +- .../mergeDeclarationTestsData.js | 2 +- .../normalizeDeclarationEndpointsTestsData.js | 2 +- ...malizeDeclarationEventListenerTestsData.js | 2 +- ...malizeDeclarationIHealthPollerTestsData.js | 2 +- ...rmalizeDeclarationPullConsumerTestsData.js | 2 +- ...rmalizeDeclarationSystemPollerTestsData.js | 2 +- .../normalizeDeclarationSystemTestsData.js | 2 +- .../normalizeDeclarationTestsData.js | 2 +- ...normalizeDeclarationTraceValueTestsData.js | 2 +- test/unit/data/customEndpointsTestsData.js | 2 +- test/unit/data/dataUtilTestsData.js | 2 +- test/unit/data/deviceUtilTestsData.js | 2 +- test/unit/data/endpointLoaderTestsData.js | 14 +- test/unit/data/eventListenerTestsData.js | 2 +- test/unit/data/messageStreamTestsData.js | 2 +- test/unit/data/normalizeTestsData.js | 2 +- .../collectClientSslProfiles.js | 2 +- .../propertiesJsonTests/collectContext.js | 2 +- .../collectDeviceGroups.js | 2 +- .../propertiesJsonTests/collectGtmStats.js | 2 +- .../collectHttpProfiles.js | 2 +- .../data/propertiesJsonTests/collectIRules.js | 2 +- .../propertiesJsonTests/collectLtmPolicies.js | 2 +- .../collectNetworkTunnels.js | 2 +- .../data/propertiesJsonTests/collectPools.js | 239 ++- .../collectServerSslProfiles.js | 2 +- .../propertiesJsonTests/collectSslCerts.js | 2 +- .../propertiesJsonTests/collectSystemStats.js | 2 +- .../propertiesJsonTests/collectTmstats.js | 2 +- .../collectVirtualServers.js | 2 +- test/unit/data/pullConsumersTestsData.js | 2 +- test/unit/data/systemPollerTestsData.js | 2 +- test/unit/data/systemStatsTestsData.js | 2 +- test/unit/data/systemStatsUtilTestsData.js | 2 +- test/unit/dataFilterTests.js | 2 +- test/unit/dataPipelineTests.js | 2 +- test/unit/dataTaggingTests.js | 2 +- test/unit/declarationTests.js | 14 +- test/unit/endpointLoaderTests.js | 20 +- .../eventListener/baseDataReceiverTests.js | 2 +- test/unit/eventListener/dataPublisherTests.js | 14 +- test/unit/eventListener/eventListenerTests.js | 2 +- test/unit/eventListener/messageStreamTests.js | 2 +- .../eventListener/tcpUdpDataReceiverTests.js | 2 +- test/unit/forwarderTests.js | 14 +- test/unit/iHealthTests.js | 2 +- test/unit/ihealthPollerTests.js | 2 +- test/unit/loggerTests.js | 46 +- test/unit/normalizeTests.js | 2 +- test/unit/outputTests.js | 2 +- test/unit/persistentStorageTests.js | 2 +- test/unit/propertiesJsonTests.js | 2 +- .../data/prometheusPullConsumerTestsData.js | 68 +- .../data/system_poller_datasets.json | 74 +- .../pullConsumers/defaultPullConsumerTests.js | 2 +- .../prometheusPullConsumerTests.js | 2 +- test/unit/pullConsumersTests.js | 15 +- test/unit/requestHandlers/baseHandlerTests.js | 2 +- .../requestHandlers/declareHandlerTests.js | 2 +- .../unit/requestHandlers/errorHandlerTests.js | 2 +- .../eventListenerHandlerTests.js | 30 +- .../ihealthPollerHandlerTests.js | 2 +- test/unit/requestHandlers/infoHandlerTests.js | 2 +- .../pullConsumerHandlerTests.js | 2 +- test/unit/requestHandlers/routerTests.js | 2 +- .../systemPollerHandlerTests.js | 2 +- test/unit/restWorkerTests.js | 2 +- test/unit/shared/assert.js | 2 +- test/unit/shared/bootstrap.js | 2 +- test/unit/shared/dummies.js | 2 +- test/unit/shared/restoreCache.js | 2 +- .../commonTests/validateDeclaration.js | 2 +- test/unit/shared/schemaValidation/index.js | 6 +- .../propertyTests/additionalProperties.js | 25 +- .../propertyTests/arrayLength.js | 2 +- .../propertyTests/defaultValue.js | 2 +- .../propertyTests/dependencies.js | 2 +- .../schemaValidation/propertyTests/enum.js | 2 +- .../propertyTests/numberRange.js | 2 +- .../propertyTests/optionalProps.js | 2 +- .../propertyTests/required.js | 2 +- .../propertyTests/stringLength.js | 30 +- .../propertyTests/valueTests.js | 2 +- test/unit/shared/schemaValidation/utils.js | 2 +- test/unit/shared/stubs.js | 2 +- test/unit/shared/util.js | 4 +- test/unit/systemPollerTests.js | 64 +- test/unit/systemStatsTests.js | 2 +- test/unit/teemReporterTests.js | 2 +- test/unit/utils/configTests.js | 41 +- test/unit/utils/dataTests.js | 2 +- test/unit/utils/datetimeTests.js | 2 +- test/unit/utils/deviceTests.js | 16 +- test/unit/utils/eventEmitter.js | 4 +- test/unit/utils/ihealthTests.js | 140 +- test/unit/utils/metadataTests.js | 2 +- test/unit/utils/miscTests.js | 406 +++-- test/unit/utils/monitorTests.js | 2 +- test/unit/utils/normalizeTests.js | 239 ++- test/unit/utils/promiseTests.js | 14 +- test/unit/utils/requestsTests.js | 2 +- test/unit/utils/systemStatsTests.js | 2 +- test/unit/utils/timersTests.js | 61 +- test/unit/utils/tracerTests.js | 50 +- test/winstonLogger.js | 2 +- versions.json | 2 +- 274 files changed, 6461 insertions(+), 1070 deletions(-) create mode 100644 src/schema/1.26.0/actions_schema.json create mode 100644 src/schema/1.26.0/base_schema.json create mode 100644 src/schema/1.26.0/consumer_schema.json create mode 100644 src/schema/1.26.0/controls_schema.json create mode 100644 src/schema/1.26.0/endpoints_schema.json create mode 100644 src/schema/1.26.0/ihealth_poller_schema.json create mode 100644 src/schema/1.26.0/listener_schema.json create mode 100644 src/schema/1.26.0/namespace_schema.json create mode 100644 src/schema/1.26.0/pull_consumer_schema.json create mode 100644 src/schema/1.26.0/shared_schema.json create mode 100644 src/schema/1.26.0/system_poller_schema.json create mode 100644 src/schema/1.26.0/system_schema.json diff --git a/CHANGELOG.md b/CHANGELOG.md index fe3dcbdf..3c5db0ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Changelog Changes to this project are documented in this file. More detail and links can be found in the Telemetry Streaming [Document Revision History](https://clouddocs.f5.com/products/extensions/f5-telemetry-streaming/latest/revision-history.html). +## 1.26.0 +### Added +- AUTOTOOL-2801: [GitHub #171](https://github.com/F5Networks/f5-telemetry-streaming/issues/171): Added fqdn property to pool members that use FQDNs +### Fixed +### Changed +- AUTOTOOL-2890: Update npm packages (@grpc/proto-loader from ~0.3.0 to ^0.6.4) +### Removed + ## 1.25.0 ### Added - AUTOTOOL-2798: [GitHub #154](https://github.com/F5Networks/f5-telemetry-streaming/issues/154): Allow keyless (service account based) authorization for GCP Metrics and Logging consumers. diff --git a/README.md b/README.md index fb5b9423..171ee1c1 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ We encourage you to use our [Slack channel](https://f5cloudsolutions.herokuapp.c ## Copyright -Copyright 2014-2021 F5 Networks Inc. +Copyright 2014-2022 F5 Networks Inc. ### F5 Networks Contributor License Agreement diff --git a/SUPPORT.md b/SUPPORT.md index dd3e46fa..42a7e367 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -18,9 +18,9 @@ Currently supported versions: | Software Version | Release Type | First Customer Ship | End of Support | |------------------|---------------|---------------------|-----------------| | TS 1.20.1 | LTS | 30-Jun-2021 | 30-Jun-2022 | -| TS 1.23.0 | Feature | 21-Sep-2021 | 21-Dec-2021 | | TS 1.24.0 | Feature | 02-Nov-2021 | 02-Feb-2022 | | TS 1.25.0 | Feature | 14-Dec-2021 | 14-Mar-2022 | +| TS 1.26.0 | Feature | 25-Jan-2022 | 25-Apr-2022 | Versions no longer supported: @@ -48,5 +48,6 @@ Versions no longer supported: | TS 1.20.0 | Feature | 18-May-2021 | 18-Aug-2021 | | TS 1.21.0 | Feature | 28-Jun-2021 | 28-Sep-2021 | | TS 1.22.0 | Feature | 09-Aug-2021 | 09-Nov-2021 | +| TS 1.23.0 | Feature | 21-Sep-2021 | 21-Dec-2021 | See the [Release notes](https://github.com/F5Networks/f5-telemetry-streaming/releases) and [Telemetry Streaming documentation](https://clouddocs.f5.com/products/extensions/f5-telemetry-streaming/latest/revision-history.html) for new features and issues resolved for each release. diff --git a/contributing/README.md b/contributing/README.md index f9ac142f..62f8b803 100644 --- a/contributing/README.md +++ b/contributing/README.md @@ -108,7 +108,7 @@ How does the project handle a typical `POST` request? "trace": false, "format": "default" }, - "schemaVersion": "1.25.0" + "schemaVersion": "1.26.0" } } ``` diff --git a/contributing/process_release.md b/contributing/process_release.md index 52a05faa..5d8746f5 100644 --- a/contributing/process_release.md +++ b/contributing/process_release.md @@ -24,6 +24,7 @@ * [package.json](package.json) * [package-lock.json](package-lock.json) * [project.spec](project.spec) (not required starting from 1.5) + * [versions.json](versions.json) * [src/lib/constants.js](src/lib/constants.js) (not required starting from 1.10) * [src/schema/latest/base_schema.json](src/schema/latest/base_schema.json) * [contributing/README.md](contributing/README.md) (example of response, optional) @@ -60,6 +61,7 @@ * 1.23.0 - 17.8 MB (NOTE: inclusion of OpenTelemetry libraries) * 1.24.0 - 19.2 MB * 1.25.0 - 17.7 MB + * 1.26.0 - 17.8 MB * Install build to BIG-IP, navigate to folder `/var/config/rest/iapps/f5-telemetry/` and check following: * Run `du -sh` and check that folder's size (shouldn't be much greater than previous versions): * 1.4.0 - 65 MB @@ -84,6 +86,7 @@ * 1.23.0 - 132 MB (NOTE: inclusion of OpenTelemetry libraries) * 1.24.0 - 134 MB * 1.25.0 - 130 MB + * 1.26.0 - 127 MB * Check `node_modules` folder - if you see `eslint`, `mocha` or something else from [package.json](package.json) `devDependencies` section - something wrong with build process. Probably some `npm` flags are work as not expected and it MUST BE FIXED before publishing. * Ensure that all tests (unit tests and functional tests passed) * Optional: Ensure that your local tags match remote. If not, remove all and re-fetch: diff --git a/docs/conf.py b/docs/conf.py index ae3cfc1d..be3f36d2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -79,7 +79,7 @@ # The short X.Y version. version = u'' # The full version, including alpha/beta/rc tags. -release = u'1.25.0' +release = u'1.26.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/output-example.rst b/docs/output-example.rst index cf15523a..5cb747bf 100644 --- a/docs/output-example.rst +++ b/docs/output-example.rst @@ -7,21 +7,47 @@ Use this page to see the type of information that Telemetry Streaming collects. .. IMPORTANT:: The following are just examples; the actual fields will vary depending on factors such as how the log/event source is configured, BIG-IP versions, and so on. +.. NOTE:: For some of the output to appear, you must have the applicable BIG-IP module licensed and provisioned (for example, you must have BIG-IP DNS provisioned to get GSLB wide IP and Pool information). + .. _sysinfo: System Information ------------------ The following shows the system information that Telemetry Streaming collects. -.. NOTE:: For some of the output to appear, you must have the applicable BIG-IP module licensed and provisioned (for example, you must have BIG-IP DNS provisioned to get GSLB wide IP and Pool information). +.. NOTE:: In Telemetry Streaming 1.24 and later, properties that require the bash endpoint are skipped if bash is not available on the target BIG-IP: system.diskStorage, system.diskLatency, system.apmState, and all tmstats properties (used with “Splunk legacy” format). + +**Additional properties** |br| +The following properties were introduced in recent Telemetry Streaming versions. These properties do not appear in the output in previous versions. The following table shows the TS version the property was introduced, the type of output, and property (with description if applicable). + +.. list-table:: + :widths: 20 20 200 + :header-rows: 1 + + * - TS Version + - Type + - Property + + * - 1.22 + - Virtual Server + - **clientside.slowKilled**, **clientside.evictedConns** -Telemetry Streaming 1.22 introduced additional virtual server output: **clientside.slowKilled** and **clientside.evictedConns**. These do not appear in earlier versions. + * - 1.23 + - Virtual Server + - **isAvailable**, **isEnabled** (both boolean), which monitor virtual server availability, particularly for the Prometheus consumer. -Telemetry Streaming 1.23 introduced the following, which do not appear in earlier versions: -- Virtual server output: **isAvailable** and **isEnabled** (both boolean), which monitor virtual server availability, particularly for the Prometheus consumer. -- System output: **throughtputPerformance**, which provides throughput performance information. + * - 1.23 + - System + - **throughtputPerformance**, which shows throughput performance information. + + * - 1.25 + - Pool Member + - **poolName**, which shows the associated pool name. + + * - 1.26 + - Pool Member + - **fqdn**, which shows FQDN information for LTM pool member nodes that are FQDN nodes. -In Telemetry Streaming 1.24 and later, properties that require the bash endpoint are now skipped if bash is not available on the target BIG-IP: system.diskStorage, system.diskLatency, system.apmState, and all tmstats properties (used with “Splunk legacy” format). .. literalinclude:: ../examples/output/system_poller/output.json @@ -94,4 +120,9 @@ AVR Request Log :language: json -:ref:`Back to top` \ No newline at end of file +:ref:`Back to top` + + +.. |br| raw:: html + +
\ No newline at end of file diff --git a/docs/revision-history.rst b/docs/revision-history.rst index aa3ea3ca..b5ce0b96 100644 --- a/docs/revision-history.rst +++ b/docs/revision-history.rst @@ -11,8 +11,12 @@ Document Revision History - Description - Date + * - 1.26.0 + - Updated the documentation for Telemetry Streaming v1.26.0. This release contains the following changes: |br| * Added the **fqdn** property to the output for pool members that use FQDNs (see :ref:`System Information`) |br| * Added two new sections to :doc:`troubleshooting` for logging and tracing + - 1-25-22 + * - 1.25.0 - - Updated the documentation for Telemetry Streaming v1.25.0. This release contains the following changes: |br| * Added support for IAM roles for Google Cloud Platform (see Google :ref:`Cloud Monitoring` and :ref:`Cloud Logging`) |br| * Added the **metricPrefix** and **customTags** properties to the DataDog consumer (see :ref:`DataDog`) |br| * Added the **convertBooleansToMetrics** property to the DataDog, StatsD, and OpenTelemetry consumers (see :ref:`DataDog`, :ref:`StatsD`, and :ref:`OpenTelemetry`) |br| * Added the **endpointUrl** property to AWS S3 and CloudWatch consumers (see :ref:`AWS S3` and :ref:`AWS CloudWatch`) |br| * Removed the experimental label from the autoTag property for StatsD (see :ref:`StatsD addTags`) |br| * Removed the experimental label from Splunk multi-metric format (see :ref:`Splunk multi-metric`) |br| |br| Issues Resolved: |br| * + - Updated the documentation for Telemetry Streaming v1.25.0. This release contains the following changes: |br| * Added support for IAM roles for Google Cloud Platform (see Google :ref:`Cloud Monitoring` and :ref:`Cloud Logging`), `GitHub #154 `_ |br| * Added the **metricPrefix** (`GitHub #152 `_) and **customTags** (`GitHub #160 `_) properties to the DataDog consumer (see :ref:`DataDog`) |br| * Added the **convertBooleansToMetrics** property to the DataDog, StatsD, and OpenTelemetry consumers (see :ref:`DataDog`, :ref:`StatsD`, and :ref:`OpenTelemetry`) |br| * Added the **endpointUrl** property to AWS S3 and CloudWatch consumers (see :ref:`AWS S3` and :ref:`AWS CloudWatch`), `GitHub #173 `_ |br| * Added **poolName** to pool member output (see :ref:`System Information`), `GitHub #170 `_ |br| * Removed the experimental label from the autoTag property for StatsD (see :ref:`StatsD addTags`) |br| * Removed the experimental label from Splunk multi-metric format (see :ref:`Splunk multi-metric`) - 12-14-21 * - 1.24.0 diff --git a/docs/setting-up-consumer.rst b/docs/setting-up-consumer.rst index 25730d7d..0303aacc 100644 --- a/docs/setting-up-consumer.rst +++ b/docs/setting-up-consumer.rst @@ -7,6 +7,10 @@ Use this section to find example declarations and notes for supported push-based .. IMPORTANT:: Each of the following examples shows only the **Consumer** class of a declaration and must be included with the rest of the base declaration (see :ref:`components`). +Use the index on the right to locate a specific consumer. + +| + .. _splunk-ref: Splunk diff --git a/docs/troubleshooting.rst b/docs/troubleshooting.rst index f08c5774..38fc0834 100644 --- a/docs/troubleshooting.rst +++ b/docs/troubleshooting.rst @@ -5,18 +5,103 @@ Use this section to read about known issues and for common troubleshooting steps Telemetry Streaming general troubleshooting tips ------------------------------------------------ -- Examine the restnoded failure log at /var/log/restnoded/restnoded.log (this is where Telemetry Streaming records error messages) +- Examine the restnoded failure log at **/var/log/restnoded/restnoded.log** (this is where Telemetry Streaming records error messages). - Examine the REST response: - - A 400-level response will carry an error message with it - - If this message is missing, incorrect, or misleading, please let us know by filing an issue on Github. + - A 400-level response carries an error message with it + - If this message is missing, incorrect, or misleading, let us know by filing an |issues|. - Use Telemetry's trace option to create a detailed trace of the configuration process for subsequent analysis. Telemetry's trace option can be a powerful tool to learn about its working details and to review Telemetry's operations in detail. +Logging +------- +Telemetry Streaming writes log output to the file **/var/log/restnoded/restnoded.log** on the BIG-IP. +The verbosity of the log output can be adjusted by submitting a Telemetry Streaming declaration with a Controls class. +The allowed log levels (in increasing order of verbosity) are **error**, **info**, and **debug**. +The following is an example declaration containing a Controls class that sets the logging level to debug. -Troubleshooting ---------------- +.. code-block:: json + :emphasize-lines: 3-5 + + { + "class": "Telemetry", + "Controls": { + "logLevel": "debug" + }, + "My_System": { + "class": "Telemetry_System", + "systemPoller": { + "interval": 60 + } + }, + "My_Listener": { + "class": "Telemetry_Listener", + "port": 6514 + }, + "My_Consumer": { + "class": "Telemetry_Consumer", + "type": "Splunk", + "host": "192.0.2.1", + "protocol": "https", + "port": 8088, + "passphrase": { + "cipherText": "apikey" + } + } + } + + +Tracing +------- +While Telemetry Streaming is processing data, you can configure it to write the current state of the data at key points to files for further inspection. +These files are known as trace files, and can be enabled for the Telemetry_System, Telemetry_System_Poller, Telemetry_Listener, and Telemetry_Consumer classes. +The trace files are written to the BIG-IP file system in the **/var/tmp/telemetry** directory using a filename based on the class and the name it was given. + +To enable tracing, set the trace property to **true**. To override the default file output location, set the trace property to a string value containing the new path. + +The **Telemetry_Listener** trace setting is a little more complex, see :ref:`trace` for more information. + +The most common use for trace files is to determine how far data progresses through the path from the BIG-IP to the third party tool. +**Telemetry_System**, **Telemetry_System_Poller**, and **Telemetry_Listener** trace files are useful for determining if data is making it from the BIG-IP to Telemetry Streaming. +If these trace files are not being generated, or are empty, check the BIG-IP configuration that sets up the sending of data to Telemetry streaming. + +**Telemetry_Consumer** trace files are useful for determining if the data is being sent from Telemetry Streaming to the desired third party tool. +If these trace files are not being generated, or are empty, then check your **Telemetry_Consumer** settings in the Telemetry Streaming declaration. +Also, check the logs for any issues sending the data to the third party tool. +If all trace files look correct, then check any settings, queries, and logs in the third party tool. + +The following is an example that enables tracing on the Telemetry_System and Telemetry_Consumer classes. + +.. code-block:: json + + { + "class": "Telemetry", + "My_System": { + "class": "Telemetry_System", + "trace": true, + "systemPoller": { + "interval": 60 + } + }, + "My_Consumer": { + "class": "Telemetry_Consumer", + "trace": true, + "type": "Splunk", + "host": "192.0.2.1", + "protocol": "https", + "port": 8088, + "passphrase": { + "cipherText": "apikey" + } + } + } + +| + + +Specific troubleshooting entries +-------------------------------- I'm receiving a path not registered error when I try to post a declaration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,10 +110,10 @@ If you are receiving this error, it means either you did not install Telemetry S .. code-block:: shell - { - "code":404, - "message": "Public URI path no registered. Please see /var/log/restjavad.0.log and /var/log/restnoded/restnoded.log for details.". - ... + { + "code":404, + "message": "Public URI path no registered. Please see /var/log/restjavad.0.log and /var/log/restnoded/restnoded.log for details.". + ... } @@ -350,4 +435,9 @@ Telemetry Streaming 1.19 and later includes the **compressionType** property in .. |telemetryconsumer| raw:: html - Telemetry_Consumer \ No newline at end of file + Telemetry_Consumer + + +.. |issues| raw:: html + + Issue on GitHub \ No newline at end of file diff --git a/examples/output/system_poller/output.json b/examples/output/system_poller/output.json index 2da6b4d6..cdd8aaa7 100644 --- a/examples/output/system_poller/output.json +++ b/examples/output/system_poller/output.json @@ -634,6 +634,42 @@ "availabilityState": "offline", "enabledState": "enabled", "status.statusReason": "Pool member is available" + }, + "/Example_Tenant/_auto_192.0.2.14:80": { + "addr": "192.0.2.14", + "monitorStatus": "unchecked", + "poolName": "/Example_Tenant/A1/web_pool", + "port": 80, + "serverside.bitsIn": 0, + "serverside.bitsOut": 0, + "serverside.curConns": 0, + "serverside.maxConns": 0, + "serverside.pktsIn": 0, + "serverside.pktsOut": 0, + "serverside.totConns": 0, + "availabilityState": "unknown", + "enabledState": "enabled", + "status.statusReason": "Pool member does not have service checking enabled", + "totRequests": 0, + "fqdn": "bestwebsite.com" + }, + "/Example_Tenant/bestwebsite.com:80": { + "addr": "::", + "monitorStatus": "fqdn-up", + "poolName": "/Example_Tenant/A1/web_pool", + "port": 80, + "serverside.bitsIn": 0, + "serverside.bitsOut": 0, + "serverside.curConns": 0, + "serverside.maxConns": 0, + "serverside.pktsIn": 0, + "serverside.pktsOut": 0, + "serverside.totConns": 0, + "availabilityState": "available", + "enabledState": "enabled", + "status.statusReason": "The DNS server(s) are available", + "totRequests": 0, + "fqdn": "bestwebsite.com" } }, "tenant": "Example_Tenant", diff --git a/package-lock.json b/package-lock.json index 3c665459..2d81b2ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "f5-telemetry", - "version": "1.25.0-2", + "version": "1.26.0-3", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1008,14 +1008,14 @@ } }, "@eslint/eslintrc": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.4.tgz", - "integrity": "sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.0.0", + "espree": "^9.2.0", "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", @@ -1031,9 +1031,9 @@ "dev": true }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -1077,12 +1077,33 @@ "integrity": "sha512-fU2fyFfYMtENsmhuE12PgrX5uu9SnPoBl2CkVYOhIadvhIxb8FZr/ycgLa8XWQ+VfWsTK/UmW2uLTayqG+dSRA==" }, "@f5devcentral/eslint-config-f5-atg": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@f5devcentral/eslint-config-f5-atg/-/eslint-config-f5-atg-0.1.5.tgz", - "integrity": "sha512-uyiCRwch69oZHiMLhh/D6Mn1fEI8/tl0OkO9Yd5L1CcvnNlRdOr3zzpFguzfrW6dvydHR1LLBlutgC88AjbE9g==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@f5devcentral/eslint-config-f5-atg/-/eslint-config-f5-atg-0.1.6.tgz", + "integrity": "sha512-04wlXSqaJJv40P0u77lsq09R6VbG26SMCuGDX/ER0fnJ1Ma4gAhCHlIbCIJP5bobRi6yRejCksfAfTAGnV0shQ==", "dev": true, "requires": { - "eslint-config-airbnb-base": "^14.2.1" + "eslint-config-airbnb-base": "15.0.0", + "eslint-plugin-import": "^2.25.3" + }, + "dependencies": { + "eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "@f5devcentral/f5-teem": { @@ -1221,23 +1242,124 @@ } }, "@grpc/proto-loader": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.3.0.tgz", - "integrity": "sha512-9b8S/V+3W4Gv7G/JKSZ48zApgyYbfIR7mAC9XNnaSWme3zj57MIESu0ELzm9j5oxNIpFG8DgO00iJMIUZ5luqw==", + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.7.tgz", + "integrity": "sha512-QzTPIyJxU0u+r2qGe8VMl3j/W2ryhEvBv7hc42OjYfthSj370fUrb7na65rG6w3YLZS/fb8p89iTBobfWGDgdw==", "requires": { - "@types/lodash": "^4.14.104", - "@types/node": "^9.4.6", - "lodash": "^4.17.5", - "protobufjs": "^6.8.6" + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^6.10.0", + "yargs": "^16.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + } } }, "@humanwhocodes/config-array": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", - "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.0", + "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" } @@ -2038,9 +2160,10 @@ "dev": true }, "@types/lodash": { - "version": "4.14.170", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.170.tgz", - "integrity": "sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q==" + "version": "4.14.178", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", + "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==", + "dev": true }, "@types/long": { "version": "4.0.1", @@ -2050,7 +2173,8 @@ "@types/node": { "version": "9.6.61", "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.61.tgz", - "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==" + "integrity": "sha512-/aKAdg5c8n468cYLy2eQrcR5k6chlbNwZNGUj3TboyPa2hcO2QAJcfymlqPzMiRj8B6nYKXjzQz36minFE0RwQ==", + "dev": true }, "abbrev": { "version": "1.1.1", @@ -2067,9 +2191,9 @@ } }, "acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", "dev": true }, "acorn-jsx": { @@ -3184,13 +3308,13 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.2.0.tgz", - "integrity": "sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.0.4", - "@humanwhocodes/config-array": "^0.6.0", + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -3198,10 +3322,10 @@ "doctrine": "^3.0.0", "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^6.0.0", + "eslint-scope": "^7.1.0", "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.0.0", - "espree": "^9.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.2.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -3276,9 +3400,9 @@ "dev": true }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -3495,9 +3619,9 @@ } }, "eslint-scope": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", - "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -3528,14 +3652,14 @@ "dev": true }, "espree": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz", - "integrity": "sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", + "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", "dev": true, "requires": { - "acorn": "^8.5.0", + "acorn": "^8.6.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.0.0" + "eslint-visitor-keys": "^3.1.0" } }, "esprima": { @@ -4182,6 +4306,20 @@ "grpc": "^1.17.0", "grpc-kit": "^0.2.0", "partial-compare": "^1.0.1" + }, + "dependencies": { + "@grpc/proto-loader": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.3.0.tgz", + "integrity": "sha512-9b8S/V+3W4Gv7G/JKSZ48zApgyYbfIR7mAC9XNnaSWme3zj57MIESu0ELzm9j5oxNIpFG8DgO00iJMIUZ5luqw==", + "dev": true, + "requires": { + "@types/lodash": "^4.14.104", + "@types/node": "^9.4.6", + "lodash": "^4.17.5", + "protobufjs": "^6.8.6" + } + } } }, "gtoken": { @@ -4722,9 +4860,9 @@ "dev": true }, "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "json-schema-traverse": { "version": "0.4.1", @@ -4799,13 +4937,13 @@ } }, "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" } }, @@ -5594,9 +5732,9 @@ "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=" }, "underscore": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", - "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", + "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==" } } }, diff --git a/package.json b/package.json index ee0509c8..34890602 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "f5-telemetry", - "version": "1.25.0-2", + "version": "1.26.0-3", "author": "F5 Networks", "license": "Apache-2.0", "repository": { @@ -41,7 +41,7 @@ "dependencies": { "@f5devcentral/f5-teem": "^1.5.0", "@grpc/grpc-js": "^1.4.2", - "@grpc/proto-loader": "~0.3.0", + "@grpc/proto-loader": "^0.6.4", "@opentelemetry/api": "^1.0.3", "@opentelemetry/exporter-collector-proto": "^0.25.0", "@opentelemetry/sdk-metrics-base": "^0.26.0", @@ -68,10 +68,10 @@ "uuid": "^3.4.0" }, "devDependencies": { - "@f5devcentral/eslint-config-f5-atg": "latest", + "@f5devcentral/eslint-config-f5-atg": "0.1.6", "chai": "^4.3.4", "chai-as-promised": "^7.1.1", - "eslint": "^8.1.0", + "eslint": "^8.4.1", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.25.2", "grpc": "1.24.7", @@ -84,20 +84,21 @@ "protobufjs": "^6.11.2", "proxyquire": "^2.1.3", "sinon": "^7.5.0", - "ssh2": "^0.8.7", + "ssh2": "^0.8.9", "winston": "^2.4.5" }, "eslintConfig": { "extends": "@f5devcentral/eslint-config-f5-atg", "rules": { "func-names": "off", - "prefer-spread": "off", - "max-classes-per-file": "off" + "max-classes-per-file": "off", + "prefer-exponentiation-operator": "off", + "prefer-spread": "off" } }, "comments": { "dependencies": { - "@grpc/proto-loader": "v0.3.0 - This package is used for GRPC connection, supports node v6 and above.", + "@grpc/proto-loader": "^0.6.4 is listed in package.json of grpc-js.", "ajv": "This package dropped support for older node versions and requires the ajv package to be recompiled. Use v6.X.Y for Node v4.", "ajv-keywords": "This package documents that v3 should be used when using ajv v6", "applicationinsights": "This package requires Node v8 in 2.0.0+ as it now includes OpenTelemetry packages. Use v1.X.Y for Node v4.", @@ -115,15 +116,16 @@ } } }, - "long": "This package is used for GRPC connection, this can only be used with node v8.11.1 and higher (http2 support).", - "prom-client": "This package dropped support for older node versions. Use v11.X.Y for Node v4.", + "long": "This package is used for GRPC connection, this can only be used with node v8.11.1 and higher (http2 support). ^4.0.0 is listed in package.json of proto-loader.", + "prom-client": "This package dropped support for older node versions. Use v11.X.Y for Node v4. Cannot go higher than 11.0.0 because of syntax failures on test_node4.", "uuid": "This package dropped support for older node versions starting v7.0.0. Their policy is supported node versions + one legacy version." }, "devDependencies": { + "@f5devcentral/eslint-config-f5-atg": "This package is updated on as-needed basis due to the work overhead.", "chai": "This package dropped support for older node versions. Use v4.X.Y for Node v4.", "grpc-mock": "This package is used for GRPC connection, dependent of grpc lib that supports node v4 and above.", "grpc": "This package is used for GRPC connection. Pinned to v1.24.7 as later versions do not compile on Node v6.", - "mocha": "This package dropped support for older node versions. Use v5.X.Y for Node v4 and v6.2.2 for Node v6.", + "mocha": "This package should use v7.X.Y. CI installs node specific mocha version for node 4 and node 6.", "nock": "This package dropped support for older node versions. Use v10.0.0 for Node v4.", "node-scp": "This package dropped support for older node versions. Use v0.0.14 for Node v4.", "nyc": "This package dropped support for older node versions. Use v14.X.Y for Node v4.", diff --git a/src/lib/actionProcessor.js b/src/lib/actionProcessor.js index 36fdf7bc..6fbd9682 100644 --- a/src/lib/actionProcessor.js +++ b/src/lib/actionProcessor.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/config.js b/src/lib/config.js index 8972956f..13e17b2c 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/constants.js b/src/lib/constants.js index 7a3520d6..a2625a91 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -191,6 +191,15 @@ module.exports = { CURRENT: schemaInfo[0], MINIMUM: schemaInfo[1] }, + SECRETS: { + PROPS: [ + // encrypted or original declaration + 'cipherText', + // decrypted declaration + 'passphrase' + ], + MASK: '*********' + }, STATS_KEY_SEP: '::', STRICT_TLS_REQUIRED: true, TRACER: { diff --git a/src/lib/consumers.js b/src/lib/consumers.js index 18b4b326..0a36a86f 100644 --- a/src/lib/consumers.js +++ b/src/lib/consumers.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/AWS_CloudWatch/index.js b/src/lib/consumers/AWS_CloudWatch/index.js index b16d83c8..abc1a4a3 100644 --- a/src/lib/consumers/AWS_CloudWatch/index.js +++ b/src/lib/consumers/AWS_CloudWatch/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/AWS_S3/index.js b/src/lib/consumers/AWS_S3/index.js index 97ea1151..0fa71a78 100644 --- a/src/lib/consumers/AWS_S3/index.js +++ b/src/lib/consumers/AWS_S3/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Azure_Application_Insights/index.js b/src/lib/consumers/Azure_Application_Insights/index.js index 5ba34ce3..81ace8f9 100644 --- a/src/lib/consumers/Azure_Application_Insights/index.js +++ b/src/lib/consumers/Azure_Application_Insights/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Azure_Log_Analytics/index.js b/src/lib/consumers/Azure_Log_Analytics/index.js index a8f91c87..314e5323 100644 --- a/src/lib/consumers/Azure_Log_Analytics/index.js +++ b/src/lib/consumers/Azure_Log_Analytics/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/DataDog/index.js b/src/lib/consumers/DataDog/index.js index fdb7b0a1..74aebdbe 100644 --- a/src/lib/consumers/DataDog/index.js +++ b/src/lib/consumers/DataDog/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/ElasticSearch/index.js b/src/lib/consumers/ElasticSearch/index.js index cc95f60a..5c05555d 100644 --- a/src/lib/consumers/ElasticSearch/index.js +++ b/src/lib/consumers/ElasticSearch/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/F5_Cloud/index.js b/src/lib/consumers/F5_Cloud/index.js index ca9413ba..9a98a975 100644 --- a/src/lib/consumers/F5_Cloud/index.js +++ b/src/lib/consumers/F5_Cloud/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Generic_HTTP/index.js b/src/lib/consumers/Generic_HTTP/index.js index ee891349..0239e2c5 100644 --- a/src/lib/consumers/Generic_HTTP/index.js +++ b/src/lib/consumers/Generic_HTTP/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Google_Cloud_Logging/index.js b/src/lib/consumers/Google_Cloud_Logging/index.js index 1055f29c..1b2679fb 100644 --- a/src/lib/consumers/Google_Cloud_Logging/index.js +++ b/src/lib/consumers/Google_Cloud_Logging/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Google_Cloud_Monitoring/index.js b/src/lib/consumers/Google_Cloud_Monitoring/index.js index 9d31a3b7..87c3f830 100644 --- a/src/lib/consumers/Google_Cloud_Monitoring/index.js +++ b/src/lib/consumers/Google_Cloud_Monitoring/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Graphite/index.js b/src/lib/consumers/Graphite/index.js index 311ff1aa..9939ada9 100644 --- a/src/lib/consumers/Graphite/index.js +++ b/src/lib/consumers/Graphite/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Kafka/index.js b/src/lib/consumers/Kafka/index.js index c81eec14..cf7855ae 100644 --- a/src/lib/consumers/Kafka/index.js +++ b/src/lib/consumers/Kafka/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/OpenTelemetry_Exporter/index.js b/src/lib/consumers/OpenTelemetry_Exporter/index.js index 313362a2..8d4a460d 100644 --- a/src/lib/consumers/OpenTelemetry_Exporter/index.js +++ b/src/lib/consumers/OpenTelemetry_Exporter/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -19,7 +19,7 @@ const EVENT_TYPES = require('../../constants').EVENT_TYPES; // OpenTelemetry metics must match regex: /^[a-z][a-z0-9_.-]*$/i // However, the Prometheus exporter will silently convert invalid characters to an '_', so use Prometheus regex -const METRIC_NAME_REGEX = new RegExp(/[^a-zA-Z0-9_:]+/g); +const METRIC_NAME_REGEX = /[^a-zA-Z0-9_:]+/g; /** * Custom Log Handler to pass to the OpenTelemetry API diff --git a/src/lib/consumers/Splunk/dataMapping.js b/src/lib/consumers/Splunk/dataMapping.js index 6c23bc14..3116166e 100644 --- a/src/lib/consumers/Splunk/dataMapping.js +++ b/src/lib/consumers/Splunk/dataMapping.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -8,10 +8,10 @@ 'use strict'; -const TMSTATS_PERIOD_PREFIX = RegExp(/\./g); +const TMSTATS_PERIOD_PREFIX = /\./g; const IPV4_REGEXP = /FFFF([A-Fa-f0-9].)([A-Fa-f0-9].)([A-Fa-f0-9].)([A-Fa-f0-9].)/; const IPV6_REGEXP = /([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})([A-Fa-f0-9]{4})/; -const IPV6_V4_PREFIX_REGEXP = RegExp(/::ffff:/ig); +const IPV6_V4_PREFIX_REGEXP = /::ffff:/ig; // Canonical format function defaultFormat(globalCtx) { diff --git a/src/lib/consumers/Splunk/index.js b/src/lib/consumers/Splunk/index.js index 82d7db39..67ebeeb1 100644 --- a/src/lib/consumers/Splunk/index.js +++ b/src/lib/consumers/Splunk/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Splunk/multiMetricEventConverter.js b/src/lib/consumers/Splunk/multiMetricEventConverter.js index db55de85..c38c02ae 100644 --- a/src/lib/consumers/Splunk/multiMetricEventConverter.js +++ b/src/lib/consumers/Splunk/multiMetricEventConverter.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Statsd/index.js b/src/lib/consumers/Statsd/index.js index 38958f3f..aa540a0d 100644 --- a/src/lib/consumers/Statsd/index.js +++ b/src/lib/consumers/Statsd/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/Sumo_Logic/index.js b/src/lib/consumers/Sumo_Logic/index.js index 24a67f1f..a88091a4 100644 --- a/src/lib/consumers/Sumo_Logic/index.js +++ b/src/lib/consumers/Sumo_Logic/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/default/index.js b/src/lib/consumers/default/index.js index be8889b1..587c7c7d 100644 --- a/src/lib/consumers/default/index.js +++ b/src/lib/consumers/default/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/shared/awsUtil.js b/src/lib/consumers/shared/awsUtil.js index 645112c4..84af7614 100644 --- a/src/lib/consumers/shared/awsUtil.js +++ b/src/lib/consumers/shared/awsUtil.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/shared/azureUtil.js b/src/lib/consumers/shared/azureUtil.js index 35e70fd3..eabcdd0c 100644 --- a/src/lib/consumers/shared/azureUtil.js +++ b/src/lib/consumers/shared/azureUtil.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/shared/gcpUtil.js b/src/lib/consumers/shared/gcpUtil.js index 8a2aa87d..429b1832 100644 --- a/src/lib/consumers/shared/gcpUtil.js +++ b/src/lib/consumers/shared/gcpUtil.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/shared/httpUtil.js b/src/lib/consumers/shared/httpUtil.js index ade7950f..3960002f 100644 --- a/src/lib/consumers/shared/httpUtil.js +++ b/src/lib/consumers/shared/httpUtil.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/consumers/shared/metricsUtil.js b/src/lib/consumers/shared/metricsUtil.js index 49ca1b30..e6b72751 100644 --- a/src/lib/consumers/shared/metricsUtil.js +++ b/src/lib/consumers/shared/metricsUtil.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -186,7 +186,7 @@ function canBeTag(data, options) { * @returns {boolean} true when object has at least one key */ function objectHasKeys(obj) { - // eslint-disable-next-line guard-for-in, no-restricted-syntax, prefer-const + // eslint-disable-next-line guard-for-in, no-restricted-syntax, prefer-const, no-unreachable-loop for (let x in obj) { return true; } diff --git a/src/lib/customKeywords.js b/src/lib/customKeywords.js index 4a45d780..6838cbc3 100644 --- a/src/lib/customKeywords.js +++ b/src/lib/customKeywords.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -145,7 +145,9 @@ function expandPointers(str, origin, srcPointer) { ptr = str.slice((i + 2), end); // gotcha, now resolve resolved = resolvePointer( - origin, ptr, srcPointer, + origin, + ptr, + srcPointer, { stringify: c !== '>', base64: c === '+' ? 'decode' : null diff --git a/src/lib/dataFilter.js b/src/lib/dataFilter.js index 5c1e27d4..512bb2a3 100644 --- a/src/lib/dataFilter.js +++ b/src/lib/dataFilter.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/dataPipeline.js b/src/lib/dataPipeline.js index 8c0d094a..c8c4b414 100644 --- a/src/lib/dataPipeline.js +++ b/src/lib/dataPipeline.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/dataTagging.js b/src/lib/dataTagging.js index 7a6c6d4c..5a7fae42 100644 --- a/src/lib/dataTagging.js +++ b/src/lib/dataTagging.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -42,9 +42,9 @@ function addTags(dataCtx, actionCtx, deviceCtx) { // Apply tags to default locations (where addKeysByTag is true) for system info if (!dataCtx.isCustom) { Object.keys(properties.stats).forEach((statKey) => { - const statProp = systemStatsUtil.renderProperty( - deviceCtx, util.deepCopy(properties.stats[statKey]) - ); + const statProp = systemStatsUtil.renderProperty(deviceCtx, util.deepCopy( + properties.stats[statKey] + )); const items = statProp.structure && statProp.structure.parentKey ? (data[statProp.structure.parentKey] || {})[statKey] : data[statKey]; diff --git a/src/lib/declarationValidator.js b/src/lib/declarationValidator.js index 70ba0684..46dc698e 100644 --- a/src/lib/declarationValidator.js +++ b/src/lib/declarationValidator.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/endpointLoader.js b/src/lib/endpointLoader.js index 69ff50b3..24ee8d04 100644 --- a/src/lib/endpointLoader.js +++ b/src/lib/endpointLoader.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -122,7 +122,10 @@ EndpointLoader.prototype.auth = function () { } const options = Object.assign({}, this.options.connection); return deviceUtil.getAuthToken( - this.host, this.options.credentials.username, this.options.credentials.passphrase, options + this.host, + this.options.credentials.username, + this.options.credentials.passphrase, + options ) .then((token) => { this.options.credentials.token = token.token; @@ -180,12 +183,13 @@ EndpointLoader.prototype.expandReferences = function (endpointObj, data) { const item = dataItems[i][referenceKey]; if (item && item.link) { let referenceEndpoint = this.getURIPath(item.link); - if (referenceObj.endpointSuffix) { - referenceEndpoint = `${referenceEndpoint}${referenceObj.endpointSuffix}`; - } + // Process '/stats' endpoint first, before modifying referenceEndpoint url if (referenceObj.includeStats) { promises.push(this.getData(`${referenceEndpoint}/stats`, { name: i, refKey: referenceKey })); } + if (referenceObj.endpointSuffix) { + referenceEndpoint = `${referenceEndpoint}${referenceObj.endpointSuffix}`; + } promises.push(this.getData(referenceEndpoint, { name: i, refKey: referenceKey })); } } diff --git a/src/lib/errors.js b/src/lib/errors.js index 6e9eea9b..5c90c83e 100644 --- a/src/lib/errors.js +++ b/src/lib/errors.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/eventListener/baseDataReceiver.js b/src/lib/eventListener/baseDataReceiver.js index b0e6fafa..fc642145 100644 --- a/src/lib/eventListener/baseDataReceiver.js +++ b/src/lib/eventListener/baseDataReceiver.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/eventListener/dataPublisher.js b/src/lib/eventListener/dataPublisher.js index 145423a6..3e8d20f7 100644 --- a/src/lib/eventListener/dataPublisher.js +++ b/src/lib/eventListener/dataPublisher.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/eventListener/index.js b/src/lib/eventListener/index.js index 12737d5e..f85d0611 100644 --- a/src/lib/eventListener/index.js +++ b/src/lib/eventListener/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/eventListener/messageStream.js b/src/lib/eventListener/messageStream.js index 30a32556..9ac2a809 100644 --- a/src/lib/eventListener/messageStream.js +++ b/src/lib/eventListener/messageStream.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/eventListener/tcpUdpDataReceiver.js b/src/lib/eventListener/tcpUdpDataReceiver.js index b7481c66..c67b87f9 100644 --- a/src/lib/eventListener/tcpUdpDataReceiver.js +++ b/src/lib/eventListener/tcpUdpDataReceiver.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/forwarder.js b/src/lib/forwarder.js index 209eebd5..62e1fdc6 100644 --- a/src/lib/forwarder.js +++ b/src/lib/forwarder.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/ihealth.js b/src/lib/ihealth.js index 8c69cacd..864557f2 100644 --- a/src/lib/ihealth.js +++ b/src/lib/ihealth.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -96,9 +96,8 @@ function getCurrentState(namespaceName) { let instances = iHealthPoller.getAll({ includeDemo: true }); if (instances.length > 0 && namespaceName) { - const ids = configUtil.getTelemetryIHealthPollers( - configWorker.currentConfig, namespaceName || constants.DEFAULT_UNNAMED_NAMESPACE - ) + const ids = configUtil.getTelemetryIHealthPollers(configWorker.currentConfig, namespaceName + || constants.DEFAULT_UNNAMED_NAMESPACE) .map((pc) => pc.traceName); instances = instances.filter((poller) => ids.indexOf(poller.id) !== -1); } @@ -117,9 +116,8 @@ function startPoller(systemName, namespaceName) { return Promise.resolve() .then(() => { const config = configWorker.currentConfig; - const pollerConfig = configUtil.getTelemetryIHealthPollers( - config, namespaceName || constants.DEFAULT_UNNAMED_NAMESPACE - ) + const pollerConfig = configUtil.getTelemetryIHealthPollers(config, namespaceName + || constants.DEFAULT_UNNAMED_NAMESPACE) .find((pc) => pc.systemName === systemName); if (util.isObjectEmpty(pollerConfig)) { diff --git a/src/lib/ihealthPoller.js b/src/lib/ihealthPoller.js index 2f5a8758..3aeeb1cd 100644 --- a/src/lib/ihealthPoller.js +++ b/src/lib/ihealthPoller.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/logger.js b/src/lib/logger.js index 586881cb..fa84b785 100644 --- a/src/lib/logger.js +++ b/src/lib/logger.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -8,7 +8,7 @@ 'use strict'; -const maskSecrets = require('./utils/misc').maskSecrets; +const maskDefaultSecrets = require('./utils/misc').maskDefaultSecrets; const stringify = require('./utils/misc').stringify; /** @module logger */ @@ -70,7 +70,7 @@ let CURRENT_LOG_LEVEL = NOTSET; * @returns {string} processed message */ const processMessage = function (prefix, message) { - return `[${prefix}] ${maskSecrets(stringify(message))}`; + return `[${prefix}] ${maskDefaultSecrets(stringify(message))}`; }; /** diff --git a/src/lib/normalize.js b/src/lib/normalize.js index 30de53ee..054bb224 100644 --- a/src/lib/normalize.js +++ b/src/lib/normalize.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/paths.json b/src/lib/paths.json index 06ce1c00..216eff78 100644 --- a/src/lib/paths.json +++ b/src/lib/paths.json @@ -130,7 +130,7 @@ "name": "pools", "path": "/mgmt/tm/ltm/pool", "includeStats": true, - "expandReferences": { "membersReference": { "endpointSuffix": "/stats" } } + "expandReferences": { "membersReference": { "includeStats": true, "endpointSuffix": "?$select=fqdn,selfLink" } } }, { "name": "ltmPolicies", diff --git a/src/lib/persistentStorage.js b/src/lib/persistentStorage.js index 5099ee31..cc034bec 100644 --- a/src/lib/persistentStorage.js +++ b/src/lib/persistentStorage.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/properties.json b/src/lib/properties.json index 77d18d62..4dc4c74a 100644 --- a/src/lib/properties.json +++ b/src/lib/properties.json @@ -826,7 +826,7 @@ "convertArrayToMap": { "keyName": "selfLink", "keyNamePrefix": "name/" } }, { - "includeFirstEntry": { "pattern": "/stats", "excludePattern": "/members/" } + "includeFirstEntry": { "pattern": "/stats", "excludePattern": "/members/", "runFunctions": [ {"name": "addFqdnToLtmPool" } ] } }, { "filterKeys": { "exclude": [ "tmName", "availableMemberCnt", "sessionStatus", "connqAll.ageEdm", "connqAll.ageEma", "connqAll.ageHead", "connqAll.ageMax", "connqAll.depth", "connqAll.serviced", "connq.ageEdm", "connq.ageEma", "connq.ageHead", "connq.ageMax", "connq.depth", "connq.serviced", "curSessions", "memberCnt", "minActiveMembers", "monitorRule", "ipTosToServer", "minUpMembersAction", "appService", "appServiceReference", "minUpMembersChecking", "kind","ignorePersistedWeight", "fullPath", "partition", "linkQosToClient", "linkQosToServer", "ipTosToClient", "generation", "serviceDownAction", "queueDepthLimit", "queueTimeLimit", "allowNat", "reselectTries", "minUpMembers", "nodeName", "allowSnat", "monitor", "selfLink", "subPath", "queueOnConnectionLimit", "loadBalancingMode", "slowRampTime", "gatewayFailsafeDeviceReference" ] } diff --git a/src/lib/pullConsumers.js b/src/lib/pullConsumers.js index 0a0c81c6..72addee9 100644 --- a/src/lib/pullConsumers.js +++ b/src/lib/pullConsumers.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -48,7 +48,8 @@ function getData(consumerName, namespace) { } const pollerGroup = configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - config, consumerConfig + config, + consumerConfig ); const pollerConfigs = configUtil.getTelemetrySystemPollersForGroup(config, pollerGroup) .filter((sp) => sp.enable); diff --git a/src/lib/pullConsumers/Prometheus/index.js b/src/lib/pullConsumers/Prometheus/index.js index 5dcdc3e1..35751910 100644 --- a/src/lib/pullConsumers/Prometheus/index.js +++ b/src/lib/pullConsumers/Prometheus/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/pullConsumers/default/index.js b/src/lib/pullConsumers/default/index.js index 4747ff75..abd0346d 100644 --- a/src/lib/pullConsumers/default/index.js +++ b/src/lib/pullConsumers/default/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/baseHandler.js b/src/lib/requestHandlers/baseHandler.js index 16d9688a..4742358c 100644 --- a/src/lib/requestHandlers/baseHandler.js +++ b/src/lib/requestHandlers/baseHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/connections.js b/src/lib/requestHandlers/connections.js index 2ba0acb2..57769dea 100644 --- a/src/lib/requestHandlers/connections.js +++ b/src/lib/requestHandlers/connections.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/declareHandler.js b/src/lib/requestHandlers/declareHandler.js index 9b9d3a26..6fff59ad 100644 --- a/src/lib/requestHandlers/declareHandler.js +++ b/src/lib/requestHandlers/declareHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/errorHandler.js b/src/lib/requestHandlers/errorHandler.js index 9326c751..45292d2d 100644 --- a/src/lib/requestHandlers/errorHandler.js +++ b/src/lib/requestHandlers/errorHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/eventListenerHandler.js b/src/lib/requestHandlers/eventListenerHandler.js index 29d48b87..62cec7df 100644 --- a/src/lib/requestHandlers/eventListenerHandler.js +++ b/src/lib/requestHandlers/eventListenerHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -43,8 +43,11 @@ class EventListenerEndpointHandler extends BaseRequestHandler { */ process() { const dataToSend = this.restOperation.getBody(); - return dataPublisher.sendDataToListener(dataToSend, this.params.eventListener, - { namespace: this.params.namespace }) + return dataPublisher.sendDataToListener( + dataToSend, + this.params.eventListener, + { namespace: this.params.namespace } + ) .then(() => { this.body = { message: 'success', diff --git a/src/lib/requestHandlers/httpErrors.js b/src/lib/requestHandlers/httpErrors.js index 23d98aaa..3065b344 100644 --- a/src/lib/requestHandlers/httpErrors.js +++ b/src/lib/requestHandlers/httpErrors.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/ihealthPollerHandler.js b/src/lib/requestHandlers/ihealthPollerHandler.js index 9406110f..617eafa9 100644 --- a/src/lib/requestHandlers/ihealthPollerHandler.js +++ b/src/lib/requestHandlers/ihealthPollerHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -45,7 +45,7 @@ class IHealthPollerEndpointHandler extends BaseRequestHandler { let responsePromise = Promise.resolve(); if (!this.params.system) { responsePromise = responsePromise.then(() => new Promise( - (resolve) => resolve(ihealth.getCurrentState(this.params.namespace)) + (resolve) => { resolve(ihealth.getCurrentState(this.params.namespace)); } ) .then((statuses) => { this.code = 200; diff --git a/src/lib/requestHandlers/infoHandler.js b/src/lib/requestHandlers/infoHandler.js index 552e888d..aa37c7f9 100644 --- a/src/lib/requestHandlers/infoHandler.js +++ b/src/lib/requestHandlers/infoHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/pullConsumerHandler.js b/src/lib/requestHandlers/pullConsumerHandler.js index 72472ee9..d385f3bf 100644 --- a/src/lib/requestHandlers/pullConsumerHandler.js +++ b/src/lib/requestHandlers/pullConsumerHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/requestHandlers/router.js b/src/lib/requestHandlers/router.js index d7f8293d..2fe19ce5 100644 --- a/src/lib/requestHandlers/router.js +++ b/src/lib/requestHandlers/router.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -56,7 +56,11 @@ class RequestRouter extends SafeEventEmitter { .then((handler) => { logger.info(`${handler.getCode()} ${restOperation.getMethod().toUpperCase()} ${restOperation.getUri().pathname}`); restOperationResponder.call( - this, restOperation, handler.getCode(), handler.getBody(), handler.getContentType() + this, + restOperation, + handler.getCode(), + handler.getBody(), + handler.getContentType() ); }) .catch((fatalError) => { diff --git a/src/lib/requestHandlers/systemPollerHandler.js b/src/lib/requestHandlers/systemPollerHandler.js index 37e97132..f4d5f10f 100644 --- a/src/lib/requestHandlers/systemPollerHandler.js +++ b/src/lib/requestHandlers/systemPollerHandler.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/systemPoller.js b/src/lib/systemPoller.js index 0ce2b10b..3bde66e3 100644 --- a/src/lib/systemPoller.js +++ b/src/lib/systemPoller.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -285,7 +285,10 @@ function getPollersConfig(sysOrPollerName, options) { const includeDisabled = (typeof options.includeDisabled === 'undefined') ? false : options.includeDisabled; return Promise.resolve() .then(() => findSystemOrPollerConfigs( - configWorker.currentConfig, sysOrPollerName, options.pollerName, options.namespace + configWorker.currentConfig, + sysOrPollerName, + options.pollerName, + options.namespace )) .then((config) => configUtil.decryptSecrets(config)) .then((configs) => { diff --git a/src/lib/systemStats.js b/src/lib/systemStats.js index e3e22f71..42f2d358 100644 --- a/src/lib/systemStats.js +++ b/src/lib/systemStats.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/teemReporter.js b/src/lib/teemReporter.js index a24670f7..e5e7b319 100644 --- a/src/lib/teemReporter.js +++ b/src/lib/teemReporter.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/config.js b/src/lib/utils/config.js index d6706c13..0e99e05b 100644 --- a/src/lib/utils/config.js +++ b/src/lib/utils/config.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/data.js b/src/lib/utils/data.js index 132c82e3..bb2a2b12 100644 --- a/src/lib/utils/data.js +++ b/src/lib/utils/data.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/datetime.js b/src/lib/utils/datetime.js index ec88db2e..313af290 100644 --- a/src/lib/utils/datetime.js +++ b/src/lib/utils/datetime.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/device.js b/src/lib/utils/device.js index 98a4637c..18041870 100644 --- a/src/lib/utils/device.js +++ b/src/lib/utils/device.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -174,7 +174,10 @@ DeviceAsyncCLI.prototype._auth = function () { // in case of optimization, replace with Object.assign const options = util.deepCopy(this.options.connection); return module.exports.getAuthToken( - this.host, this.options.credentials.username, this.options.credentials.passphrase, options + this.host, + this.options.credentials.username, + this.options.credentials.passphrase, + options ) .then((token) => { this.options.credentials.token = token.token; @@ -547,8 +550,10 @@ module.exports = { }) .then((deviceVersion) => { this.setHostDeviceInfo(HDC_KEYS.VERSION, deviceVersion); - this.setHostDeviceInfo(HDC_KEYS.RETRIEVE_SECRETS_FROM_TMSH, - isVersionAffectedBySecretsBug(deviceVersion)); + this.setHostDeviceInfo( + HDC_KEYS.RETRIEVE_SECRETS_FROM_TMSH, + isVersionAffectedBySecretsBug(deviceVersion) + ); return this.getDeviceNodeMemoryLimit(constants.LOCAL_HOST); }) .then((deviceNodeMemLimit) => { @@ -603,7 +608,7 @@ module.exports = { } return util.fs.readFile('/VERSION') .then((ret) => { - if ((new RegExp('product:\\s+big-ip', 'i')).test(ret[0].toString())) { + if (/product:\s+big-ip/i.test(ret[0].toString())) { return Promise.resolve(constants.DEVICE_TYPE.BIG_IP); } return Promise.reject(new Error('Host is not BIG-IP')); diff --git a/src/lib/utils/eventEmitter.js b/src/lib/utils/eventEmitter.js index 5b3cd195..cf81e434 100644 --- a/src/lib/utils/eventEmitter.js +++ b/src/lib/utils/eventEmitter.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/ihealth.js b/src/lib/utils/ihealth.js index aa30c4bd..5512da04 100644 --- a/src/lib/utils/ihealth.js +++ b/src/lib/utils/ihealth.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -186,9 +186,7 @@ class DeviceAPI { } // in case of optimization, replace with Object.assign const options = util.deepCopy(this.connection); - return deviceUtil.getAuthToken( - this.host, this.credentials.username, this.credentials.passphrase, options - ) + return deviceUtil.getAuthToken(this.host, this.credentials.username, this.credentials.passphrase, options) .then((token) => { this.credentials.token = token.token; }); diff --git a/src/lib/utils/metadata.js b/src/lib/utils/metadata.js index 9d0326ab..84f6db5e 100644 --- a/src/lib/utils/metadata.js +++ b/src/lib/utils/metadata.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/misc.js b/src/lib/utils/misc.js index 18d31137..3a25b3ce 100644 --- a/src/lib/utils/misc.js +++ b/src/lib/utils/misc.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -22,9 +22,15 @@ const net = require('net'); const uuidv4 = require('uuid/v4'); const jsonDuplicateKeyHandle = require('json-duplicate-key-handle'); -/** @module miscUtil */ -/* General helper functions (objects, primitives, etc) -*/ +const constants = require('../constants'); + +/** @module utils/misc */ + +/* + * General helper functions (objects, primitives, etc) + */ + +const VERSION_COMPARATORS = ['==', '===', '<', '<=', '>', '>=', '!=', '!==']; /** * Convert async callback function to promise-based funcs @@ -56,45 +62,85 @@ function proxyForNodeCallbackFuncs(module, funcName) { }; } -const VERSION_COMPARATORS = ['==', '===', '<', '<=', '>', '>=', '!=', '!==']; - -const SECRETS_MASK = '*********'; -const KEYWORDS_TO_MASK = [ - { - /** - * single line: - * - * { "passphrase": { ...secret... } } - */ - str: 'passphrase', - replace: /(\\{0,}["']{0,1}passphrase\\{0,}["']{0,1}\s*:\s*){.*?}/g, - with: `$1{${SECRETS_MASK}}` - }, - { - /** - * { - * "passphrase": "secret" - * } - */ - str: 'passphrase', - replace: /(\\{0,}["']{0,1}passphrase\\{0,}["']{0,1}\s*:\s*)(\\{0,}["']{1}).*?\2/g, - with: `$1$2${SECRETS_MASK}$2` - }, - { - /** - * { - * someSecret: { - * cipherText: "secret" - * } - * } - */ - str: 'cipherText', - replace: /(\\{0,}["']{0,1}cipherText\\{0,}["']{0,1}\s*:\s*)(\\{0,}["']{1}).*?\2/g, - with: `$1$2${SECRETS_MASK}$2` +/** + * Create function to mask secrets in well formed JSON data (e.g. from JSON.stringify). + * Also partially supports escaped JSON. + * + * @param {Array} properties - properties to mask + * @param {string} mask - mask to use + * + * @returns {function(string): string} function to use to mask secrets. Function has read-only + * property 'matchesFound' that returns number of matches found during last call + */ +function createJsonSecretsMaskFunc(properties, mask) { + mask = arguments.length > 1 ? mask : constants.SECRETS.MASK; + // matches counter, should be reset every time + let matches = 0; + + const regExps = properties.map((propName) => ({ + // it is not an ideal regexp (it is almost impossible to create such regexp) but it should work in most cases + replace: new RegExp([ + [ + '(', + // match leading ',' or '{' with spaces and new lines (or escaped new lines) + '(?:(?:,|\\{)(?:\\s+|(?:(?:\\\\+r)?\\\\+n|\\\\+r)+)*)', + // match quoted property (escaped quotes too). Group #2 is leading quote. + // It will be used to match closing quote for property name and quotes for value if value is a string + `(?:(\\\\{0,}")${propName}\\2\\s*:\\s*)`, + ')' + ].join(''), + [ + '(?:', + 'true', + '|', + 'false', + '|', + 'null', + '|', + // JSON valid number + '-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?', + '|', + // string (with support for escaped quotes) + // it should ignore escaped quote(s) in of string + '\\2(?:\\\\+\\2|.*?)\\2', + '|', + // simple array handling + '\\[[\\s\\S]*?\\]', + ')' + ].join(''), + [ + // match following ',' or '}' (with preceding spaces and new lines or escaped new lines) + '(,|(?:(?:\\s+|(?:(?:\\\\+r)?\\\\+n|\\\\+r)+)*\\}))' + ].join('') + ].join(''), 'g'), + with: (match, p1, p2, p3) => { + matches += 1; + return `${p1}${p2}${mask}${p2}${p3}`; + } + })); + function maskDefaultSecrets(data) { + matches = 0; + let maskedData = data; + try { + regExps.forEach((regexp) => { + maskedData = maskedData.replace(regexp.replace, regexp.with); + }); + } catch (e) { + // simply ignore error + } + return maskedData; } -]; + Object.defineProperty(maskDefaultSecrets, 'matchesFound', { + get() { + return matches; + } + }); + return maskDefaultSecrets; +} module.exports = { + createJsonSecretsMaskFunc, + /** * Assign defaults to object (uses lodash.defaultsDeep under the hood) * Note: check when working with arrays, as values may be merged incorrectly @@ -474,24 +520,11 @@ module.exports = { /** * Mask Secrets (as needed) * - * @param {String} msg - message to mask + * @param {string} msg - message to mask * - * @returns {String} Masked message + * @returns {string} masked message */ - maskSecrets(msg) { - let ret = msg; - // place in try/catch - try { - KEYWORDS_TO_MASK.forEach((keyword) => { - if (msg.indexOf(keyword.str) !== -1) { - ret = ret.replace(keyword.replace, keyword.with); - } - }); - } catch (e) { - // just continue - } - return ret; - }, + maskDefaultSecrets: createJsonSecretsMaskFunc(constants.SECRETS.PROPS), /** * Generates a unique property name that the object doesn't have diff --git a/src/lib/utils/moduleLoader.js b/src/lib/utils/moduleLoader.js index 6c246149..a0f1b8be 100644 --- a/src/lib/utils/moduleLoader.js +++ b/src/lib/utils/moduleLoader.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/monitor.js b/src/lib/utils/monitor.js index 7e50f6ed..8665e70e 100644 --- a/src/lib/utils/monitor.js +++ b/src/lib/utils/monitor.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/normalize.js b/src/lib/utils/normalize.js index 06edaa43..e4ee6139 100644 --- a/src/lib/utils/normalize.js +++ b/src/lib/utils/normalize.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -16,6 +16,29 @@ const constants = require('../constants'); const TRUTHY_REGEXP = /^\s*(true|1|on|yes)\s*$/i; +/** + * Iterate over an endpoint's memberReference entries, and execute entryFunc on each memberReference entry + * + * @param {Object} data - data to process + * @param {Object} [data.membersReference] - memberReference object to process + * @param {Function} entryFunc - function to execute on each memberReference entry + * + * @returns {Object} Returns formatted data + */ +const iterateMemberReferenceEntries = (data, entryFunc) => { + if (data.membersReference) { + if (data.membersReference.entries) { + const statsKeys = Object.keys(data.membersReference.entries); + statsKeys.forEach((entryStatKey) => { + entryFunc(data, entryStatKey); + }); + } else { + delete data.membersReference.items; + } + } + return data; +}; + module.exports = { /** * Format MAC address @@ -479,23 +502,35 @@ module.exports = { * @returns {Object} Returns formatted data */ restructureGslbPool(args) { - const data = args.data; - if (data.membersReference) { - if (data.membersReference.entries) { - const statsKeys = Object.keys(data.membersReference.entries); - statsKeys.forEach((key) => { - const statsEntry = data.membersReference.entries[key]; - const vsAndServer = statsEntry.nestedStats.selfLink.split('/members/')[1].split('/stats')[0]; - const vs = vsAndServer.split(':')[0]; - const server = vsAndServer.split(':')[1]; - const item = data.membersReference.items.find((i) => i.selfLink.includes(`${server}:${vs}`)); - Object.assign(data.membersReference.entries[key].nestedStats.entries, item); - }); - } else { - delete data.membersReference.items; + const entryFunc = (data, entryStatKey) => { + const statsEntry = data.membersReference.entries[entryStatKey]; + const vsAndServer = statsEntry.nestedStats.selfLink.split('/members/')[1].split('/stats')[0]; + const vs = vsAndServer.split(':')[0]; + const server = vsAndServer.split(':')[1]; + const item = data.membersReference.items.find((i) => i.selfLink.includes(`${server}:${vs}`)); + Object.assign(data.membersReference.entries[entryStatKey].nestedStats.entries, item); + }; + return iterateMemberReferenceEntries(args.data, entryFunc); + }, + + /** + * addFqdnToLtmPool + * + * @param {Object} args - args object + * @param {Object} [args.data] - data to process (always included) + * + * @returns {Object} Returns formatted data + */ + addFqdnToLtmPool(args) { + const entryFunc = (data, entryStatKey) => { + const statsEntry = data.membersReference.entries[entryStatKey]; + const poolLink = statsEntry.nestedStats.selfLink.split('/stats')[0]; + const item = data.membersReference.items.find((i) => i.selfLink.split('?ver')[0] === poolLink); + if (item && item.fqdn && item.fqdn.tmName) { + data.membersReference.entries[entryStatKey].nestedStats.entries.fqdn = item.fqdn.tmName; } - } - return data; + }; + return iterateMemberReferenceEntries(args.data, entryFunc); }, /** diff --git a/src/lib/utils/promise.js b/src/lib/utils/promise.js index 3ceaba33..a034bed8 100644 --- a/src/lib/utils/promise.js +++ b/src/lib/utils/promise.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/requests.js b/src/lib/utils/requests.js index c274caf9..8c866d74 100644 --- a/src/lib/utils/requests.js +++ b/src/lib/utils/requests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/systemStats.js b/src/lib/utils/systemStats.js index 2f02e34d..3dd9f5e7 100644 --- a/src/lib/utils/systemStats.js +++ b/src/lib/utils/systemStats.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/lib/utils/timers.js b/src/lib/utils/timers.js index 26fcf9fb..9f6b6499 100644 --- a/src/lib/utils/timers.js +++ b/src/lib/utils/timers.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -105,8 +105,10 @@ class BasicTimer extends TimerInterface { throw new Error('BasicTimer: No function to run'); } const intervalID = setInterval( - () => new Promise((resolve, reject) => Promise.resolve(this.func.apply(null, this.args || [])) - .then(resolve, reject)) + () => new Promise((resolve, reject) => { + Promise.resolve(this.func.apply(null, this.args || [])) + .then(resolve, reject); + }) .catch((error) => { if (this.logger) { this.logger.exception('BasicTimer: execution error', error); @@ -416,8 +418,10 @@ class SlidingInterval { * run target function inside of a Promise to track execution time * in case if target function returns a Promise */ - new Promise((resolve, reject) => Promise.resolve(this.func.apply(null, this.args)) - .then(resolve, reject)) + new Promise((resolve, reject) => { + Promise.resolve(this.func.apply(null, this.args)) + .then(resolve, reject); + }) .catch((error) => (this.onError ? this.onError(error) : Promise.reject(error))) .then(() => { const duration = Date.now() - startTime; diff --git a/src/lib/utils/tracer.js b/src/lib/utils/tracer.js index 62516808..3ffd4214 100644 --- a/src/lib/utils/tracer.js +++ b/src/lib/utils/tracer.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -304,7 +304,7 @@ class Tracer { this._cacheReset = true; return this._mergeAndResetCache(readData); }) - .then((data) => util.maskSecrets(util.stringify(data, true))) + .then((data) => util.maskDefaultSecrets(util.stringify(data, true))) .then((dataToWrite) => util.fs.ftruncate(this.fd, 0) .then(() => util.fs.write(this.fd, dataToWrite, 0, this.encoding))) .catch((err) => { @@ -344,7 +344,7 @@ class Tracer { // it means we are still on time and we can resolve this promise once current attempt resolved // create a new promise to avoid accidental chaining to internal promises responsible for data writing - return new Promise((resolve, reject) => tryWriteDataPromise.then(resolve, reject)); + return new Promise((resolve, reject) => { tryWriteDataPromise.then(resolve, reject); }); } } diff --git a/src/nodejs/restWorker.js b/src/nodejs/restWorker.js index 61710d52..7a02240f 100644 --- a/src/nodejs/restWorker.js +++ b/src/nodejs/restWorker.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/src/schema/1.26.0/actions_schema.json b/src/schema/1.26.0/actions_schema.json new file mode 100644 index 00000000..c658439b --- /dev/null +++ b/src/schema/1.26.0/actions_schema.json @@ -0,0 +1,187 @@ +{ + "$id": "actions_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming Actions schema", + "description": "", + "type": "object", + "definitions": { + "baseActionsChain": { + "title": "Chain of Actions", + "description": "Actions to be performed on the data.", + "type": "array", + "items": { + "$ref": "#/definitions/baseActionObject" + } + }, + "baseActionObject": { + "title": "Base Action object", + "description": "Base object to build actions.", + "type": "object", + "properties": { + "enable": { + "title": "Enable", + "description": "Whether to enable this action in the declaration or not.", + "type": "boolean", + "default": true + } + } + }, + "baseConditionalActionObject": { + "title": "Base Action object with support for conditional statements", + "description": "Base Action object with support for conditional statements.", + "type": "object", + "allOf": [ + { "$ref": "#/definitions/baseActionObject" }, + { + "anyOf": [ + { + "properties": { + "ifAllMatch": { + "title": "If All Match", + "description": "The conditions that will be checked against. All must be true.", + "type": "object", + "additionalProperties": true + } + }, + "not": { "required": ["ifAnyMatch"] } + }, + { + "properties": { + "ifAnyMatch": { + "title": "If Any Match", + "description": "An array of ifAllMatch objects. Any individual ifAllMatch object may match, but each condition within an ifAllMatch object must be true", + "type": "array" + } + }, + "not": { "required": ["ifAllMatch"] } + } + ] + } + ] + }, + "subLocation": { + "title": "Location", + "description": "Used to specify a location in TS data. Use boolean type with value true to specify the location.", + "oneOf": [ + { + "type": "boolean", + "const": true + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/subLocation" + } + } + ] + }, + "locations": { + "title": "Location", + "description": "The location(s) to apply the action.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/subLocation" + } + }, + "setTagAction": { + "title": "setTag Action", + "description": "Action to assign a tag(s) to particular or default location", + "type": "object", + "allOf": [ + { "$ref": "#/definitions/baseConditionalActionObject" }, + { + "properties": { + "setTag": { + "title": "Set Tag", + "description": "The tag values to be added.", + "type": "object", + "additionalProperties": true + }, + "locations": { + "title": "Location", + "description": "The location(s) to apply the action.", + "allOf": [{ "$ref": "#/definitions/locations" }] + }, + "enable": {}, + "ifAllMatch": {}, + "ifAnyMatch": {} + }, + "additionalProperties": false, + "required": ["setTag"] + } + ] + }, + "includeDataAction": { + "title": "includeData Action", + "description": "Action to specify data fields to include in the output", + "type": "object", + "allOf": [ + { "$ref": "#/definitions/baseConditionalActionObject" }, + { + "properties": { + "includeData": { + "title": "Include Data", + "description": "The data fields to include in the output", + "type": "object", + "additionalProperties": false + }, + "locations": { + "title": "Location", + "description": "The location(s) to apply the action.", + "allOf": [{ "$ref": "#/definitions/locations" }] + }, + "enable": {}, + "ifAllMatch": {}, + "ifAnyMatch": {} + }, + "additionalProperties": false, + "required": ["includeData", "locations"] + } + ] + }, + "excludeDataAction": { + "title": "excludeData Action", + "description": "Action to specify data fields to exclude form the output", + "type": "object", + "allOf": [ + { "$ref": "#/definitions/baseConditionalActionObject" }, + { + "properties": { + "excludeData": { + "title": "Exclude Data", + "description": "The data fields to exclude from the output", + "type": "object", + "additionalProperties": false + }, + "locations": { + "title": "Location", + "description": "The location(s) to apply the action.", + "allOf": [{ "$ref": "#/definitions/locations" }] + }, + "enable": {}, + "ifAllMatch": {}, + "ifAnyMatch": {} + }, + "additionalProperties": false, + "required": ["excludeData", "locations"] + } + ] + }, + "inputDataStreamActionsChain": { + "title": "", + "description": "", + "allOf": [ + { "$ref": "#/definitions/baseActionsChain" }, + { + "items": { + "oneOf": [ + { "$ref": "#/definitions/excludeDataAction" }, + { "$ref": "#/definitions/includeDataAction" }, + { "$ref": "#/definitions/setTagAction" } + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/schema/1.26.0/base_schema.json b/src/schema/1.26.0/base_schema.json new file mode 100644 index 00000000..01d5de0f --- /dev/null +++ b/src/schema/1.26.0/base_schema.json @@ -0,0 +1,310 @@ +{ + "$id": "base_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming", + "description": "", + "type": "object", + "definitions": { + "enable": { + "title": "Enable", + "description": "This property can be used to enable/disable the poller/listener" , + "type": "boolean" + }, + "trace": { + "title": "Trace", + "description": "Enables data dumping to file. Boolean uses pre-defined file location, however value could be a string which contains path to a specific file instead" , + "minLength": 1, + "type": ["boolean", "string"] + }, + "traceConfig": { + "title": "Trace (v2)", + "description": "Enables data dumping to file. Boolean uses pre-defined file location, however value could be a string which contains path to a specific file instead", + "type": "object", + "properties": { + "type": { + "title": "Trace type", + "description": "Trace type - output data or input data", + "type": "string", + "enum": ["output", "input"] + }, + "path": { + "title": "Path to trace file", + "description": "Path to trace file to write data to", + "type": "string", + "minLength": 1 + } + }, + "required": ["type"] + }, + "traceV2": { + "title": "Trace (v2)", + "description": "Enables data dumping to file. Boolean uses pre-defined file location, however value could be a string which contains path to a specific file instead", + "oneOf": [ + { "$ref": "#/definitions/traceConfig" }, + { + "type": "array", + "minItems": 1, + "maxItems": 2, + "uniqueItemProperties": ["type"], + "items": { + "allOf": [{ + "$ref": "#/definitions/traceConfig" + }] + } + } + ] + }, + "secret": { + "title": "Passphrase (secret)", + "description": "" , + "type": "object", + "properties": { + "class": { + "title": "Class", + "description": "Telemetry streaming secret class", + "type": "string", + "enum": [ "Secret" ], + "default": "Secret" + }, + "cipherText": { + "title": "Cipher Text: this contains a secret to encrypt", + "type": "string" + }, + "environmentVar": { + "title": "Environment Variable: this contains the named env var where the secret resides", + "type": "string", + "minLength": 1 + }, + "protected": { + "$comment": "Meta property primarily used to determine if 'cipherText' needs to be encrypted", + "title": "Protected", + "type": "string", + "enum": [ "plainText", "plainBase64", "SecureVault" ], + "default": "plainText" + } + }, + "oneOf": [ + { "required": [ "cipherText" ] }, + { "required": [ "environmentVar" ] } + ], + "f5secret": true + }, + "username": { + "$comment": "Common field for username to use everywhere in scheme", + "title": "Username", + "type": "string", + "minLength": 1 + }, + "stringOrSecret": { + "allOf": [ + { + "if": { "type": "string" }, + "then": {}, + "else": {} + }, + { + "if": { "type": "object" }, + "then": { "$ref": "base_schema.json#/definitions/secret" }, + "else": {} + } + ] + }, + "constants": { + "title": "Constants", + "description": "" , + "type": "object", + "properties": { + "class": { + "title": "Class", + "description": "Telemetry streaming constants class", + "type": "string", + "enum": [ "Constants" ] + } + }, + "additionalProperties": true + }, + "tag": { + "$comment": "Defaults do not get applied for $ref objects, so place defaults alongside instead.", + "title": "Tag", + "description": "" , + "type": "object", + "properties": { + "tenant": { + "title": "Tenant tag", + "type": "string", + "minLength": 1 + }, + "application": { + "title": "Application tag", + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": true + }, + "match": { + "$comment": "Defaults do not get applied for $ref objects, so place defaults alongside instead.", + "title": "Pattern to filter data", + "description": "", + "type": "string" + }, + "enableHostConnectivityCheck": { + "$comment": "This property can be used to enable/disable the host connectivity check in configurations where this is in effect", + "title": "Host", + "description": "" , + "type": "boolean" + }, + "allowSelfSignedCert": { + "$comment": "This property can be used by consumers, system pollers to enable/disable SSL Cert check", + "title": "Allow Self-Signed Certificate", + "description": "" , + "type": "boolean" + }, + "host": { + "$comment": "This property can be used by consumers, system pollers", + "title": "Host", + "description": "" , + "type": "string", + "minLength": 1, + "anyOf": [ + { "format": "ipv4" }, + { "format": "ipv6" }, + { "format": "hostname" } + ], + "hostConnectivityCheck": true + }, + "port": { + "title": "Port", + "description": "" , + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "protocol": { + "title": "Protocol", + "description": "" , + "type": "string", + "enum": [ "http", "https" ] + }, + "proxy": { + "title": "Proxy Configuration", + "description": "", + "type": "object", + "dependencies": { + "passphrase": [ "username" ] + }, + "required": [ "host" ], + "properties": { + "host": { + "$ref": "#/definitions/host" + }, + "port": { + "default": 80, + "allOf": [ + { + "$ref": "#/definitions/port" + } + ] + }, + "protocol": { + "default": "http", + "allOf": [ + { + "$ref": "#/definitions/protocol" + } + ] + }, + "enableHostConnectivityCheck": { + "$ref": "#/definitions/enableHostConnectivityCheck" + }, + "allowSelfSignedCert": { + "$ref": "#/definitions/allowSelfSignedCert" + }, + "username": { + "$ref": "#/definitions/username" + }, + "passphrase": { + "$ref": "#/definitions/secret" + } + }, + "additionalProperties": false + } + }, + "properties": { + "class": { + "title": "Class", + "description": "Telemetry streaming top level class", + "type": "string", + "enum": [ "Telemetry" ] + }, + "schemaVersion": { + "title": "Schema version", + "description": "Version of ADC Declaration schema this declaration uses", + "type": "string", + "$comment": "IMPORTANT: In enum array, please put current schema version first, oldest-supported version last. Keep enum array sorted most-recent-first.", + "enum": [ "1.26.0", "1.25.0", "1.24.0", "1.23.0", "1.22.0", "1.21.0", "1.20.1", "1.20.0", "1.19.0", "1.18.0", "1.17.0", "1.16.0", "1.15.0", "1.14.0", "1.13.0", "1.12.0", "1.11.0", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.1.0", "1.0.0", "0.9.0" ], + "default": "1.26.0" + }, + "$schema": { + "title": "Schema", + "description": "", + "type": "string" + } + }, + "additionalProperties": { + "$comment": "AJV does not resolve defaults inside oneOf/anyOf, so instead use allOf. Any schema refs should also use allOf with an if/then/else on class", + "properties": { + "class": { + "title": "Class", + "type": "string", + "enum": [ + "Telemetry_System", + "Telemetry_System_Poller", + "Telemetry_Listener", + "Telemetry_Consumer", + "Telemetry_Pull_Consumer", + "Telemetry_iHealth_Poller", + "Telemetry_Endpoints", + "Telemetry_Namespace", + "Controls", + "Shared" + ] + } + }, + "allOf": [ + { + "$ref": "system_schema.json#" + }, + { + "$ref": "system_poller_schema.json#" + }, + { + "$ref": "listener_schema.json#" + }, + { + "$ref": "consumer_schema.json#" + }, + { + "$ref": "pull_consumer_schema.json#" + }, + { + "$ref": "ihealth_poller_schema.json#" + }, + { + "$ref": "endpoints_schema.json#" + }, + { + "$ref": "controls_schema.json#" + }, + { + "$ref": "shared_schema.json#" + }, + { + "$ref": "namespace_schema.json#" + } + ] + }, + "required": [ + "class" + ] +} diff --git a/src/schema/1.26.0/consumer_schema.json b/src/schema/1.26.0/consumer_schema.json new file mode 100644 index 00000000..2bbe0818 --- /dev/null +++ b/src/schema/1.26.0/consumer_schema.json @@ -0,0 +1,1357 @@ +{ + "$id": "consumer_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming Consumer schema", + "description": "", + "type": "object", + "definitions": { + "jmesPathAction": { + "title": "JMESPath Action", + "description": "Will use a JMESPath expression to modify the incoming data payload", + "type": "object", + "allOf": [ + { "$ref": "actions_schema.json#/definitions/baseActionObject" }, + { + "properties": { + "JMESPath": { + "title": "JMESPath", + "description": "Will use a JMESPath expression to modify the incoming data payload", + "type": "object", + "additionalProperties": false + }, + "expression": { + "title": "Expression", + "description": "The JMESPath expression to be applied to the incoming data payload", + "type": "string", + "minLength": 1 + }, + "enable": {} + }, + "additionalProperties": false, + "required": ["JMESPath", "expression"] + } + ] + }, + "autoTaggingStatsd": { + "title": "Statsd auto tagging", + "description": "Will parse incoming payload for values to automatically add as tags.", + "type": "object", + "properties": { + "method": { + "title": "AutoTagging method", + "description": "AutoTagging method to use to fetch tags", + "type": "string", + "enum": ["sibling"] + } + }, + "additionalProperties": false, + "required": ["method"] + }, + "genericHttpActions": { + "title": "Actions", + "description": "Actions to be performed on the Generic HTTP Consumer.", + "allOf": [ + { "$ref": "actions_schema.json#/definitions/baseActionsChain" }, + { + "items": { + "oneOf": [ + { "$ref": "#/definitions/jmesPathAction" } + ] + } + } + ] + }, + "host": { + "$comment": "Required for certain consumers: standard property", + "title": "Host", + "description": "FQDN or IP address" , + "type": "string", + "minLength": 1, + "anyOf": [ + { "format": "ipv4" }, + { "format": "ipv6" }, + { "format": "hostname" } + ], + "hostConnectivityCheck": true + }, + "protocols": { + "$comment": "Required for certain consumers: standard property", + "title": "Protocols (all)", + "description": "" , + "type": "string", + "enum": [ "https", "http", "tcp", "udp", "binaryTcpTls", "binaryTcp" ] + }, + "port": { + "$comment": "Required for certain consumers: standard property", + "title": "Port", + "description": "" , + "type": "integer", + "minimum": 0, + "maximum": 65535 + }, + "path": { + "$comment": "Required for certain consumers: standard property", + "title": "Path", + "description": "Path to post data to", + "type": ["string", "object"], + "minLength": 1, + "f5expand": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/stringOrSecret" + } + ] + }, + "method": { + "$comment": "Required for certain consumers: standard property", + "title": "Method", + "description": "HTTP method to use (limited to sensical choices)" , + "type": "string", + "enum": [ "POST", "GET", "PUT" ] + }, + "headers": { + "$comment": "Required for certain consumers: standard property", + "title": "Headers", + "description": "HTTP headers to use" , + "type": "array", + "items": { + "properties": { + "name": { + "description": "Name of this header", + "type": "string", + "f5expand": true, + "minLength": 1 + }, + "value": { + "description": "Value of this header", + "type": ["string", "object"], + "f5expand": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/stringOrSecret" + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + } + }, + "customOpts": { + "$comment": "Required for certain consumers: standard property", + "title": "Custom Opts (Client Library Dependent)", + "description": "Additional options for use by consumer client library. Refer to corresponding consumer lib documentation for acceptable keys and values." , + "type": "array", + "items": { + "properties": { + "name": { + "description": "Name of the option", + "type": "string", + "f5expand": true, + "minLength": 1 + }, + "value": { + "description": "Value of the option", + "minLength": 1, + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "allOf": [ + { + "f5expand": true + }, + { + "$ref": "base_schema.json#/definitions/stringOrSecret" + } + ] + } + ] + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + }, + "minItems": 1 + }, + "format": { + "$comment": "Required for certain consumers: Splunk and Azure_Log_Analytics", + "title": "Format (informs consumer additional formatting may be required)", + "description": "", + "type": "string" + }, + "username": { + "$comment": "Required for certain consumers: standard property", + "title": "Username", + "description": "" , + "minLength": 1, + "type": "string", + "f5expand": true + }, + "region": { + "$comment": "Required for certain consumers: AWS_CloudWatch, AWS_S3, Azure_Log_Analytics, Azure_App_Insights, DataDog", + "title": "Region", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "endpointUrl": { + "$comment": "Required for certain consumers: AWS_CloudWatch, AWS_S3", + "title": "endpoint url", + "description": "The full endpoint URL for service requests", + "type": "string", + "minLength": 1, + "f5expand": true + }, + "bucket": { + "$comment": "Required for certain consumers: AWS_S3", + "title": "Bucket", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "logGroup": { + "$comment": "Required for certain consumers: AWS_CloudWatch", + "title": "Log Group", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "logStream": { + "$comment": "Required for certain consumers: AWS_CloudWatch", + "title": "Log Stream", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "metricNamespace": { + "$comment": "Required for certain consumers: AWS_CloudWatch", + "title": "Metric Namespace", + "description": "The namespace for the metrics", + "type": "string", + "f5expand": true, + "minLength": 1 + }, + "metricPrefix": { + "$comment": "Required for certain consumers: DataDog", + "title": "Metric Prefix", + "description": "The string value(s) to use as a metric prefix", + "type": "array", + "minItems": 1, + "items": { + "allOf": [{ + "type": "string", + "f5expand": true, + "minLength": 1 + }] + } + }, + "workspaceId": { + "$comment": "Required for certain consumers: Azure_Log_Analytics", + "title": "Workspace ID", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "useManagedIdentity": { + "$comment": "Required for certain consumers: Azure_Log_Analytics and Azure_Application_Insights", + "title": "Use Managed Identity", + "description": "Determines whether to use Managed Identity to perform authorization for Azure services", + "type": "boolean", + "default": false + }, + "appInsightsResourceName": { + "$comment": "Required for certain consumers: Azure_Application_Insights", + "title": "Application Insights Resource Name (Pattern)", + "description": "Name filter used to determine which App Insights resource to send metrics to. If not provided, TS will send metrics to App Insights in the subscription in which the managed identity has permissions to", + "type": "string", + "minLength": 1 + }, + "instrumentationKey": { + "$comment": "Required for certain consumers: Azure_Application_Insights", + "title": "Instrumentation Key", + "description": "Used to determine which App Insights resource to send metrics to", + "anyOf": [ + { + "type": "string", + "f5expand": true, + "minLength": 1 + }, + { + "type":"array", + "items": { + "type": "string", + "f5expand": true, + "minLength": 1 + }, + "minItems": 1 + } + ] + }, + "maxBatchIntervalMs": { + "$comment": "Required for certain consumers: Azure_Application_Insights", + "title": "Maximum Batch Interval (ms)", + "description": "The maximum amount of time to wait in milliseconds to for payload to reach maxBatchSize", + "type": "integer", + "minimum": 1000, + "default": 5000 + }, + "maxBatchSize": { + "$comment": "Required for certain consumers: Azure_Application_Insights", + "title": "Maximum Batch Size", + "description": "The maximum number of telemetry items to include in a payload to the ingestion endpoint", + "type": "integer", + "minimum": 1, + "default": 250 + }, + "topic": { + "$comment": "Required for certain consumers: Kafka", + "title": "Topic", + "description": "" , + "type": "string", + "f5expand": true + }, + "index": { + "$comment": "Required for certain consumers: ElasticSearch", + "title": "Index Name", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "apiVersion": { + "$comment": "Required for certain consumers: ElasticSearch", + "title": "API Version", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "dataType": { + "$comment": "Required for certain consumers: AWS_CloudWatch, ElasticSearch", + "title": "Data type", + "description": "" , + "type": "string", + "f5expand": true + }, + "authenticationProtocol": { + "$comment": "Required for certain consumers: Kafka", + "title": "Authentication Protocol", + "description": "" , + "type": "string", + "f5expand": true, + "enum": [ + "SASL-PLAIN", + "TLS", + "None" + ] + }, + "clientCertificate": { + "$comment": "Required for certain consumers: Kafka, Generic HTTP", + "title": "Client Certificate", + "description": "Certificate(s) to use when connecting to a secured endpoint.", + "type": "object", + "f5expand": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/secret" + } + ] + }, + "rootCertificate": { + "$comment": "Required for certain consumers: Kafka, Generic HTTP", + "title": "Root Certificate", + "description": "Certificate Authority root certificate, used to validate certificate chains.", + "type": "object", + "f5expand": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/secret" + } + ] + }, + "projectId": { + "$comment": "Required for certain consumers: Google_Cloud_Monitoring", + "title": "Project ID", + "description": "The ID of the relevant project.", + "type": "string", + "minLength": 1, + "f5expand": true + }, + "serviceEmail": { + "$comment": "Required for certain consumers: Google_Cloud_Monitoring, Google_Cloud_Logging", + "title": "Service Email", + "description": "The service email.", + "type": "string", + "minLength": 1, + "f5expand": true + }, + "privateKeyId": { + "$comment": "Required for certain consumers when Service Account Token is not used: Google_Cloud_Monitoring, Google_Cloud_Logging", + "title": "Private Key ID", + "description": "The private key ID.", + "type": "string", + "minLength": 1, + "f5expand": true + }, + "useServiceAccountToken": { + "$comment": "Used by certain consumers: Google_Cloud_Monitoring, Google_Cloud_Logging", + "title": "Use Service Account Token", + "description": "Determines whether to use Service Account Token to perform authorization for Google services", + "type": "boolean", + "default": false + }, + "logScope": { + "$comment": "Required for certain consumers: Google_Cloud_Logging", + "title": "Logging Scope Type", + "description": "" , + "enum": ["projects", "organizations", "billingAccounts", "folders"], + "f5expand": true + }, + "logScopeId": { + "$comment": "Required for certain consumers: Google_Cloud_Logging", + "title": "Logging Scope ID", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "logId": { + "$comment": "Required for certain consumers: Google_Cloud_Logging", + "title": "Logging ID", + "description": "" , + "type": "string", + "format": "regex", + "pattern": "^[a-zA-z0-9._-]+$", + "minLength": 1, + "f5expand": true + }, + "privateKey": { + "$comment": "Required for certain consumers: Kafka, Generic HTTP", + "title": "Private Key", + "description": "Private Key", + "type": "object", + "f5expand": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/secret" + } + ] + }, + "eventSchemaVersion": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Event Schema Version", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true, + "default": "1" + }, + "f5csTenantId": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "F5CS Tenant ID", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "f5csSensorId": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "F5CS Sensor ID", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "payloadSchemaNid": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Namespace ID for payloadSchema", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "serviceAccount": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Service Account", + "description": "Service Account to authentication" , + "type": "object", + "properties": { + "authType": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "SA Type", + "description": "" , + "type": "string", + "enum": ["google-auth" ] + }, + "type": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "SA Type", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "projectId": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Project Id", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "privateKeyId": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Private Key Id", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "privateKey": { + "$ref": "base_schema.json#/definitions/secret" + }, + "clientEmail": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Client Email", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "clientId": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Client Id", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "authUri": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Auth Uri", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "tokenUri": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Token Uri", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "authProviderX509CertUrl": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Auth Provider X509 Cert Url", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "clientX509CertUrl": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Client X509 Cert Url", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + } + }, + "additionalProperties": false, + "allOf": [ + { + "if": { "properties": { "authType": { "const": "google-auth" } } }, + "then": { + "required": [ + "type", + "projectId", + "privateKeyId", + "privateKey", + "clientEmail", + "clientId", + "authUri", + "tokenUri", + "authProviderX509CertUrl", + "clientX509CertUrl" + ] + }, + "else": {} + }] + }, + "targetAudience": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "Target Audience", + "description": "" , + "type": "string", + "minLength": 1, + "f5expand": true + }, + "useSSL": { + "$comment": "Required for certain consumers: F5_Cloud", + "title": "useSSL", + "description": "To decide if GRPC connection should use SSL and then it is secured" , + "type": "boolean", + "f5expand": true + }, + "compressionType": { + "$comment": "Required for certain consumers: DataDog, Splunk", + "title": "Data compression", + "description": "Whether or not to compress data and what compression to use before sending it to destination", + "type": "string", + "enum": ["none", "gzip"] + }, + "reportInstanceMetadata": { + "$comment": "Required for certain consumers: Google_Cloud_Monitoring, Google_Cloud_Logging", + "title": "Instance metadata reporting", + "description": "Enables instance metadata collection and reporting" , + "type": "boolean", + "f5expand": true + }, + "apiKey": { + "$comment": "Required for certain consumers: DataDog", + "title": "API key to use to push data", + "type": "string", + "minLength": 1, + "f5expand": true + }, + "service": { + "$comment": "Required for certain consumers: DataDog", + "title": "The name of the service generating telemetry data", + "type": "string", + "minLength": 1, + "f5expand": true + }, + "convertBooleansToMetrics": { + "$comment": "Required for certain consumers: DataDog, Statsd, OpenTelemetry_Exporter", + "title": "Convert boolean values to metrics", + "description": "Whether or not to convert boolean values to metrics. True becomes 1, False becomes 0" , + "type": "boolean", + "f5expand": true, + "default": false + }, + "customTags": { + "$comment": "Required for certain consumers: DataDog", + "title": "Custom tags", + "description": "A collection of custom tags that are appended to the dynamically generated telemetry tags", + "type": "array", + "minItems": 1, + "items": { + "properties": { + "name": { + "description": "Name of this tag", + "type": "string", + "f5expand": true, + "minLength": 1 + }, + "value": { + "description": "Value of this tag", + "type": "string", + "f5expand": true, + "minLength": 1 + } + }, + "additionalProperties": false + } + } + }, + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_Consumer" } } }, + "then": { + "required": [ + "class", + "type" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Consumer class", + "type": "string", + "enum": [ "Telemetry_Consumer" ] + }, + "enable": { + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "trace": { + "default": false, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/trace" + } + ] + }, + "type": { + "title": "Type", + "description": "" , + "type": "string", + "enum": [ + "AWS_CloudWatch", + "AWS_S3", + "Azure_Log_Analytics", + "Azure_Application_Insights", + "DataDog", + "default", + "ElasticSearch", + "Generic_HTTP", + "Google_Cloud_Logging", + "Google_Cloud_Monitoring", + "Google_StackDriver", + "Graphite", + "Kafka", + "OpenTelemetry_Exporter", + "Splunk", + "Statsd", + "Sumo_Logic", + "F5_Cloud" + ] + }, + "enableHostConnectivityCheck": { + "$ref": "base_schema.json#/definitions/enableHostConnectivityCheck" + }, + "allowSelfSignedCert": { + "default": false, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/allowSelfSignedCert" + } + ] + } + }, + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "addTags": {}, + "actions": {}, + "apiKey": {}, + "class": {}, + "customTags": {}, + "enable": {}, + "trace": {}, + "type": {}, + "enableHostConnectivityCheck": {}, + "allowSelfSignedCert": {}, + "host": {}, + "protocol": {}, + "port": {}, + "path": {}, + "method": {}, + "headers": {}, + "customOpts": {}, + "username": {}, + "passphrase": {}, + "format": {}, + "workspaceId": {}, + "useManagedIdentity": {}, + "instrumentationKey": {}, + "appInsightsResourceName": {}, + "maxBatchIntervalMs": {}, + "maxBatchSize": {}, + "region": {}, + "endpointUrl": {}, + "logGroup": {}, + "logStream": {}, + "metricNamespace": {}, + "metricPrefix": {}, + "bucket": {}, + "topic": {}, + "apiVersion": {}, + "index": {}, + "dataType": {}, + "authenticationProtocol": {}, + "projectId": {}, + "serviceEmail": {}, + "privateKey": {}, + "privateKeyId": {}, + "useServiceAccountToken": {}, + "clientCertificate": {}, + "rootCertificate": {}, + "fallbackHosts": {}, + "eventSchemaVersion": {}, + "f5csTenantId": {}, + "f5csSensorId": {}, + "payloadSchemaNid": {}, + "serviceAccount": {}, + "targetAudience": {}, + "useSSL": {}, + "proxy": {}, + "compressionType": {}, + "logScope": {}, + "logScopeId": {}, + "logId": {}, + "reportInstanceMetadata": {}, + "metricsPath": {}, + "service": {}, + "convertBooleansToMetrics": {} + }, + "additionalProperties": false, + "dependencies": { + "actions": { + "allOf": [ + { + "properties": { "type": { "const": "Generic_HTTP" } } + } + ] + } + } + }, + { + "if": { "properties": { "type": { "const": "default" } } }, + "then": { + "required": [], + "properties": {} + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Generic_HTTP" } } }, + "then": { + "required": [ + "host" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "fallbackHosts": { + "type": "array", + "description": "List FQDNs or IP addresses to be used as fallback hosts" , + "minItems": 1, + "items": { + "allOf": [{ + "$ref": "#/definitions/host" + }] + } + }, + "protocol": { "$ref": "#/definitions/protocols", "default": "https" }, + "port": { "$ref": "#/definitions/port", "default": 443 }, + "path": { "$ref": "#/definitions/path", "default": "/" }, + "method": { "$ref": "#/definitions/method", "default": "POST" }, + "headers": { "$ref": "#/definitions/headers" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" }, + "proxy": { "$ref": "base_schema.json#/definitions/proxy" }, + "privateKey": { "$ref": "#/definitions/privateKey" }, + "clientCertificate": { "$ref": "#/definitions/clientCertificate" }, + "rootCertificate": { "$ref": "#/definitions/rootCertificate" }, + "actions": { "$ref": "#/definitions/genericHttpActions" } + }, + "allOf": [ + { + "if": { "required": [ "clientCertificate" ] }, + "then": { "required": [ "privateKey" ] } + }, + { + "if": { "required": [ "privateKey" ] }, + "then": { "required": [ "clientCertificate" ] } + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Splunk" } } }, + "then": { + "required": [ + "host", + "passphrase" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "protocol": { "$ref": "#/definitions/protocols", "default": "https" }, + "port": { "$ref": "#/definitions/port", "default": 8088 }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" }, + "format": { "$ref": "#/definitions/format", "enum": [ "default", "legacy", "multiMetric" ], "default": "default" }, + "proxy": { "$ref": "base_schema.json#/definitions/proxy" }, + "compressionType": { "$ref": "#/definitions/compressionType", "default": "gzip" } + } + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Azure_Log_Analytics" } } }, + "then": { + "required": [ + "workspaceId" + ], + "properties": { + "workspaceId": { "$ref": "#/definitions/workspaceId" }, + "format": { "$ref": "#/definitions/format", "enum": [ "default", "propertyBased" ], "default": "default" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" }, + "useManagedIdentity": { "$ref": "#/definitions/useManagedIdentity", "default": false }, + "region": { "$ref": "#/definitions/region" } + }, + "allOf": [ + { + "dependencies": { + "passphrase": { + "anyOf": [ + { "not": {"required": [ "useManagedIdentity" ] } }, + { "properties": { "useManagedIdentity": { "const": false } } } + ] + } + } + }, + { + "if": { "not": { "required" : [ "useManagedIdentity"] } }, + "then": { "required": ["passphrase"] }, + "else": { + "if": { "properties": { "useManagedIdentity": { "const": true } } }, + "then": { "not": { "required": ["passphrase"] } }, + "else": { "required": ["passphrase"]} + } + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Azure_Application_Insights" } } }, + "then": { + "properties": { + "instrumentationKey": { "$ref": "#/definitions/instrumentationKey" }, + "maxBatchSize": { "$ref": "#/definitions/maxBatchSize", "default": 250 }, + "maxBatchIntervalMs": { "$ref": "#/definitions/maxBatchIntervalMs", "default": 5000 }, + "customOpts": { "$ref": "#/definitions/customOpts" }, + "useManagedIdentity": { "$ref": "#/definitions/useManagedIdentity", "default": false }, + "appInsightsResourceName": { "$ref": "#/definitions/appInsightsResourceName" }, + "region": { "$ref": "#/definitions/region" } + }, + "allOf": [ + { + "dependencies": { + "instrumentationKey": { + "allOf": [ + { + "anyOf": [ + { "not": { "required": [ "useManagedIdentity" ] } }, + { "properties": { "useManagedIdentity": { "const": false } } } + ] + }, + { + "not": { "required": ["appInsightsResourceName"] } + } + ] + } + } + }, + { + "if": { "not": { "required" : [ "useManagedIdentity"] } }, + "then": { "required": ["instrumentationKey"] }, + "else": { + "if": { "properties": { "useManagedIdentity": { "const": true } } }, + "then": { "not": { "required": ["instrumentationKey"] } }, + "else": { + "allOf": [ + { "required": [ "instrumentationKey" ]}, + { "not": { "required": [ "appInsightsResourceName" ] } } + ] + } + } + }, + { + "if": { "required": [ "appInsightsResourceName" ] }, + "then": { "properties": { "appInsightsResourceName": { "minLength": 1 } }} + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "AWS_CloudWatch" } } }, + "then": { + "required": [ + "region", + "dataType" + ], + "properties": { + "region": { "$ref": "#/definitions/region" }, + "dataType": { "$ref": "#/definitions/dataType", "default": "logs" }, + "username": { "$ref": "#/definitions/username" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" }, + "endpointUrl": { "$ref": "#/definitions/endpointUrl" } + }, + "allOf": [ + { "not": { "required": ["username"], "not": { "required": ["passphrase"] }}}, + { "not": { "required": ["passphrase"], "not": { "required": ["username"] }}}, + { "oneOf": + [ + { + "allOf": [ + { + "properties": { + "logGroup": { "$ref": "#/definitions/logGroup" }, + "logStream": { "$ref": "#/definitions/logStream" }, + "dataType": { + "allOf": + [ + { "$ref": "#/definitions/dataType"}, + { "enum": ["logs", null] } + ] + } + } + }, + { "required":[ "logGroup", "logStream" ] }, + { "not": { "required": ["metricNamespace"] }} + ] + }, + { + "allOf": [ + { + "properties": { + "metricNamespace": { "$ref": "#/definitions/metricNamespace" }, + "dataType": { + "allOf": [ + { "$ref": "#/definitions/dataType"}, + { "enum": ["metrics"] } + ] + } + } + }, + { "required":[ "metricNamespace" ] }, + { "not": { "required":[ "logStream" ] }}, + { "not": { "required": [ "logGroup" ] }} + ] + } + ] + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "AWS_S3" } } }, + "then": { + "required": [ + "region", + "bucket" + ], + "properties": { + "region": { "$ref": "#/definitions/region" }, + "bucket": { "$ref": "#/definitions/bucket" }, + "username": { "$ref": "#/definitions/username" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" }, + "endpointUrl": { "$ref": "#/definitions/endpointUrl" } + }, + "dependencies": { + "passphrase": [ "username" ], + "username":[ "passphrase" ] + } + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Graphite" } } }, + "then": { + "required": [ + "host" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "protocol": { "$ref": "#/definitions/protocols", "default": "https" }, + "port": { "$ref": "#/definitions/port", "default": 443 }, + "path": { "$ref": "#/definitions/path", "default": "/events/" } + } + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Kafka" } } }, + "then": { + "required": [ + "host", + "topic" + ], + "properties": { + "authenticationProtocol": { "$ref": "#/definitions/authenticationProtocol", "default": "None" }, + "host": { "$ref": "#/definitions/host" }, + "protocol": { "$ref": "#/definitions/protocols", "default": "binaryTcpTls" }, + "port": { "$ref": "#/definitions/port", "default": 9092 }, + "topic": { "$ref": "#/definitions/topic" } + }, + "allOf": [ + { + "if": { "properties": { "authenticationProtocol": { "const": "SASL-PLAIN" } } }, + "then": { + "required": [ + "username" + ], + "properties": { + "username": { "$ref": "#/definitions/username" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" } + }, + "dependencies": { + "passphrase": [ "username" ] + } + }, + "else": {} + }, + { + "if": { "properties": { "authenticationProtocol": { "const": "TLS" } } }, + "then": { + "required": [ + "privateKey", + "clientCertificate" + ], + "allOf": [ + { "not": { "required": [ "username" ] } }, + { "not": { "required": [ "passphrase" ] } } + ], + "properties": { + "privateKey": { "$ref": "#/definitions/privateKey" }, + "clientCertificate": { "$ref": "#/definitions/clientCertificate" }, + "rootCertificate": { "$ref": "#/definitions/rootCertificate" }, + "protocol": { "const": "binaryTcpTls" } + } + }, + "else": {} + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "ElasticSearch" } } }, + "then": { + "required": [ + "host", + "index" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "protocol": { "$ref": "#/definitions/protocols", "default": "https" }, + "port": { "$ref": "#/definitions/port", "default": 9200 }, + "path": { "$ref": "#/definitions/path" }, + "username": { "$ref": "#/definitions/username" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" }, + "apiVersion": { "$ref": "#/definitions/apiVersion", "default": "6.0" }, + "index": { "$ref": "#/definitions/index" } + }, + "allOf": [ + { + "if": { "properties": { "apiVersion": { "pattern": "^[0-6][.]|^[0-6]$" } } }, + "then": { + "properties": { + "dataType": { + "$ref": "#/definitions/dataType", + "default": "f5.telemetry", + "minLength": 1 + } + } + }, + "else": { + "if": { "properties": { "apiVersion": { "pattern": "^7[.]|^7$" } } }, + "then": { + "properties": { + "dataType": { + "$ref": "#/definitions/dataType", + "default": "_doc", + "minLength": 1 + } + } + }, + "else": { + "allOf": [ + { "not": { "required": [ "dataType" ] } } + ] + } + } + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Sumo_Logic" } } }, + "then": { + "required": [ + "host", + "passphrase" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "protocol": { "$ref": "#/definitions/protocols", "default": "https" }, + "port": { "$ref": "#/definitions/port", "default": 443 }, + "path": { "$ref": "#/definitions/path", "default": "/receiver/v1/http/" }, + "passphrase": { "$ref": "base_schema.json#/definitions/secret" } + } + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Statsd" } } }, + "then": { + "required": [ + "host" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "protocol": { + "title": "Protocol", + "type": "string", + "enum": [ "tcp", "udp" ], + "default": "udp" + }, + "port": { "$ref": "#/definitions/port", "default": 8125 }, + "addTags": { "$ref": "#/definitions/autoTaggingStatsd" }, + "convertBooleansToMetrics": { "$ref": "#/definitions/convertBooleansToMetrics", "default": "false" } + } + }, + "else": {} + }, + { + "if": { + "properties": { "type": { "enum": ["Google_Cloud_Monitoring", "Google_StackDriver", "Google_Cloud_Logging"] } } + }, + "then": { + "required": [ + "serviceEmail" + ], + "properties": { + "privateKeyId": { "$ref": "#/definitions/privateKeyId" }, + "serviceEmail": { "$ref": "#/definitions/serviceEmail" }, + "privateKey": { "$ref": "base_schema.json#/definitions/secret" }, + "useServiceAccountToken": { "$ref": "#/definitions/useServiceAccountToken", "default": false }, + "reportInstanceMetadata": { "$ref": "#/definitions/reportInstanceMetadata", "default": false } + }, + "allOf": [ + { + "dependencies": { + "privateKeyId": { + "anyOf": [ + { "not": {"required": [ "useServiceAccountToken" ] } }, + { "properties": { "useServiceAccountToken": { "const": false } } } + ] + } + } + }, + { + "dependencies": { + "privateKey": { + "anyOf": [ + { "not": {"required": [ "useServiceAccountToken" ] } }, + { "properties": { "useServiceAccountToken": { "const": false } } } + ] + } + } + }, + { + "if": { + "anyOf": [ + { "not": { "required" : [ "useServiceAccountToken"] } }, + { "properties": { "useServiceAccountToken": { "const": false } } } + ] + }, + "then": { "required": ["privateKeyId", "privateKey"] }, + "else": { "not": { "required": ["privateKeyId", "privateKey"] } } + }, + { + "if": { "properties": { "type": { "enum": ["Google_Cloud_Monitoring", "Google_StackDriver"] } } }, + "then": { + "properties": { + "projectId": { "$ref": "#/definitions/projectId"} + }, + "required": ["projectId"] + } + }, + { + "if": { "properties": { "type": { "const": "Google_Cloud_Logging" } } }, + "then": { + "properties": { + "logScope": { "$ref": "#/definitions/logScope", "default": "projects" }, + "logScopeId": { "$ref": "#/definitions/logScopeId"}, + "logId": { "$ref": "#/definitions/logId"} + }, + "required": ["logScope", "logScopeId", "logId"] + } + } + ] + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "F5_Cloud" } } }, + "then": { + "required": [ + "f5csTenantId", + "f5csSensorId", + "payloadSchemaNid", + "serviceAccount", + "targetAudience" + ], + "properties": { + "port": { "$ref": "#/definitions/port", "default": 443 }, + "eventSchemaVersion": { "$ref": "#/definitions/eventSchemaVersion" }, + "f5csTenantId": { "$ref": "#/definitions/f5csTenantId" }, + "f5csSensorId": { "$ref": "#/definitions/f5csSensorId" }, + "payloadSchemaNid": { "$ref": "#/definitions/payloadSchemaNid" }, + "serviceAccount": { "$ref": "#/definitions/serviceAccount" }, + "targetAudience": { "$ref": "#/definitions/targetAudience" }, + "useSSL": { "$ref": "#/definitions/useSSL", "default": true } + }, + "nodeSupportVersion": "8.11.1" + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "DataDog" } } }, + "then": { + "required": [ + "apiKey" + ], + "properties": { + "apiKey": { "$ref": "#/definitions/apiKey" }, + "compressionType": { "$ref": "#/definitions/compressionType", "default": "none" }, + "region": { "$ref": "#/definitions/region", "enum": ["US1", "US3", "EU1", "US1-FED"], "default": "US1" }, + "service": { "$ref": "#/definitions/service", "default": "f5-telemetry" }, + "metricPrefix": { "$ref": "#/definitions/metricPrefix" }, + "convertBooleansToMetrics": { "$ref": "#/definitions/convertBooleansToMetrics", "default": "false" }, + "customTags": { "$ref": "#/definitions/customTags" } + } + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "OpenTelemetry_Exporter" } } }, + "then": { + "required": [ + "host", + "port" + ], + "properties": { + "host": { "$ref": "#/definitions/host" }, + "port": { "$ref": "#/definitions/port" }, + "headers": { "$ref": "#/definitions/headers" }, + "metricsPath": { "$ref": "#/definitions/path" }, + "convertBooleansToMetrics": { "$ref": "#/definitions/convertBooleansToMetrics", "default": "false" } + }, + "nodeSupportVersion": "8.11.1" + }, + "else": {} + } + ] + }, + "else": {} + } + ] +} diff --git a/src/schema/1.26.0/controls_schema.json b/src/schema/1.26.0/controls_schema.json new file mode 100644 index 00000000..2bbfcff8 --- /dev/null +++ b/src/schema/1.26.0/controls_schema.json @@ -0,0 +1,52 @@ +{ + "$id": "controls_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming Controls schema", + "description": "", + "type": "object", + "allOf": [ + { + "if": { "properties": { "class": { "const": "Controls" } } }, + "then": { + "required": [ + "class" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Controls class", + "type": "string", + "enum": [ "Controls" ] + }, + "logLevel": { + "title": "Logging Level", + "description": "", + "type": "string", + "default": "info", + "enum": [ + "debug", + "info", + "error" + ] + }, + "debug": { + "title": "Enable debug mode", + "description": "", + "type": "boolean", + "default": false + }, + "memoryThresholdPercent": { + "title": "Memory Usage Threshold (Percentage of Available Process Memory)", + "description": "Once memory usage reaches this value, processing may temporarily cease until levels return below threshold. Defaults to 90%", + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 90 + } + }, + "additionalProperties": false + }, + "else": {} + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/endpoints_schema.json b/src/schema/1.26.0/endpoints_schema.json new file mode 100644 index 00000000..73fc5ee7 --- /dev/null +++ b/src/schema/1.26.0/endpoints_schema.json @@ -0,0 +1,158 @@ +{ + "$id": "endpoints_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming Endpoints schema", + "description": "", + "type": "object", + "definitions": { + "endpoint": { + "title": "Telemetry Endpoint", + "description": "", + "type": "object", + "properties": { + "enable": { + "title": "Enable endpoint", + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "name": { + "title": "Endpoint name", + "type": "string", + "minLength": 1 + }, + "path": { + "title": "Path to query data from", + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": false + }, + "endpoints": { + "title": "Telemetry Endpoints", + "description": "", + "type": "object", + "properties": { + "enable": { + "title": "Enable endpoints", + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "basePath": { + "title": "Base Path", + "description": "Optional base path value to prepend to each individual endpoint paths", + "type": "string", + "default": "" + }, + "items": { + "title": "Items", + "description": "Object with each property an endpoint with their own properties", + "type": "object", + "additionalProperties": { + "allOf": [ + { + "$ref": "#/definitions/endpoint" + }, + { + "required": [ "path" ] + } + ] + }, + "minProperties": 1 + } + } + }, + "endpointsObjectRef": { + "allOf": [ + { + "$ref": "#/definitions/endpoints" + }, + { + "properties": { + "enable": {}, + "basePath": {}, + "items": {} + }, + "required": [ "items" ], + "additionalProperties": false + } + ] + }, + "endpointObjectRef": { + "allOf": [ + { + "$ref": "#/definitions/endpoint" + }, + { + "properties": { + "enable": {}, + "name": {}, + "path": {} + }, + "required": [ "name", "path" ], + "additionalProperties": false + } + ] + }, + "endpointsPointerRef": { + "title": "Telemetry_Endpoints Name", + "description": "Name of the Telemetry_Endpoints object", + "type": "string", + "declarationClass": "Telemetry_Endpoints", + "minLength": 1 + }, + "endpointsItemPointerRef": { + "title": "Telemetry_Endpoints Name and Item Key", + "description": "Name of the Telemetry_Endpoints object and the endpoint item key, e.g endpointsA/item1", + "type": "string", + "declarationClassProp": { + "path" :"Telemetry_Endpoints/items", + "partsNum": 2 + }, + "minLength": 1 + } + }, + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_Endpoints" } } }, + "then": { + "required": [ + "class", + "items" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Endpoints class", + "type": "string", + "enum": [ "Telemetry_Endpoints" ] + } + }, + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "class": {}, + "enable": {}, + "basePath": {}, + "items": {} + }, + "additionalProperties": false + }, + { + "$ref": "#/definitions/endpoints" + } + ] + }, + "else": {} + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/ihealth_poller_schema.json b/src/schema/1.26.0/ihealth_poller_schema.json new file mode 100644 index 00000000..d5bcb9cf --- /dev/null +++ b/src/schema/1.26.0/ihealth_poller_schema.json @@ -0,0 +1,238 @@ +{ + "$id": "ihealth_poller_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming iHealth Poller schema", + "description": "", + "type": "object", + "definitions": { + "time24hr": { + "title": "Time in HH:MM, 24hr", + "description": "", + "type": "string", + "pattern": "^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]?$" + }, + "iHealthPoller": { + "$comment": "system_schema.json should be updated when new property added", + "title": "iHealth Poller", + "description": "", + "type": "object", + "required": [ + "interval", + "username", + "passphrase" + ], + "properties": { + "enable": { + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "trace": { + "default": false, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/trace" + } + ] + }, + "proxy": { + "title": "Proxy configuration", + "properties": { + "port": { + "default": 80 + }, + "protocol": { + "default": "http" + } + }, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/proxy" + } + ] + }, + "username": { + "title": "iHealth Username", + "$ref": "base_schema.json#/definitions/username" + }, + "passphrase": { + "title": "iHealth Passphrase", + "$ref": "base_schema.json#/definitions/secret" + }, + "downloadFolder": { + "title": "Directory to download Qkview to", + "description": "", + "type": "string", + "minLength": 1, + "pathExists": true + }, + "interval": { + "title": "Operating interval", + "description": "" , + "type": "object", + "properties": { + "timeWindow": { + "title": "Two or more hours window in 24hr format that iHealth data can be sent", + "description": "", + "type": "object", + "properties": { + "start": { + "title": "Time when the window starts", + "$ref": "#/definitions/time24hr" + }, + "end": { + "title": "Time when the window ends", + "$ref": "#/definitions/time24hr" + } + }, + "timeWindowMinSize": 120, + "required": [ "start", "end" ], + "additionalProperties": false + }, + "frequency": { + "title": "Interval frequency", + "description": "", + "type": "string", + "default": "daily", + "enum": [ + "daily", + "weekly", + "monthly" + ] + } + + }, + "required": [ + "timeWindow" + ], + "allOf": [ + { + "if": { "properties": { "frequency": { "const": "daily" } } }, + "then": { + "properties": { + "timeWindow": {}, + "frequency": {} + }, + "additionalProperties": false + } + }, + { + "if": { "properties": { "frequency": { "const": "weekly" } } }, + "then": { + "properties": { + "timeWindow": {}, + "frequency": {}, + "day": { + "title": "", + "description": "", + "oneOf": [ + { + "type": "string", + "pattern": "^([mM]onday|[tT]uesday|[wW]ednesday|[tT]hursday|[fF]riday|[sS]aturday|[sS]unday)$" + }, + { + "$comment": "0 and 7 eq. Sunday", + "type": "integer", + "minimum": 0, + "maximum": 7 + } + ] + } + }, + "required": [ "day" ], + "additionalProperties": false + } + }, + { + "if": { "properties": { "frequency": { "const": "monthly" } } }, + "then": { + "properties": { + "timeWindow": {}, + "frequency": {}, + "day": { + "title": "", + "description": "", + "type": "integer", + "minimum": 1, + "maximum": 31 + } + }, + "required": [ "day" ], + "additionalProperties": false + } + } + ] + } + } + }, + "iHealthPollerPointerRef": { + "type": "string", + "minLength": 1, + "declarationClass": "Telemetry_iHealth_Poller" + }, + "iHealthPollerObjectRef": { + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "enable": {}, + "trace": {}, + "interval": {}, + "proxy": {}, + "username": {}, + "passphrase": {}, + "downloadFolder": {} + }, + "additionalProperties": false + }, + { + "$ref": "ihealth_poller_schema.json#/definitions/iHealthPoller" + } + ] + } + }, + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_iHealth_Poller" } } }, + "then": { + "required": [ + "class", + "username", + "passphrase" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming iHealth Poller class", + "type": "string", + "enum": [ "Telemetry_iHealth_Poller" ] + } + }, + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "class": {}, + "enable": {}, + "trace": {}, + "interval": {}, + "proxy": {}, + "username": {}, + "passphrase": {}, + "downloadFolder": {} + }, + "additionalProperties": false + }, + { + "$ref": "#/definitions/iHealthPoller" + } + ] + }, + "else": {}, + "$comment": "Telemetry_iHealth_Poller should be either built-in within Telemetry_System or referenced by Telemetry_System(s), otherwise it will be treated as disabled" + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/listener_schema.json b/src/schema/1.26.0/listener_schema.json new file mode 100644 index 00000000..d3b9434e --- /dev/null +++ b/src/schema/1.26.0/listener_schema.json @@ -0,0 +1,85 @@ +{ + "$id": "listener_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming event listener schema", + "description": "", + "type": "object", + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_Listener" } } }, + "then": { + "required": [ + "class" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Event Listener class", + "type": "string", + "enum": [ "Telemetry_Listener" ] + }, + "enable": { + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "trace": { + "default": false, + "oneOf": [ + { + "$ref": "base_schema.json#/definitions/trace" + }, + { + "$ref": "base_schema.json#/definitions/traceV2" + } + ] + }, + "port": { + "minimum": 1024, + "maximum": 65535, + "default": 6514, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/port" + } + ] + }, + "tag": { + "$comment": "Deprecated! Use actions with a setTag action.", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/tag" + } + ] + }, + "match": { + "default": "", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/match" + } + ] + }, + "actions": { + "title": "Actions", + "description": "Actions to be performed on the listener.", + "default": [ + { + "setTag": { + "tenant": "`T`", + "application": "`A`" + } + } + ], + "allOf": [{ "$ref": "actions_schema.json#/definitions/inputDataStreamActionsChain" }] + } + }, + "additionalProperties": false + }, + "else": {} + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/namespace_schema.json b/src/schema/1.26.0/namespace_schema.json new file mode 100644 index 00000000..f6cb09fc --- /dev/null +++ b/src/schema/1.26.0/namespace_schema.json @@ -0,0 +1,92 @@ +{ + "$id": "namespace_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming Namespace schema", + "description": "", + "type": "object", + "definitions": { + "namespace": { + "required": [ + "class" + ], + "type": "object", + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Namespace class", + "type": "string", + "enum": [ "Telemetry_Namespace" ] + } + }, + "additionalProperties": { + "$comment": "All objects supported under a Telemetry Namespace", + "properties": { + "class": { + "title": "Class", + "type": "string", + "enum": [ + "Telemetry_System", + "Telemetry_System_Poller", + "Telemetry_Listener", + "Telemetry_Consumer", + "Telemetry_Pull_Consumer", + "Telemetry_iHealth_Poller", + "Telemetry_Endpoints", + "Shared" + ] + } + }, + "allOf": [ + { + "$ref": "system_schema.json#" + }, + { + "$ref": "system_poller_schema.json#" + }, + { + "$ref": "listener_schema.json#" + }, + { + "$ref": "consumer_schema.json#" + }, + { + "$ref": "pull_consumer_schema.json#" + }, + { + "$ref": "ihealth_poller_schema.json#" + }, + { + "$ref": "endpoints_schema.json#" + }, + { + "$ref": "shared_schema.json#" + } + ] + } + } + }, + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_Namespace" } } }, + "then": { + "required": [ + "class" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Namespace class", + "type": "string", + "enum": [ "Telemetry_Namespace" ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/namespace" + } + ] + }, + "else": {} + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/pull_consumer_schema.json b/src/schema/1.26.0/pull_consumer_schema.json new file mode 100644 index 00000000..0747cbfd --- /dev/null +++ b/src/schema/1.26.0/pull_consumer_schema.json @@ -0,0 +1,101 @@ +{ + "$id": "pull_consumer_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming Pull Consumer schema", + "description": "", + "type": "object", + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_Pull_Consumer" } } }, + "then": { + "required": [ + "class", + "type", + "systemPoller" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming Pull Consumer class", + "type": "string", + "enum": [ "Telemetry_Pull_Consumer" ] + }, + "enable": { + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "trace": { + "default": false, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/trace" + } + ] + }, + "type": { + "title": "Type", + "description": "" , + "type": "string", + "enum": [ + "default", + "Prometheus" + ] + }, + "systemPoller": { + "title": "Pointer to System Poller(s)", + "anyOf": [ + { + "$ref": "system_poller_schema.json#/definitions/systemPollerPointerRef" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "system_poller_schema.json#/definitions/systemPollerPointerRef" + } + ] + }, + "minItems": 1 + } + ] + } + }, + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "class": {}, + "enable": {}, + "trace": {}, + "type": {}, + "systemPoller": {} + }, + "additionalProperties": false + }, + { + "if": { "properties": { "type": { "const": "default" } } }, + "then": { + "required": [], + "properties": {} + }, + "else": {} + }, + { + "if": { "properties": { "type": { "const": "Prometheus" } } }, + "then": { + "required": [], + "properties": {} + }, + "else": {} + } + ] + }, + "else": {} + } + ] +} diff --git a/src/schema/1.26.0/shared_schema.json b/src/schema/1.26.0/shared_schema.json new file mode 100644 index 00000000..aa96cb2e --- /dev/null +++ b/src/schema/1.26.0/shared_schema.json @@ -0,0 +1,50 @@ +{ + "$id": "shared_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry streaming Shared schema", + "description": "", + "type": "object", + "allOf": [ + { + "if": { "properties": { "class": { "const": "Shared" } } }, + "then": { + "required": [ + "class" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry streaming Shared class", + "type": "string", + "enum": [ "Shared" ] + } + }, + "additionalProperties": { + "properties": { + "class": { + "title": "Class", + "type": "string", + "enum": [ + "Constants", + "Secret" + ] + } + }, + "allOf": [ + { + "if": { "properties": { "class": { "const": "Constants" } } }, + "then": { "$ref": "base_schema.json#/definitions/constants" }, + "else": {} + }, + { + "if": { "properties": { "class": { "const": "Secret" } } }, + "then": { "$ref": "base_schema.json#/definitions/secret" }, + "else": {} + } + ] + } + }, + "else": {} + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/system_poller_schema.json b/src/schema/1.26.0/system_poller_schema.json new file mode 100644 index 00000000..dcb3a454 --- /dev/null +++ b/src/schema/1.26.0/system_poller_schema.json @@ -0,0 +1,242 @@ +{ + "$id": "system_poller_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming system poller schema", + "description": "", + "type": "object", + "definitions": { + "systemPoller": { + "$comment": "system_schema.json should be updated when new property added", + "title": "System Poller", + "description": "", + "type": "object", + "properties": { + "enable": { + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "interval": { + "title": "Collection interval (in seconds)", + "description": "If endpointList is specified, minimum=1. Without endpointList, minimum=60 and maximum=60000. Allows setting interval=0 to not poll on an interval.", + "type": "integer", + "default": 300 + }, + "trace": { + "$ref": "base_schema.json#/definitions/trace" + }, + "tag": { + "$comment": "Deprecated! Use actions with a setTag action.", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/tag" + } + ] + }, + "actions": { + "title": "Actions", + "description": "Actions to be performed on the systemPoller.", + "default": [ + { + "setTag": { + "tenant": "`T`", + "application": "`A`" + } + } + ], + "allOf": [{ "$ref": "actions_schema.json#/definitions/inputDataStreamActionsChain" }] + }, + "endpointList": { + "title": "Endpoint List", + "description": "List of endpoints to use in data collection", + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "endpoints_schema.json#/definitions/endpointsPointerRef" + }, + { + "$ref": "endpoints_schema.json#/definitions/endpointsItemPointerRef" + }, + { + "if": { "required": [ "items" ]}, + "then": { + "$ref": "endpoints_schema.json#/definitions/endpointsObjectRef" + }, + "else": { + "$ref": "endpoints_schema.json#/definitions/endpointObjectRef" + } + } + + ] + }, + "minItems": 1 + }, + { + "$ref": "endpoints_schema.json#/definitions/endpointsPointerRef" + }, + { + "$ref": "endpoints_schema.json#/definitions/endpointsObjectRef" + } + ] + } + }, + "oneOf": [ + { + "allOf": [ + { + "if": { "required": [ "endpointList" ] }, + "then": { + "properties": { + "interval": { + "minimum": 1 + } + } + }, + "else": { + "properties":{ + "interval": { + "minimum": 60, + "maximum": 6000 + } + } + } + } + ] + }, + { + "allOf": [ + { + "properties": { + "interval": { + "enum": [0] + } + } + } + ] + } + ] + }, + "systemPollerPointerRef": { + "type": "string", + "minLength": 1, + "declarationClass": "Telemetry_System_Poller" + }, + "systemPollerObjectRef": { + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "enable": {}, + "trace": {}, + "interval": {}, + "tag": {}, + "actions": {}, + "endpointList": {} + }, + "additionalProperties": false + }, + { + "$ref": "#/definitions/systemPoller" + } + ] + } + }, + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_System_Poller" } } }, + "then": { + "required": [ + "class" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming System Poller class", + "type": "string", + "enum": [ "Telemetry_System_Poller" ] + }, + "host": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "default": "localhost", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/host" + } + ] + }, + "port": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "default": 8100, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/port" + } + ] + }, + "protocol": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "default": "http", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/protocol" + } + ] + }, + "allowSelfSignedCert": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "title": "Allow Self-Signed Certificate", + "default": false, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/allowSelfSignedCert" + } + ] + }, + "enableHostConnectivityCheck": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "$ref": "base_schema.json#/definitions/enableHostConnectivityCheck" + }, + "username": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "$ref": "base_schema.json#/definitions/username" + }, + "passphrase": { + "$comment": "Deprecated! Use Telemetry_System to define target device", + "$ref": "base_schema.json#/definitions/secret" + } + }, + "allOf": [ + { + "$comment": "This allows enforcement of no additional properties in this nested schema - could reuse above properties but prefer a separate block", + "properties": { + "class": {}, + "enable": {}, + "trace": {}, + "interval": {}, + "tag": {}, + "host": {}, + "port": {}, + "protocol": {}, + "allowSelfSignedCert": {}, + "enableHostConnectivityCheck": {}, + "username": {}, + "passphrase": {}, + "actions": {}, + "endpointList": {} + }, + "additionalProperties": false + }, + { + "$ref": "#/definitions/systemPoller" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/schema/1.26.0/system_schema.json b/src/schema/1.26.0/system_schema.json new file mode 100644 index 00000000..cba58faa --- /dev/null +++ b/src/schema/1.26.0/system_schema.json @@ -0,0 +1,121 @@ +{ + "$id": "system_schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Telemetry Streaming System schema", + "description": "", + "type": "object", + "allOf": [ + { + "if": { "properties": { "class": { "const": "Telemetry_System" } } }, + "then": { + "required": [ + "class" + ], + "properties": { + "class": { + "title": "Class", + "description": "Telemetry Streaming System class", + "type": "string", + "enum": [ "Telemetry_System" ] + }, + "enable": { + "title": "Enable all pollers attached to device", + "default": true, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/enable" + } + ] + }, + "trace": { + "$ref": "base_schema.json#/definitions/trace" + }, + "host": { + "title": "System connection address", + "default": "localhost", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/host" + } + ] + }, + "port": { + "title": "System connection port", + "default": 8100, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/port" + } + ] + }, + "protocol": { + "title": "System connection protocol", + "default": "http", + "allOf": [ + { + "$ref": "base_schema.json#/definitions/protocol" + } + ] + }, + "allowSelfSignedCert": { + "title": "Allow Self-Signed Certificate", + "default": false, + "allOf": [ + { + "$ref": "base_schema.json#/definitions/allowSelfSignedCert" + } + ] + }, + "enableHostConnectivityCheck": { + "$ref": "base_schema.json#/definitions/enableHostConnectivityCheck" + }, + "username": { + "title": "System Username", + "$ref": "base_schema.json#/definitions/username" + }, + "passphrase": { + "title": "System Passphrase", + "$ref": "base_schema.json#/definitions/secret" + }, + "systemPoller": { + "title": "System Poller declaration", + "oneOf": [ + { + "$ref": "system_poller_schema.json#/definitions/systemPollerPointerRef" + }, + { + "$ref": "system_poller_schema.json#/definitions/systemPollerObjectRef" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "system_poller_schema.json#/definitions/systemPollerObjectRef" + }, + { + "$ref": "system_poller_schema.json#/definitions/systemPollerPointerRef" + } + ] + }, + "minItems": 1 + } + ] + }, + "iHealthPoller": { + "title": "iHealth Poller declaration", + "oneOf": [ + { + "$ref": "ihealth_poller_schema.json#/definitions/iHealthPollerPointerRef" + }, + { + "$ref": "ihealth_poller_schema.json#/definitions/iHealthPollerObjectRef" + } + ] + } + }, + "additionalProperties": false + } + } + ] +} \ No newline at end of file diff --git a/src/schema/latest/base_schema.json b/src/schema/latest/base_schema.json index 5b6b4904..01d5de0f 100644 --- a/src/schema/latest/base_schema.json +++ b/src/schema/latest/base_schema.json @@ -242,8 +242,8 @@ "description": "Version of ADC Declaration schema this declaration uses", "type": "string", "$comment": "IMPORTANT: In enum array, please put current schema version first, oldest-supported version last. Keep enum array sorted most-recent-first.", - "enum": [ "1.25.0", "1.24.0", "1.23.0", "1.22.0", "1.21.0", "1.20.1", "1.20.0", "1.19.0", "1.18.0", "1.17.0", "1.16.0", "1.15.0", "1.14.0", "1.13.0", "1.12.0", "1.11.0", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.1.0", "1.0.0", "0.9.0" ], - "default": "1.25.0" + "enum": [ "1.26.0", "1.25.0", "1.24.0", "1.23.0", "1.22.0", "1.21.0", "1.20.1", "1.20.0", "1.19.0", "1.18.0", "1.17.0", "1.16.0", "1.15.0", "1.14.0", "1.13.0", "1.12.0", "1.11.0", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.1.0", "1.0.0", "0.9.0" ], + "default": "1.26.0" }, "$schema": { "title": "Schema", diff --git a/test/customMochaReporter.js b/test/customMochaReporter.js index b68de63e..ccdd3441 100644 --- a/test/customMochaReporter.js +++ b/test/customMochaReporter.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/cloud/awsTests.js b/test/functional/cloud/awsTests.js index 8d4ee9c6..4662d3a3 100644 --- a/test/functional/cloud/awsTests.js +++ b/test/functional/cloud/awsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -86,7 +86,7 @@ describe('AWS Cloud-based Tests', function () { it('should verify TS service is running', () => { const uri = `${constants.BASE_ILX_URI}/info`; - return new Promise((resolve) => setTimeout(resolve, 5000)) + return new Promise((resolve) => { setTimeout(resolve, 5000); }) .then(() => testUtil.makeRequest(VM_IP, uri, options)) .then((data) => { data = data || {}; @@ -120,7 +120,7 @@ describe('AWS Cloud-based Tests', function () { it('should retrieve systemPoller info from bucket', function () { this.timeout(180000); - return new Promise((resolve) => setTimeout(resolve, 90000)) + return new Promise((resolve) => { setTimeout(resolve, 90000); }) .then(() => new Promise((resolve, reject) => { s3.listObjects({ Bucket: BUCKET, MaxKeys: 5 }, (err, data) => { if (err) reject(err); @@ -184,7 +184,7 @@ describe('AWS Cloud-based Tests', function () { const startTime = new Date().toISOString(); // metrics take around 2-3 minutes to show up - return new Promise((resolve) => setTimeout(resolve, 180000)) + return new Promise((resolve) => { setTimeout(resolve, 180000); }) .then(() => { // get system poller data const uri = `${constants.BASE_ILX_URI}/systempoller/My_System`; diff --git a/test/functional/cloud/azureTests.js b/test/functional/cloud/azureTests.js index e3c5c314..0d5fbd89 100644 --- a/test/functional/cloud/azureTests.js +++ b/test/functional/cloud/azureTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -72,7 +72,7 @@ describe('Azure Cloud-based Tests', function () { it('should verify TS service is running', () => { const uri = `${constants.BASE_ILX_URI}/info`; - return new Promise((resolve) => setTimeout(resolve, 5000)) + return new Promise((resolve) => { setTimeout(resolve, 5000); }) .then(() => testUtil.makeRequest(VM_IP, uri, options)) .then((data) => { data = data || {}; @@ -119,7 +119,7 @@ describe('Azure Cloud-based Tests', function () { 'where TimeGenerated > ago(5m)' ].join(' | '); - return new Promise((resolve) => setTimeout(resolve, 60000)) + return new Promise((resolve) => { setTimeout(resolve, 60000); }) .then(() => azureUtil.queryLogs(laReaderToken, WORKSPACE_ID, queryString, CLOUD_TYPE)) .then((results) => { testUtil.logger.info('Response from Log Analytics:', { hostname: VM_HOSTNAME, results }); @@ -158,7 +158,7 @@ describe('Azure Cloud-based Tests', function () { it('should retrieve system poller info from Application Insights', () => { testUtil.logger.info('Delay 120000ms to ensure App Insights api data ready'); - return new Promise((resolve) => setTimeout(resolve, 120000)) + return new Promise((resolve) => { setTimeout(resolve, 120000); }) .then(() => azureUtil.queryAppInsights(APPINS_APP_ID, APPINS_API_KEY, CLOUD_TYPE)) .then((response) => { testUtil.logger.info(response); diff --git a/test/functional/consumerSystemTests.js b/test/functional/consumerSystemTests.js index 450494b5..cf085fde 100644 --- a/test/functional/consumerSystemTests.js +++ b/test/functional/consumerSystemTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/consumersTests/azureApplicationInsightsTests.js b/test/functional/consumersTests/azureApplicationInsightsTests.js index c7cb049e..6324378d 100644 --- a/test/functional/consumersTests/azureApplicationInsightsTests.js +++ b/test/functional/consumersTests/azureApplicationInsightsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/consumersTests/azureLogAnalyticsTests.js b/test/functional/consumersTests/azureLogAnalyticsTests.js index 7faf7dfa..6b1fd471 100644 --- a/test/functional/consumersTests/azureLogAnalyticsTests.js +++ b/test/functional/consumersTests/azureLogAnalyticsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -78,7 +78,7 @@ function test() { `where hostname_s == "${dut.hostname}"`, 'where TimeGenerated > ago(5m)' ].join(' | '); - return new Promise((resolve) => setTimeout(resolve, 30000)) + return new Promise((resolve) => { setTimeout(resolve, 30000); }) .then(() => azureUtil.queryLogs(oauthToken, WORKSPACE_ID, queryString)) .then((results) => { util.logger.info('Response from Log Analytics:', { hostname: dut.hostname, results }); @@ -94,7 +94,7 @@ function test() { `where hostname_s == "${dut.hostname}"`, `where test_s == "${testDataTimestamp}"` ].join(' | '); - return new Promise((resolve) => setTimeout(resolve, 10000)) + return new Promise((resolve) => { setTimeout(resolve, 10000); }) .then(() => azureUtil.queryLogs(oauthToken, WORKSPACE_ID, queryString)) .then((results) => { util.logger.info('Response from Log Analytics:', { hostname: dut.hostname, results }); diff --git a/test/functional/consumersTests/elasticsearchTests.js b/test/functional/consumersTests/elasticsearchTests.js index 9a471f76..ff682494 100644 --- a/test/functional/consumersTests/elasticsearchTests.js +++ b/test/functional/consumersTests/elasticsearchTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -84,7 +84,7 @@ function test() { port: ES_HTTP_PORT }; - return new Promise((resolve) => setTimeout(resolve, 5000)) + return new Promise((resolve) => { setTimeout(resolve, 5000); }) .then(() => util.makeRequest(CONSUMER_HOST.ip, uri, options)) .then((data) => { const nodeInfo = data._nodes; @@ -155,7 +155,7 @@ function test() { ); }; - it('should check for event listener data for', () => new Promise((resolve) => setTimeout(resolve, 10000)) + it('should check for event listener data for', () => new Promise((resolve) => { setTimeout(resolve, 10000); }) .then(() => query(`size=1&q=data.testType:${ES_CONSUMER_NAME}%20AND%20data.hostname=${dut.hostname}`)) .then((data) => { util.logger.info('ElasticSearch response:', data); @@ -179,7 +179,7 @@ function test() { return Promise.resolve(); })); - it('should have system poller data', () => new Promise((resolve) => setTimeout(resolve, 10000)) + it('should have system poller data', () => new Promise((resolve) => { setTimeout(resolve, 10000); }) .then(() => query(`size=1&q=system.hostname:${dut.hostname}`)) .then((data) => { util.logger.info('ElasticSearch response:', data); diff --git a/test/functional/consumersTests/f5CloudTests.js b/test/functional/consumersTests/f5CloudTests.js index eeddee61..151b6434 100644 --- a/test/functional/consumersTests/f5CloudTests.js +++ b/test/functional/consumersTests/f5CloudTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/consumersTests/fluentdTests.js b/test/functional/consumersTests/fluentdTests.js index 645484aa..cf47a3f5 100644 --- a/test/functional/consumersTests/fluentdTests.js +++ b/test/functional/consumersTests/fluentdTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -104,7 +104,7 @@ function test() { const systemPollerData = {}; const fluentLogs = []; - before(() => new Promise((resolve) => setTimeout(resolve, 30 * 1000)) + before(() => new Promise((resolve) => { setTimeout(resolve, 30 * 1000); }) .then(() => dutUtils.getSystemPollersData((hostObj, data) => { systemPollerData[hostObj.hostname] = data[0]; }))); @@ -113,7 +113,7 @@ function test() { .then((data) => { util.logger.info('Fluentd docker logs:', data); // push all relevant logs lines into log array for later tests - const fluentdLogRegex = new RegExp(/\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{1,10}\s\+\d{1,5} /); + const fluentdLogRegex = /\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{1,10}\s\+\d{1,5} /; const logLines = data.split(fluentdLogRegex); logLines.forEach((line) => { if (line.startsWith(FLUENTD_TAG_NAME)) { diff --git a/test/functional/consumersTests/googleCloudMonitoringTests.js b/test/functional/consumersTests/googleCloudMonitoringTests.js index c6ee589c..d7781001 100644 --- a/test/functional/consumersTests/googleCloudMonitoringTests.js +++ b/test/functional/consumersTests/googleCloudMonitoringTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -113,7 +113,7 @@ function test() { `interval.endTime=${timeEnd}`, `filter=metric.type="custom.googleapis.com/system/tmmCpu" AND resource.labels.namespace="${dut.hostname}"` ].join('&'); - return new Promise((resolve) => setTimeout(resolve, 30000)) + return new Promise((resolve) => { setTimeout(resolve, 30000); }) .then(() => queryGoogle(queryString)) .then((timeSeries) => { sharedUtil.logger.info('Response from Google Cloud Monitoring:', { hostname: dut.hostname, timeSeries }); diff --git a/test/functional/consumersTests/kafkaTests.js b/test/functional/consumersTests/kafkaTests.js index c3323e99..b834e84d 100644 --- a/test/functional/consumersTests/kafkaTests.js +++ b/test/functional/consumersTests/kafkaTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/consumersTests/openTelemetryExporterTests.js b/test/functional/consumersTests/openTelemetryExporterTests.js index bad41a12..1b2ef5cf 100644 --- a/test/functional/consumersTests/openTelemetryExporterTests.js +++ b/test/functional/consumersTests/openTelemetryExporterTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -57,7 +57,10 @@ const DECLARATION = JSON.parse(fs.readFileSync(constants.DECL.BASIC)); function runRemoteCmd(cmd) { return testUtil.performRemoteCmd( - CONSUMER_HOST.ip, CONSUMER_HOST.username, cmd, { password: CONSUMER_HOST.password } + CONSUMER_HOST.ip, + CONSUMER_HOST.username, + cmd, + { password: CONSUMER_HOST.password } ); } diff --git a/test/functional/consumersTests/splunkTests.js b/test/functional/consumersTests/splunkTests.js index 74eacc17..3ee8b325 100644 --- a/test/functional/consumersTests/splunkTests.js +++ b/test/functional/consumersTests/splunkTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -83,7 +83,7 @@ function test() { }; // splunk container takes about 30 seconds to come up - return new Promise((resolve) => setTimeout(resolve, 10000)) + return new Promise((resolve) => { setTimeout(resolve, 10000); }) .then(() => util.makeRequest(CONSUMER_HOST.ip, uri, options)) .then((data) => { util.logger.info(`Splunk response ${uri}`, data); @@ -280,13 +280,16 @@ function test() { let uri = `${baseUri}?${outputMode}`; let sid; - return util.makeRequest(CONSUMER_HOST.ip, uri, + return util.makeRequest( + CONSUMER_HOST.ip, + uri, Object.assign(util.deepCopy(options), { method: 'POST', body: querystring.stringify({ search: searchString }) - })) + }) + ) .then((data) => { sid = data.sid; assert.notStrictEqual(sid, undefined); @@ -295,7 +298,7 @@ function test() { return new Promise((resolve, reject) => { const waitUntilDone = () => { uri = `${baseUri}/${sid}?${outputMode}`; - return new Promise((resolveTimer) => setTimeout(resolveTimer, 100)) + return new Promise((resolveTimer) => { setTimeout(resolveTimer, 100); }) .then(() => util.makeRequest(CONSUMER_HOST.ip, uri, options)) .then((status) => { const dispatchState = status.entry[0].content.dispatchState; @@ -324,7 +327,7 @@ function test() { const searchQueryEL = () => `search source=f5.telemetry | spath testType | search testType="${SPLUNK_CONSUMER_NAME}" | search hostname="${dut.hostname}" | search testDataTimestamp="${testDataTimestamp}" | head 1`; if (testSetup.format.queryEventsTests) { - it(`should check for system poller data from:${dut.hostalias}`, () => new Promise((resolve) => setTimeout(resolve, 30000)) + it(`should check for system poller data from:${dut.hostalias}`, () => new Promise((resolve) => { setTimeout(resolve, 30000); }) .then(() => { util.logger.info(`Splunk search query for system poller data: ${searchQuerySP()}`); return query(searchQuerySP()); @@ -351,7 +354,7 @@ function test() { } if (testSetup.format.metricsTests) { - it(`should check for system poller metrics from:${dut.hostalias}`, () => new Promise((resolve) => setTimeout(resolve, 30000)) + it(`should check for system poller metrics from:${dut.hostalias}`, () => new Promise((resolve) => { setTimeout(resolve, 30000); }) .then(() => { util.logger.info(`Splunk search query for system poller data: ${searchMetrics()}`); return query(searchMetrics()); @@ -375,7 +378,7 @@ function test() { } if (testSetup.format.eventListenerTests) { - it(`should check for event listener data from:${dut.hostalias}`, () => new Promise((resolve) => setTimeout(resolve, 30000)) + it(`should check for event listener data from:${dut.hostalias}`, () => new Promise((resolve) => { setTimeout(resolve, 30000); }) .then(() => { util.logger.info(`Splunk search query for event listener data: ${searchQueryEL()}`); return query(searchQueryEL()); diff --git a/test/functional/consumersTests/statsdTests.js b/test/functional/consumersTests/statsdTests.js index 08e303fb..3a5cdce2 100644 --- a/test/functional/consumersTests/statsdTests.js +++ b/test/functional/consumersTests/statsdTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -72,7 +72,7 @@ function test() { }; // splunk container takes about 15 seconds to come up - return new Promise((resolve) => setTimeout(resolve, 1500)) + return new Promise((resolve) => { setTimeout(resolve, 1500); }) .then(() => util.makeRequest(CONSUMER_HOST.ip, uri, options)) .then((data) => { util.logger.info('Statsd response:', data); @@ -177,7 +177,7 @@ function test() { * Sleep for 30 second(s) and return Promise.reject to allow retry */ util.logger.info('Waiting for data to be indexed...'); - return new Promise((resolveTimer) => setTimeout(resolveTimer, 30000)) + return new Promise((resolveTimer) => { setTimeout(resolveTimer, 30000); }) .then(() => Promise.reject(new Error('Metrics are empty / not indexed'))); }); }; @@ -214,9 +214,7 @@ function test() { function teardown() { describe('Consumer Test: Statsd - teardown', () => { - STATSD_PROTOCOLS.forEach((protocol) => it( - `should remove ${protocol} container(s)`, () => runRemoteCmd(`docker container rm -f ${STATSD_CONTAINER_NAME}-${protocol}`) - )); + STATSD_PROTOCOLS.forEach((protocol) => it(`should remove ${protocol} container(s)`, () => runRemoteCmd(`docker container rm -f ${STATSD_CONTAINER_NAME}-${protocol}`))); }); } diff --git a/test/functional/dutTests.js b/test/functional/dutTests.js index 643b01cb..7e09e0d0 100644 --- a/test/functional/dutTests.js +++ b/test/functional/dutTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -82,7 +82,7 @@ function sendDataToEventListener(dut, message, opts) { resolve(); return; } - new Promise((timeoutResolve) => setTimeout(timeoutResolve, opts.delay)) + new Promise((timeoutResolve) => { setTimeout(timeoutResolve, opts.delay); }) .then(() => util.sendEvent(dut.ip, message)) .then(() => sendData(i + 1)) .catch(reject); @@ -300,7 +300,7 @@ function setup() { it('should verify installation', () => { const uri = `${constants.BASE_ILX_URI}/info`; - return new Promise((resolve) => setTimeout(resolve, 5000)) + return new Promise((resolve) => { setTimeout(resolve, 5000); }) .then(() => util.makeRequest(host, uri, options)) .then((data) => { data = data || {}; @@ -889,7 +889,7 @@ function teardown() { it('should check restnoded log for errors in [telemetry] messages', () => { let errCounter = 0; - const regexp = new RegExp(/\[telemetry][\S\s]*error/, 'i'); + const regexp = /\[telemetry][\S\s]*error/i; const rl = readline.createInterface({ input: fs.createReadStream(logFile) diff --git a/test/functional/pullConsumerSystemTests.js b/test/functional/pullConsumerSystemTests.js index 8c28fb40..33f91266 100644 --- a/test/functional/pullConsumerSystemTests.js +++ b/test/functional/pullConsumerSystemTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/pullConsumersTests/defaultTests.js b/test/functional/pullConsumersTests/defaultTests.js index dc92d191..58f587db 100644 --- a/test/functional/pullConsumersTests/defaultTests.js +++ b/test/functional/pullConsumersTests/defaultTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -48,19 +48,24 @@ function test() { describe('default - Tests', () => { const pullConsumerName = 'My_Pull_Consumer'; DUTS.forEach((dut) => { - it(`should get the Pull Consumer's formatted data from: ${dut.hostalias}`, + it( + `should get the Pull Consumer's formatted data from: ${dut.hostalias}`, () => dutUtils.getPullConsumerData(dut, pullConsumerName, { rawResponse: true }) .then((response) => { verifyResponseData(response); - })); + }) + ); - it(`should get the Pull Consumer's formatted data from: ${dut.hostalias} (using namespace endpoint)`, - () => dutUtils.getPullConsumerData( - dut, pullConsumerName, { namespace: DEFAULT_UNNAMED_NAMESPACE, rawResponse: true } - ) + it( + `should get the Pull Consumer's formatted data from: ${dut.hostalias} (using namespace endpoint)`, + () => dutUtils.getPullConsumerData(dut, pullConsumerName, { + namespace: DEFAULT_UNNAMED_NAMESPACE, + rawResponse: true + }) .then((response) => { verifyResponseData(response); - })); + }) + ); }); }); }); @@ -77,11 +82,13 @@ function test() { const pullConsumerName = 'Pull_Consumer'; const namespace = 'Second_Namespace'; DUTS.forEach((dut) => { - it(`should get the Pull Consumer's formatted data from: ${dut.hostalias}`, + it( + `should get the Pull Consumer's formatted data from: ${dut.hostalias}`, () => dutUtils.getPullConsumerData(dut, pullConsumerName, { namespace, rawResponse: true }) .then((response) => { verifyResponseData(response); - })); + }) + ); }); }); }); diff --git a/test/functional/pullConsumersTests/prometheusTests.js b/test/functional/pullConsumersTests/prometheusTests.js index f6dc0799..d6e21462 100644 --- a/test/functional/pullConsumersTests/prometheusTests.js +++ b/test/functional/pullConsumersTests/prometheusTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -68,19 +68,24 @@ function test() { describe('Prometheus - Tests', () => { DUTS.forEach((dut) => { - it(`should the Pull Consumer's formatted data from: ${dut.hostalias}`, + it( + `should the Pull Consumer's formatted data from: ${dut.hostalias}`, () => dutUtils.getPullConsumerData(dut, pullConsumerName, { rawResponse: true }) .then((response) => { verifyResponseData(response); - })); + }) + ); - it(`should the Pull Consumer's formatted data from: ${dut.hostalias} (using namespace endpoint)`, - () => dutUtils.getPullConsumerData( - dut, pullConsumerName, { namespace: DEFAULT_UNNAMED_NAMESPACE, rawResponse: true } - ) + it( + `should the Pull Consumer's formatted data from: ${dut.hostalias} (using namespace endpoint)`, + () => dutUtils.getPullConsumerData(dut, pullConsumerName, { + namespace: DEFAULT_UNNAMED_NAMESPACE, + rawResponse: true + }) .then((response) => { verifyResponseData(response); - })); + }) + ); }); }); }); @@ -102,11 +107,13 @@ function test() { describe('Prometheus with namespace - Tests', () => { DUTS.forEach((dut) => { - it(`should the Pull Consumer's formatted data from: ${dut.hostalias}`, + it( + `should the Pull Consumer's formatted data from: ${dut.hostalias}`, () => dutUtils.getPullConsumerData(dut, pullConsumerName, { namespace, rawResponse: true }) .then((response) => { verifyResponseData(response); - })); + }) + ); }); }); }); diff --git a/test/functional/shared/azureUtil.js b/test/functional/shared/azureUtil.js index ef2cc5a0..05728935 100644 --- a/test/functional/shared/azureUtil.js +++ b/test/functional/shared/azureUtil.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/shared/constants.js b/test/functional/shared/constants.js index f023b581..af82cbba 100644 --- a/test/functional/shared/constants.js +++ b/test/functional/shared/constants.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/functional/shared/util.js b/test/functional/shared/util.js index e265342e..7c953d4c 100644 --- a/test/functional/shared/util.js +++ b/test/functional/shared/util.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -505,7 +505,7 @@ module.exports = { * @returns {Promise} */ sleep(sleepTime) { - return new Promise((resolve) => setTimeout(resolve, sleepTime)); + return new Promise((resolve) => { setTimeout(resolve, sleepTime); }); }, /** diff --git a/test/functional/testRunner.js b/test/functional/testRunner.js index 025b50ae..a8af9d60 100644 --- a/test/functional/testRunner.js +++ b/test/functional/testRunner.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/actionProcessorTests.js b/test/unit/actionProcessorTests.js index 03157de8..6778d9af 100644 --- a/test/unit/actionProcessorTests.js +++ b/test/unit/actionProcessorTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -105,9 +105,11 @@ describe('Action Processor', () => { ]; actionProcessor.processActions(dataCtx, actions); - assert.deepStrictEqual(handlerCalls, + assert.deepStrictEqual( + handlerCalls, ['addTags', 'preserveStrictMatches', 'addTags', 'removeStrictMatches'], - 'should call handler functions and skip disabled actions'); + 'should call handler functions and skip disabled actions' + ); }); it('should not fail if actions param is undefined', () => { @@ -122,8 +124,11 @@ describe('Action Processor', () => { myBadAction: {} } ]; - assert.throws(() => actionProcessor.processActions(dataCtx, actions), - /actionProcessor:processActions error: unknown action.*myBadAction/, 'should throw error if unknown action'); + assert.throws( + () => actionProcessor.processActions(dataCtx, actions), + /actionProcessor:processActions error: unknown action.*myBadAction/, + 'should throw error if unknown action' + ); }); }); }); diff --git a/test/unit/configTests.js b/test/unit/configTests.js index 23df36ed..9660447d 100644 --- a/test/unit/configTests.js +++ b/test/unit/configTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/constantsTests.js b/test/unit/constantsTests.js index 748c8ae9..2058e188 100644 --- a/test/unit/constantsTests.js +++ b/test/unit/constantsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -164,6 +164,13 @@ describe('Constants', () => { CURRENT: schemaInfo[0], MINIMUM: '0.9.0' }, + SECRETS: { + PROPS: [ + 'cipherText', + 'passphrase' + ], + MASK: '*********' + }, STATS_KEY_SEP: '::', STRICT_TLS_REQUIRED: true, TRACER: { diff --git a/test/unit/consumers/awsCloudWatchConsumerTests.js b/test/unit/consumers/awsCloudWatchConsumerTests.js index 3ad4eed5..8efddd87 100644 --- a/test/unit/consumers/awsCloudWatchConsumerTests.js +++ b/test/unit/consumers/awsCloudWatchConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -57,8 +57,10 @@ describe('AWS_CloudWatch', () => { return awsCloudWatchIndex(context) .then(() => { assert.strictEqual(optionsParam.region, 'us-west-1'); - assert.deepStrictEqual(optionsParam.credentials, - new AWS.Credentials({ accessKeyId: 'awsuser', secretAccessKey: 'awssecret' })); + assert.deepStrictEqual( + optionsParam.credentials, + new AWS.Credentials({ accessKeyId: 'awsuser', secretAccessKey: 'awssecret' }) + ); }); }); @@ -301,11 +303,13 @@ describe('AWS_CloudWatch', () => { return awsCloudWatchIndex(context) .then(() => { - assert.deepStrictEqual(actualParams, + assert.deepStrictEqual( + actualParams, { MetricData: expectedMetrics, Namespace: 'my-metrics' - }); + } + ); }); }); }); diff --git a/test/unit/consumers/awsS3ConsumerTests.js b/test/unit/consumers/awsS3ConsumerTests.js index d29c21b4..aea4337f 100644 --- a/test/unit/consumers/awsS3ConsumerTests.js +++ b/test/unit/consumers/awsS3ConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -80,8 +80,10 @@ describe('AWS_S3', () => { return awsS3Index(context) .then(() => { assert.strictEqual(optionsParam.region, 'us-west-1'); - assert.deepStrictEqual(optionsParam.credentials, - new AWS.Credentials({ accessKeyId: 'awsuser', secretAccessKey: 'awssecret' })); + assert.deepStrictEqual( + optionsParam.credentials, + new AWS.Credentials({ accessKeyId: 'awsuser', secretAccessKey: 'awssecret' }) + ); }); }); diff --git a/test/unit/consumers/awsUtilTests.js b/test/unit/consumers/awsUtilTests.js index db5762c5..c34477cc 100644 --- a/test/unit/consumers/awsUtilTests.js +++ b/test/unit/consumers/awsUtilTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -55,8 +55,10 @@ describe('AWS Util Tests', () => { return awsUtil.initializeConfig(context) .then(() => { assert.strictEqual(actualParams.region, 'us-east-1'); - assert.deepStrictEqual(actualParams.credentials, - new aws.Credentials({ accessKeyId: 'awsuser', secretAccessKey: 'awssecret' })); + assert.deepStrictEqual( + actualParams.credentials, + new aws.Credentials({ accessKeyId: 'awsuser', secretAccessKey: 'awssecret' }) + ); }); }); @@ -98,8 +100,10 @@ describe('AWS Util Tests', () => { }; return awsUtil.initializeConfig(context, configOptions) .then(() => { - assert.deepStrictEqual(actualParams, - { region: 'us-west-1', httpOptions: { agent: 'myAgent' } }); + assert.deepStrictEqual( + actualParams, + { region: 'us-west-1', httpOptions: { agent: 'myAgent' } } + ); }); }); diff --git a/test/unit/consumers/azureApplicationInsightsConsumerTests.js b/test/unit/consumers/azureApplicationInsightsConsumerTests.js index 7f2a8a0c..8b9e3e54 100644 --- a/test/unit/consumers/azureApplicationInsightsConsumerTests.js +++ b/test/unit/consumers/azureApplicationInsightsConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -204,13 +204,15 @@ describe('Azure_Application_Insights', () => { const expectedMetric1 = { name: 'F5_num', value: 1234 }; const expectedMetric2 = { name: 'F5_strNum', value: 24.1 }; - assert.deepStrictEqual(requests, + assert.deepStrictEqual( + requests, [ expectedMetric1, expectedMetric2, expectedMetric1, expectedMetric2 - ]); + ] + ); }); }); @@ -236,11 +238,13 @@ describe('Azure_Application_Insights', () => { context.logger.setLogLevel('info'); return azureAppInsightsIndex(context); }) - .then(() => assert.deepStrictEqual(logRequests, + .then(() => assert.deepStrictEqual( + logRequests, [ { debug: true, warn: true }, { debug: false, warn: false } - ])); + ] + )); }); it('should configure default client once', () => assert( diff --git a/test/unit/consumers/azureLogAnalyticsConsumerTests.js b/test/unit/consumers/azureLogAnalyticsConsumerTests.js index 776bd267..3b7b115a 100644 --- a/test/unit/consumers/azureLogAnalyticsConsumerTests.js +++ b/test/unit/consumers/azureLogAnalyticsConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/azureUtilTests.js b/test/unit/consumers/azureUtilTests.js index ce1fe00f..13d9231b 100644 --- a/test/unit/consumers/azureUtilTests.js +++ b/test/unit/consumers/azureUtilTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/data/awsUtilTestsData.js b/test/unit/consumers/data/awsUtilTestsData.js index 140e89ea..2bf03d06 100644 --- a/test/unit/consumers/data/awsUtilTestsData.js +++ b/test/unit/consumers/data/awsUtilTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/data/azureLogAnalyticsConsumerTestsData.js b/test/unit/consumers/data/azureLogAnalyticsConsumerTestsData.js index 2a2f0fc8..28b185bc 100644 --- a/test/unit/consumers/data/azureLogAnalyticsConsumerTestsData.js +++ b/test/unit/consumers/data/azureLogAnalyticsConsumerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -710,6 +710,42 @@ module.exports = { 'serverside.pktsOut': 0, 'serverside.totConns': 0, 'status.statusReason': 'Pool member is available' + }, + '/Example_Tenant/_auto_192.0.2.14:80': { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'serverside.bitsIn': 0, + 'serverside.bitsOut': 0, + 'serverside.curConns': 0, + 'serverside.maxConns': 0, + 'serverside.pktsIn': 0, + 'serverside.pktsOut': 0, + 'serverside.totConns': 0, + 'status.statusReason': 'Pool member does not have service checking enabled', + totRequests: 0 + }, + '/Example_Tenant/bestwebsite.com:80': { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'serverside.bitsIn': 0, + 'serverside.bitsOut': 0, + 'serverside.curConns': 0, + 'serverside.maxConns': 0, + 'serverside.pktsIn': 0, + 'serverside.pktsOut': 0, + 'serverside.totConns': 0, + 'status.statusReason': 'The DNS server(s) are available', + totRequests: 0 } }, name: '/Example_Tenant/A1/web_pool', @@ -727,7 +763,7 @@ module.exports = { ], fullURI: 'https://myWorkspace.ods.opinsights.azure.com/api/logs?api-version=2016-04-01', headers: { - Authorization: 'SharedKey myWorkspace:3rxtwjADHseA7h/Ws12q1LhH0HMX+ubWNizGXTGKztg=', + Authorization: 'SharedKey myWorkspace:nsGbMAv3YKQuRjBxZfkbgyutbfe0WUF0XXz7HU2EamA=', 'Content-Type': 'application/json', 'Log-Type': 'F5Telemetry_pools', 'x-ms-date': 'Thu, 01 Jan 1970 00:00:00 GMT' diff --git a/test/unit/consumers/data/azureUtilTestsData.js b/test/unit/consumers/data/azureUtilTestsData.js index acd610f5..d317769e 100644 --- a/test/unit/consumers/data/azureUtilTestsData.js +++ b/test/unit/consumers/data/azureUtilTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/data/openTelemetryExporterConsumerTestsData.js b/test/unit/consumers/data/openTelemetryExporterConsumerTestsData.js index 5bc29e00..7c77628c 100644 --- a/test/unit/consumers/data/openTelemetryExporterConsumerTestsData.js +++ b/test/unit/consumers/data/openTelemetryExporterConsumerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -5240,6 +5240,92 @@ module.exports = { } ] }, + { + name: 'pools_members_serverside_bitsIn', + description: 'pools.members.serverside.bitsIn', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.14' + }, + { + key: 'monitorStatus', + value: 'unchecked' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '80' + }, + { + key: 'availabilityState', + value: 'unknown' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_bitsIn', + description: 'pools.members.serverside.bitsIn', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '::' + }, + { + key: 'monitorStatus', + value: 'fqdn-up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '80' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' + } + ], + value: 0 + } + ] + }, { name: 'pools_members_serverside_bitsOut', description: 'pools.members.serverside.bitsOut', @@ -5435,6 +5521,92 @@ module.exports = { } ] }, + { + name: 'pools_members_serverside_bitsOut', + description: 'pools.members.serverside.bitsOut', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.14' + }, + { + key: 'monitorStatus', + value: 'unchecked' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '80' + }, + { + key: 'availabilityState', + value: 'unknown' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_bitsOut', + description: 'pools.members.serverside.bitsOut', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '::' + }, + { + key: 'monitorStatus', + value: 'fqdn-up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '80' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' + } + ], + value: 0 + } + ] + }, { name: 'pools_members_serverside_curConns', description: 'pools.members.serverside.curConns', @@ -5475,30 +5647,467 @@ module.exports = { ] }, { - name: 'pools_members_serverside_curConns', - description: 'pools.members.serverside.curConns', + name: 'pools_members_serverside_curConns', + description: 'pools.members.serverside.curConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '10.0.1.100' + }, + { + key: 'monitorStatus', + value: 'down' + }, + { + key: 'poolName', + value: '/Common/telemetry-local' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member has been marked down by a monitor' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_curConns', + description: 'pools.members.serverside.curConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.168.120.6' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/hsl_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'offline' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_curConns', + description: 'pools.members.serverside.curConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.12' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'offline' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_curConns', + description: 'pools.members.serverside.curConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.13' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'offline' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_curConns', + description: 'pools.members.serverside.curConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.14' + }, + { + key: 'monitorStatus', + value: 'unchecked' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '80' + }, + { + key: 'availabilityState', + value: 'unknown' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_curConns', + description: 'pools.members.serverside.curConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '::' + }, + { + key: 'monitorStatus', + value: 'fqdn-up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '80' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '10.0.3.5' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Common/app.app/app_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '10.0.1.100' + }, + { + key: 'monitorStatus', + value: 'down' + }, + { + key: 'poolName', + value: '/Common/telemetry-local' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member has been marked down by a monitor' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.168.120.6' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/hsl_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'offline' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.12' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'offline' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.0.2.13' + }, + { + key: 'monitorStatus', + value: 'up' + }, + { + key: 'poolName', + value: '/Example_Tenant/A1/web_pool' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'offline' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member is available' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', dataPoints: [ { labels: [ { key: 'addr', - value: '10.0.1.100' + value: '192.0.2.14' }, { key: 'monitorStatus', - value: 'down' + value: 'unchecked' }, { key: 'poolName', - value: '/Common/telemetry-local' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'available' + value: 'unknown' }, { key: 'enabledState', @@ -5506,7 +6115,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member has been marked down by a monitor' + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -5514,30 +6127,30 @@ module.exports = { ] }, { - name: 'pools_members_serverside_curConns', - description: 'pools.members.serverside.curConns', + name: 'pools_members_serverside_maxConns', + description: 'pools.members.serverside.maxConns', dataPoints: [ { labels: [ { key: 'addr', - value: '192.168.120.6' + value: '::' }, { key: 'monitorStatus', - value: 'up' + value: 'fqdn-up' }, { key: 'poolName', - value: '/Example_Tenant/A1/hsl_pool' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -5545,7 +6158,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -5553,14 +6170,14 @@ module.exports = { ] }, { - name: 'pools_members_serverside_curConns', - description: 'pools.members.serverside.curConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.12' + value: '10.0.3.5' }, { key: 'monitorStatus', @@ -5568,7 +6185,7 @@ module.exports = { }, { key: 'poolName', - value: '/Example_Tenant/A1/web_pool' + value: '/Common/app.app/app_pool' }, { key: 'port', @@ -5576,7 +6193,7 @@ module.exports = { }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -5592,22 +6209,22 @@ module.exports = { ] }, { - name: 'pools_members_serverside_curConns', - description: 'pools.members.serverside.curConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.13' + value: '10.0.1.100' }, { key: 'monitorStatus', - value: 'up' + value: 'down' }, { key: 'poolName', - value: '/Example_Tenant/A1/web_pool' + value: '/Common/telemetry-local' }, { key: 'port', @@ -5615,7 +6232,7 @@ module.exports = { }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -5623,7 +6240,7 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'Pool member has been marked down by a monitor' } ], value: 0 @@ -5631,14 +6248,14 @@ module.exports = { ] }, { - name: 'pools_members_serverside_maxConns', - description: 'pools.members.serverside.maxConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '10.0.3.5' + value: '192.168.120.6' }, { key: 'monitorStatus', @@ -5646,7 +6263,7 @@ module.exports = { }, { key: 'poolName', - value: '/Common/app.app/app_pool' + value: '/Example_Tenant/A1/hsl_pool' }, { key: 'port', @@ -5654,7 +6271,7 @@ module.exports = { }, { key: 'availabilityState', - value: 'available' + value: 'offline' }, { key: 'enabledState', @@ -5670,22 +6287,22 @@ module.exports = { ] }, { - name: 'pools_members_serverside_maxConns', - description: 'pools.members.serverside.maxConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '10.0.1.100' + value: '192.0.2.12' }, { key: 'monitorStatus', - value: 'down' + value: 'up' }, { key: 'poolName', - value: '/Common/telemetry-local' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', @@ -5693,7 +6310,7 @@ module.exports = { }, { key: 'availabilityState', - value: 'available' + value: 'offline' }, { key: 'enabledState', @@ -5701,7 +6318,7 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member has been marked down by a monitor' + value: 'Pool member is available' } ], value: 0 @@ -5709,14 +6326,14 @@ module.exports = { ] }, { - name: 'pools_members_serverside_maxConns', - description: 'pools.members.serverside.maxConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '192.168.120.6' + value: '192.0.2.13' }, { key: 'monitorStatus', @@ -5724,7 +6341,7 @@ module.exports = { }, { key: 'poolName', - value: '/Example_Tenant/A1/hsl_pool' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', @@ -5748,18 +6365,18 @@ module.exports = { ] }, { - name: 'pools_members_serverside_maxConns', - description: 'pools.members.serverside.maxConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.12' + value: '192.0.2.14' }, { key: 'monitorStatus', - value: 'up' + value: 'unchecked' }, { key: 'poolName', @@ -5767,11 +6384,11 @@ module.exports = { }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'offline' + value: 'unknown' }, { key: 'enabledState', @@ -5779,7 +6396,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -5787,18 +6408,18 @@ module.exports = { ] }, { - name: 'pools_members_serverside_maxConns', - description: 'pools.members.serverside.maxConns', + name: 'pools_members_serverside_pktsIn', + description: 'pools.members.serverside.pktsIn', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.13' + value: '::' }, { key: 'monitorStatus', - value: 'up' + value: 'fqdn-up' }, { key: 'poolName', @@ -5806,11 +6427,11 @@ module.exports = { }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -5818,7 +6439,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -5826,8 +6451,8 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsIn', - description: 'pools.members.serverside.pktsIn', + name: 'pools_members_serverside_pktsOut', + description: 'pools.members.serverside.pktsOut', dataPoints: [ { labels: [ @@ -5865,8 +6490,8 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsIn', - description: 'pools.members.serverside.pktsIn', + name: 'pools_members_serverside_pktsOut', + description: 'pools.members.serverside.pktsOut', dataPoints: [ { labels: [ @@ -5904,8 +6529,8 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsIn', - description: 'pools.members.serverside.pktsIn', + name: 'pools_members_serverside_pktsOut', + description: 'pools.members.serverside.pktsOut', dataPoints: [ { labels: [ @@ -5943,8 +6568,8 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsIn', - description: 'pools.members.serverside.pktsIn', + name: 'pools_members_serverside_pktsOut', + description: 'pools.members.serverside.pktsOut', dataPoints: [ { labels: [ @@ -5982,8 +6607,8 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsIn', - description: 'pools.members.serverside.pktsIn', + name: 'pools_members_serverside_pktsOut', + description: 'pools.members.serverside.pktsOut', dataPoints: [ { labels: [ @@ -6028,23 +6653,23 @@ module.exports = { labels: [ { key: 'addr', - value: '10.0.3.5' + value: '192.0.2.14' }, { key: 'monitorStatus', - value: 'up' + value: 'unchecked' }, { key: 'poolName', - value: '/Common/app.app/app_pool' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'available' + value: 'unknown' }, { key: 'enabledState', @@ -6052,7 +6677,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -6067,19 +6696,19 @@ module.exports = { labels: [ { key: 'addr', - value: '10.0.1.100' + value: '::' }, { key: 'monitorStatus', - value: 'down' + value: 'fqdn-up' }, { key: 'poolName', - value: '/Common/telemetry-local' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', @@ -6091,7 +6720,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member has been marked down by a monitor' + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -6099,14 +6732,14 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsOut', - description: 'pools.members.serverside.pktsOut', + name: 'pools_members_serverside_totConns', + description: 'pools.members.serverside.totConns', dataPoints: [ { labels: [ { key: 'addr', - value: '192.168.120.6' + value: '10.0.3.5' }, { key: 'monitorStatus', @@ -6114,7 +6747,7 @@ module.exports = { }, { key: 'poolName', - value: '/Example_Tenant/A1/hsl_pool' + value: '/Common/app.app/app_pool' }, { key: 'port', @@ -6122,7 +6755,7 @@ module.exports = { }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -6138,14 +6771,53 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsOut', - description: 'pools.members.serverside.pktsOut', + name: 'pools_members_serverside_totConns', + description: 'pools.members.serverside.totConns', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.12' + value: '10.0.1.100' + }, + { + key: 'monitorStatus', + value: 'down' + }, + { + key: 'poolName', + value: '/Common/telemetry-local' + }, + { + key: 'port', + value: '0' + }, + { + key: 'availabilityState', + value: 'available' + }, + { + key: 'enabledState', + value: 'enabled' + }, + { + key: 'status.statusReason', + value: 'Pool member has been marked down by a monitor' + } + ], + value: 0 + } + ] + }, + { + name: 'pools_members_serverside_totConns', + description: 'pools.members.serverside.totConns', + dataPoints: [ + { + labels: [ + { + key: 'addr', + value: '192.168.120.6' }, { key: 'monitorStatus', @@ -6153,7 +6825,7 @@ module.exports = { }, { key: 'poolName', - value: '/Example_Tenant/A1/web_pool' + value: '/Example_Tenant/A1/hsl_pool' }, { key: 'port', @@ -6177,14 +6849,14 @@ module.exports = { ] }, { - name: 'pools_members_serverside_pktsOut', - description: 'pools.members.serverside.pktsOut', + name: 'pools_members_serverside_totConns', + description: 'pools.members.serverside.totConns', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.13' + value: '192.0.2.12' }, { key: 'monitorStatus', @@ -6223,7 +6895,7 @@ module.exports = { labels: [ { key: 'addr', - value: '10.0.3.5' + value: '192.0.2.13' }, { key: 'monitorStatus', @@ -6231,7 +6903,7 @@ module.exports = { }, { key: 'poolName', - value: '/Common/app.app/app_pool' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', @@ -6239,7 +6911,7 @@ module.exports = { }, { key: 'availabilityState', - value: 'available' + value: 'offline' }, { key: 'enabledState', @@ -6262,23 +6934,23 @@ module.exports = { labels: [ { key: 'addr', - value: '10.0.1.100' + value: '192.0.2.14' }, { key: 'monitorStatus', - value: 'down' + value: 'unchecked' }, { key: 'poolName', - value: '/Common/telemetry-local' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'available' + value: 'unknown' }, { key: 'enabledState', @@ -6286,7 +6958,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member has been marked down by a monitor' + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -6301,23 +6977,23 @@ module.exports = { labels: [ { key: 'addr', - value: '192.168.120.6' + value: '::' }, { key: 'monitorStatus', - value: 'up' + value: 'fqdn-up' }, { key: 'poolName', - value: '/Example_Tenant/A1/hsl_pool' + value: '/Example_Tenant/A1/web_pool' }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -6325,7 +7001,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -6333,18 +7013,18 @@ module.exports = { ] }, { - name: 'pools_members_serverside_totConns', - description: 'pools.members.serverside.totConns', + name: 'pools_members_totRequests', + description: 'pools.members.totRequests', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.12' + value: '192.0.2.14' }, { key: 'monitorStatus', - value: 'up' + value: 'unchecked' }, { key: 'poolName', @@ -6352,11 +7032,11 @@ module.exports = { }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'offline' + value: 'unknown' }, { key: 'enabledState', @@ -6364,7 +7044,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'Pool member does not have service checking enabled' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 @@ -6372,18 +7056,18 @@ module.exports = { ] }, { - name: 'pools_members_serverside_totConns', - description: 'pools.members.serverside.totConns', + name: 'pools_members_totRequests', + description: 'pools.members.totRequests', dataPoints: [ { labels: [ { key: 'addr', - value: '192.0.2.13' + value: '::' }, { key: 'monitorStatus', - value: 'up' + value: 'fqdn-up' }, { key: 'poolName', @@ -6391,11 +7075,11 @@ module.exports = { }, { key: 'port', - value: '0' + value: '80' }, { key: 'availabilityState', - value: 'offline' + value: 'available' }, { key: 'enabledState', @@ -6403,7 +7087,11 @@ module.exports = { }, { key: 'status.statusReason', - value: 'Pool member is available' + value: 'The DNS server(s) are available' + }, + { + key: 'fqdn', + value: 'bestwebsite.com' } ], value: 0 diff --git a/test/unit/consumers/data/splunkConsumerTestsData.js b/test/unit/consumers/data/splunkConsumerTestsData.js index bc86a80c..5c3d3427 100644 --- a/test/unit/consumers/data/splunkConsumerTestsData.js +++ b/test/unit/consumers/data/splunkConsumerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -912,9 +912,49 @@ module.exports = { time: 1546304461000 }, { + time: 1546304461000, + host: 'telemetry.bigip.com', + source: 'bigip.tmsh.pool_member_status', + sourcetype: 'f5:bigip:status:iapp:json', + event: { + aggr_period: 0, + device_base_mac: '00:0d:3a:30:34:51', + devicegroup: 'example_device_group', + facility: 'myFacility', + pool_name: '/Example_Tenant/A1/web_pool', + pool_member_name: '/Example_Tenant/_auto_192.0.2.14:80', + callbackurl: '', + address: '192.0.2.14', + port: 80, + session_status: '', + availability_state: 'unknown', + enabled_state: 'enabled' + } + }, + { + time: 1546304461000, + host: 'telemetry.bigip.com', + source: 'bigip.tmsh.pool_member_status', + sourcetype: 'f5:bigip:status:iapp:json', event: { aggr_period: 0, - bytes_transfered: 20044, + device_base_mac: '00:0d:3a:30:34:51', + devicegroup: 'example_device_group', + facility: 'myFacility', + pool_name: '/Example_Tenant/A1/web_pool', + pool_member_name: '/Example_Tenant/bestwebsite.com:80', + callbackurl: '', + address: '::', + port: 80, + session_status: '', + availability_state: 'available', + enabled_state: 'enabled' + } + }, + { + event: { + aggr_period: 0, + bytes_transfered: 21005, device_base_mac: '00:0d:3a:30:34:51', devicegroup: 'example_device_group', facility: 'myFacility', @@ -1864,6 +1904,58 @@ module.exports = { sourcetype: 'f5:telemetry', time: 1546304461000 }, + { + time: 1546304461000, + source: 'f5-telemetry', + sourcetype: 'f5:telemetry', + host: 'telemetry.bigip.com', + fields: { + addr: '192.0.2.14', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: '80', + 'metric_name:serverside.bitsIn': 0, + 'metric_name:serverside.bitsOut': 0, + 'metric_name:serverside.curConns': 0, + 'metric_name:serverside.maxConns': 0, + 'metric_name:serverside.pktsIn': 0, + 'metric_name:serverside.pktsOut': 0, + 'metric_name:serverside.totConns': 0, + availabilityState: 'unknown', + enabledState: 'enabled', + 'status.statusReason': 'Pool member does not have service checking enabled', + 'metric_name:totRequests': 0, + fqdn: 'bestwebsite.com', + name: '/Example_Tenant/_auto_192.0.2.14:80', + telemetryStreamingStatisticSet: 'pools.members' + } + }, + { + time: 1546304461000, + source: 'f5-telemetry', + sourcetype: 'f5:telemetry', + host: 'telemetry.bigip.com', + fields: { + addr: '::', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: '80', + 'metric_name:serverside.bitsIn': 0, + 'metric_name:serverside.bitsOut': 0, + 'metric_name:serverside.curConns': 0, + 'metric_name:serverside.maxConns': 0, + 'metric_name:serverside.pktsIn': 0, + 'metric_name:serverside.pktsOut': 0, + 'metric_name:serverside.totConns': 0, + availabilityState: 'available', + enabledState: 'enabled', + 'status.statusReason': 'The DNS server(s) are available', + 'metric_name:totRequests': 0, + fqdn: 'bestwebsite.com', + name: '/Example_Tenant/bestwebsite.com:80', + telemetryStreamingStatisticSet: 'pools.members' + } + }, { fields: { application: 'app.app', diff --git a/test/unit/consumers/data/statsdConsumerTestsData.js b/test/unit/consumers/data/statsdConsumerTestsData.js index 6c2c9755..6bf9f0a1 100644 --- a/test/unit/consumers/data/statsdConsumerTestsData.js +++ b/test/unit/consumers/data/statsdConsumerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -1965,6 +1965,230 @@ module.exports = { 'status.statusReason': 'Pool member is available' } }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-bitsIn', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-bitsOut', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-curConns', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-maxConns', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-pktsIn', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-pktsOut', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.serverside-totConns', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-_auto_192-0-2-14-80.totRequests', + metricTags: { + addr: '192.0.2.14', + availabilityState: 'unknown', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'unchecked', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'Pool member does not have service checking enabled' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-bitsIn', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-bitsOut', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-curConns', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-maxConns', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-pktsIn', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-pktsOut', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.serverside-totConns', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, + { + metricName: 'f5telemetry.telemetry-bigip-com.pools.-Example_Tenant-A1-web_pool.members.-Example_Tenant-bestwebsite-com-80.totRequests', + metricTags: { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + fqdn: 'bestwebsite.com', + monitorStatus: 'fqdn-up', + poolName: '/Example_Tenant/A1/web_pool', + port: 80, + 'status.statusReason': 'The DNS server(s) are available' + }, + metricValue: 0 + }, { metricName: 'f5telemetry.telemetry-bigip-com.ltmPolicies.-Common-app-app-app_policy.invoked', metricValue: 0, diff --git a/test/unit/consumers/dataDogConsumerTests.js b/test/unit/consumers/dataDogConsumerTests.js index dc965a1c..9b2fa493 100644 --- a/test/unit/consumers/dataDogConsumerTests.js +++ b/test/unit/consumers/dataDogConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/defaultConsumerTests.js b/test/unit/consumers/defaultConsumerTests.js index 3d427339..90f4d913 100644 --- a/test/unit/consumers/defaultConsumerTests.js +++ b/test/unit/consumers/defaultConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/elasticSearchConsumerTests.js b/test/unit/consumers/elasticSearchConsumerTests.js index 15116e44..fd87e39f 100644 --- a/test/unit/consumers/elasticSearchConsumerTests.js +++ b/test/unit/consumers/elasticSearchConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/f5CloudConsumerTests.js b/test/unit/consumers/f5CloudConsumerTests.js index 97b003b1..d2bcc68d 100644 --- a/test/unit/consumers/f5CloudConsumerTests.js +++ b/test/unit/consumers/f5CloudConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/gcpUtilTests.js b/test/unit/consumers/gcpUtilTests.js index 9eef973a..2c028446 100644 --- a/test/unit/consumers/gcpUtilTests.js +++ b/test/unit/consumers/gcpUtilTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/genericHTTPConsumerTests.js b/test/unit/consumers/genericHTTPConsumerTests.js index 2c697047..df717149 100644 --- a/test/unit/consumers/genericHTTPConsumerTests.js +++ b/test/unit/consumers/genericHTTPConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/googleCloudLoggingTests.js b/test/unit/consumers/googleCloudLoggingTests.js index dada3581..47d152ab 100644 --- a/test/unit/consumers/googleCloudLoggingTests.js +++ b/test/unit/consumers/googleCloudLoggingTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -98,9 +98,11 @@ describe('Google_Cloud_Logging', () => { } }) .post('') - .reply(200, (_, req) => assert.deepStrictEqual( - req, getExpectedData([{ jsonPayload: testUtil.deepCopy(context.event.data) }]) - )); + .reply(200, (_, req) => assert.deepStrictEqual(req, getExpectedData([{ + jsonPayload: testUtil.deepCopy( + context.event.data + ) + }]))); return cloudLoggingIndex(context); }); @@ -121,9 +123,11 @@ describe('Google_Cloud_Logging', () => { } }) .post('') - .reply(200, (_, req) => assert.deepStrictEqual( - req, getExpectedData([{ jsonPayload: testUtil.deepCopy(context.event.data) }]) - )); + .reply(200, (_, req) => assert.deepStrictEqual(req, getExpectedData([{ + jsonPayload: testUtil.deepCopy( + context.event.data + ) + }]))); return cloudLoggingIndex(context); }); diff --git a/test/unit/consumers/googleCloudMonitoringConsumerTests.js b/test/unit/consumers/googleCloudMonitoringConsumerTests.js index f63dc8c2..47f3d96c 100644 --- a/test/unit/consumers/googleCloudMonitoringConsumerTests.js +++ b/test/unit/consumers/googleCloudMonitoringConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -354,8 +354,11 @@ describe('Google_Cloud_Monitoring', () => { return cloudMonitoringIndex(context); }) .then(() => { - assert.deepStrictEqual(loggerStub.messages.all, - Array(3).fill('[telemetry.gcm] success'), 'should log success message'); + assert.deepStrictEqual( + loggerStub.messages.all, + Array(3).fill('[telemetry.gcm] success'), + 'should log success message' + ); }); }); @@ -433,8 +436,11 @@ describe('Google_Cloud_Monitoring', () => { .then(() => cloudMonitoringIndex(context2)) .then(() => cloudMonitoringIndex(context1)) .then(() => cloudMonitoringIndex(context2)) - .then(() => assert.deepStrictEqual(loggerStub.messages.all, - Array(4).fill('[telemetry.gcm] success'), 'should log success message')); + .then(() => assert.deepStrictEqual( + loggerStub.messages.all, + Array(4).fill('[telemetry.gcm] success'), + 'should log success message' + )); }); it('should invalidate token if Unauthorized error on sending data', () => { diff --git a/test/unit/consumers/graphiteConsumerTests.js b/test/unit/consumers/graphiteConsumerTests.js index 2a96a35a..2f8abca4 100644 --- a/test/unit/consumers/graphiteConsumerTests.js +++ b/test/unit/consumers/graphiteConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/httpUtilTests.js b/test/unit/consumers/httpUtilTests.js index 493f6574..95c905ef 100644 --- a/test/unit/consumers/httpUtilTests.js +++ b/test/unit/consumers/httpUtilTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/kafkaConsumerTests.js b/test/unit/consumers/kafkaConsumerTests.js index 16a855db..8334c845 100644 --- a/test/unit/consumers/kafkaConsumerTests.js +++ b/test/unit/consumers/kafkaConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/metricsUtilTests.js b/test/unit/consumers/metricsUtilTests.js index f5b27acf..23e319af 100644 --- a/test/unit/consumers/metricsUtilTests.js +++ b/test/unit/consumers/metricsUtilTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumers/openTelemetryExporterTests.js b/test/unit/consumers/openTelemetryExporterTests.js index 17f3e370..2f18f2ba 100644 --- a/test/unit/consumers/openTelemetryExporterTests.js +++ b/test/unit/consumers/openTelemetryExporterTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -124,10 +124,14 @@ describe('OpenTelemetry_Exporter', () => { nock('http://localhost:80') .post('/v1/metrics') - .reply(() => { + .reply(); + return openTelemetryExporter(context) + .then(() => { + assert.deepStrictEqual(context.logger.debug.args, [['success']], 'should log a success'); + assert.isFalse(context.logger.error.called, 'should not have logged an error'); const traceData = context.tracer.write.firstCall.args[0]; - assert.strictEqual(Object.keys(traceData).length, 404, 'should have trace record for each metric'); + assert.strictEqual(Object.keys(traceData).length, 405, 'should have trace record for each metric'); assert.deepStrictEqual(traceData.system_diskLatency__util, { description: 'system.diskLatency.%util', measurements: [ @@ -145,11 +149,6 @@ describe('OpenTelemetry_Exporter', () => { ] }, 'should include measurements array for specific metric in trace data'); }); - return openTelemetryExporter(context) - .then(() => { - assert.deepStrictEqual(context.logger.debug.args, [['success']], 'should log a success'); - assert.isFalse(context.logger.error.called, 'should not have logged an error'); - }); }); it('should process and export systemInfo data', () => { @@ -164,7 +163,7 @@ describe('OpenTelemetry_Exporter', () => { const metrics = convertExportedMetrics(requestBody); assert.strictEqual(this.req.headers['content-type'], 'application/x-protobuf', 'should send protobuf data'); - assert.strictEqual(metrics.length, 710, 'should export correct number of metrics'); + assert.strictEqual(metrics.length, 726, 'should export correct number of metrics'); }); return openTelemetryExporter(context); }); diff --git a/test/unit/consumers/splunkConsumerTests.js b/test/unit/consumers/splunkConsumerTests.js index b4210c0f..81410d0d 100644 --- a/test/unit/consumers/splunkConsumerTests.js +++ b/test/unit/consumers/splunkConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -190,16 +190,31 @@ describe('Splunk', () => { return splunkIndex(context) .then(() => { const traceData = context.tracer.write.firstCall.args[0]; - assert.notStrictEqual(traceData.consumer.passphrase.indexOf('*****'), -1, - 'consumer config passphrase should be redacted'); - assert.notStrictEqual(traceData.consumer.proxy.passphrase.indexOf('*****'), -1, - 'consumer proxy config passphrase should be redacted'); - assert.notStrictEqual(traceData.requestOpts.headers.Authorization.indexOf('*****'), -1, - 'passphrase in request headers should be redacted'); - assert.strictEqual(JSON.stringify(traceData).indexOf('superSecret'), -1, - 'passphrase should not be present anywhere in trace data'); - assert.notStrictEqual(traceData.requestOpts.proxy.passphrase.indexOf('*****'), -1, - 'consumer proxy config passphrase should be redacted'); + assert.notStrictEqual( + traceData.consumer.passphrase.indexOf('*****'), + -1, + 'consumer config passphrase should be redacted' + ); + assert.notStrictEqual( + traceData.consumer.proxy.passphrase.indexOf('*****'), + -1, + 'consumer proxy config passphrase should be redacted' + ); + assert.notStrictEqual( + traceData.requestOpts.headers.Authorization.indexOf('*****'), + -1, + 'passphrase in request headers should be redacted' + ); + assert.strictEqual( + JSON.stringify(traceData).indexOf('superSecret'), + -1, + 'passphrase should not be present anywhere in trace data' + ); + assert.notStrictEqual( + traceData.requestOpts.proxy.passphrase.indexOf('*****'), + -1, + 'consumer proxy config passphrase should be redacted' + ); }); }); @@ -396,18 +411,10 @@ describe('Splunk', () => { return splunkIndex(context) .then(() => { const output = splunkRequestData[0].request; - assert.notStrictEqual( - output.indexOf('"counters_bytes_in":'), -1, 'output should include counters_bytes_in as a key' - ); - assert.strictEqual( - output.indexOf('"counters.bytes_in":'), -1, 'output should not include counters.bytes_in as a key' - ); - assert.notStrictEqual( - output.indexOf('"longer_key_name_with_periods":'), -1, 'output should include longer_key_name_with_periods as a key' - ); - assert.strictEqual( - output.indexOf('"longer.key.name.with.periods":'), -1, 'output should not include longer.key.name.with.periods as a key' - ); + assert.notStrictEqual(output.indexOf('"counters_bytes_in":'), -1, 'output should include counters_bytes_in as a key'); + assert.strictEqual(output.indexOf('"counters.bytes_in":'), -1, 'output should not include counters.bytes_in as a key'); + assert.notStrictEqual(output.indexOf('"longer_key_name_with_periods":'), -1, 'output should include longer_key_name_with_periods as a key'); + assert.strictEqual(output.indexOf('"longer.key.name.with.periods":'), -1, 'output should not include longer.key.name.with.periods as a key'); }); }); @@ -441,15 +448,9 @@ describe('Splunk', () => { return splunkIndex(context) .then(() => { const output = splunkRequestData[0].request; - assert.notStrictEqual( - output.indexOf('"192.0.0.1"'), -1, 'output should remove ::FFFF from ::FFFF:192.0.0.1' - ); - assert.notStrictEqual( - output.indexOf('"192.0.0.2"'), -1, 'output should remove ::FFFF from ::ffff:192.0.0.2' - ); - assert.notStrictEqual( - output.indexOf('"192.0.0.3"'), -1, 'output should include 192.0.0.3' - ); + assert.notStrictEqual(output.indexOf('"192.0.0.1"'), -1, 'output should remove ::FFFF from ::FFFF:192.0.0.1'); + assert.notStrictEqual(output.indexOf('"192.0.0.2"'), -1, 'output should remove ::FFFF from ::ffff:192.0.0.2'); + assert.notStrictEqual(output.indexOf('"192.0.0.3"'), -1, 'output should include 192.0.0.3'); }); }); @@ -500,15 +501,18 @@ describe('Splunk', () => { }).filter((m) => m !== undefined); assert.notStrictEqual( membersInOutput.find((m) => m.event.name === '10.10.1.1:8080' && m.event.addr === '10.10.1.1'), - undefined, 'output should include poolMember 10.10.1.1:8080' + undefined, + 'output should include poolMember 10.10.1.1:8080' ); assert.notStrictEqual( membersInOutput.find((m) => m.event.name === '10.9.8.100:443' && m.event.addr === '10.9.8.100'), - undefined, 'output should include poolMember 10.9.8.100:443' + undefined, + 'output should include poolMember 10.9.8.100:443' ); assert.notStrictEqual( membersInOutput.find((m) => m.event.name === 'FE80:0000:0000:0000:0201:23FF:FE45:6701:8080' && m.event.addr === 'FE80:0000:0000:0000:0201:23FF:FE45:6701'), - undefined, 'output should include poolMember with addr 10.10.1.3' + undefined, + 'output should include poolMember with addr 10.10.1.3' ); }); }); @@ -543,15 +547,9 @@ describe('Splunk', () => { return splunkIndex(context) .then(() => { const output = splunkRequestData[0].request; - assert.notStrictEqual( - output.indexOf('"source":"192.0.0.1"'), -1, 'output should include 192.0.0.1' - ); - assert.notStrictEqual( - output.indexOf('"addr":"1000:0000:0000:0000:0000:FFF8:C000:0001"'), -1, 'output should include 1000:0000:0000:0000:0000:FFF8:C000:0001' - ); - assert.notStrictEqual( - output.indexOf('"destination":"192.0.0.3"'), -1, 'output should include 192.0.0.3' - ); + assert.notStrictEqual(output.indexOf('"source":"192.0.0.1"'), -1, 'output should include 192.0.0.1'); + assert.notStrictEqual(output.indexOf('"addr":"1000:0000:0000:0000:0000:FFF8:C000:0001"'), -1, 'output should include 1000:0000:0000:0000:0000:FFF8:C000:0001'); + assert.notStrictEqual(output.indexOf('"destination":"192.0.0.3"'), -1, 'output should include 192.0.0.3'); }); }); @@ -581,15 +579,9 @@ describe('Splunk', () => { return splunkIndex(context) .then(() => { const output = splunkRequestData[0].request; - assert.notStrictEqual( - output.indexOf('"tenant":"tenant"'), -1, 'output should include tenant' - ); - assert.notStrictEqual( - output.indexOf('"application":"application"'), -1, 'output should include application' - ); - assert.notStrictEqual( - output.indexOf('"appComponent":""'), -1, 'output should include appComponent' - ); + assert.notStrictEqual(output.indexOf('"tenant":"tenant"'), -1, 'output should include tenant'); + assert.notStrictEqual(output.indexOf('"application":"application"'), -1, 'output should include application'); + assert.notStrictEqual(output.indexOf('"appComponent":""'), -1, 'output should include appComponent'); }); }); @@ -622,9 +614,7 @@ describe('Splunk', () => { return splunkIndex(context) .then(() => { const output = splunkRequestData[0].request; - assert.notStrictEqual( - output.indexOf('"last_cycle_count":"10"'), -1, 'output should include last_cycle_count' - ); + assert.notStrictEqual(output.indexOf('"last_cycle_count":"10"'), -1, 'output should include last_cycle_count'); }); }); }); diff --git a/test/unit/consumers/statsdConsumerTests.js b/test/unit/consumers/statsdConsumerTests.js index f16a0333..35d543a2 100644 --- a/test/unit/consumers/statsdConsumerTests.js +++ b/test/unit/consumers/statsdConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -204,8 +204,10 @@ describe('Statsd', () => { return statsDIndex(context) .then(() => { assert.strictEqual(context.logger.exception.callCount, 1); - assert.deepEqual(context.logger.exception.firstCall.args, - ['Unable to forward to statsd client', 'Connection failure to server']); + assert.deepEqual( + context.logger.exception.firstCall.args, + ['Unable to forward to statsd client', 'Connection failure to server'] + ); }); }); diff --git a/test/unit/consumers/sumoLogicConsumerTests.js b/test/unit/consumers/sumoLogicConsumerTests.js index 19cb585d..81d8ecb9 100644 --- a/test/unit/consumers/sumoLogicConsumerTests.js +++ b/test/unit/consumers/sumoLogicConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/consumersTests.js b/test/unit/consumersTests.js index 27bf1182..3006adbd 100644 --- a/test/unit/consumersTests.js +++ b/test/unit/consumersTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -121,8 +121,11 @@ describe('Consumers', () => { .then((normalized) => configWorker.emitAsync('change', normalized)) .then(() => { const loadedConsumers = consumers.getConsumers(); - assert.strictEqual(Object.keys(loadedConsumers).indexOf('unknowntype'), -1, - 'should not load invalid consumer type'); + assert.strictEqual( + Object.keys(loadedConsumers).indexOf('unknowntype'), + -1, + 'should not load invalid consumer type' + ); }); }); diff --git a/test/unit/customEndpointsTests.js b/test/unit/customEndpointsTests.js index 63aa96c2..f037e2e2 100644 --- a/test/unit/customEndpointsTests.js +++ b/test/unit/customEndpointsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/actionProcessorTestsData.js b/test/unit/data/actionProcessorTestsData.js index 97198187..0938b6ef 100644 --- a/test/unit/data/actionProcessorTestsData.js +++ b/test/unit/data/actionProcessorTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configTestsData.js b/test/unit/data/configTestsData.js index e891e2d1..b833b73f 100644 --- a/test/unit/data/configTestsData.js +++ b/test/unit/data/configTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/getComponentsTestsData.js b/test/unit/data/configUtilTests/getComponentsTestsData.js index 45dafc82..0fbd6327 100644 --- a/test/unit/data/configUtilTests/getComponentsTestsData.js +++ b/test/unit/data/configUtilTests/getComponentsTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/hasEnabledComponentsTestsData.js b/test/unit/data/configUtilTests/hasEnabledComponentsTestsData.js index 10407db8..1b6837d2 100644 --- a/test/unit/data/configUtilTests/hasEnabledComponentsTestsData.js +++ b/test/unit/data/configUtilTests/hasEnabledComponentsTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/index.js b/test/unit/data/configUtilTests/index.js index 9e918200..2b1eff59 100644 --- a/test/unit/data/configUtilTests/index.js +++ b/test/unit/data/configUtilTests/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/mergeDeclarationTestsData.js b/test/unit/data/configUtilTests/mergeDeclarationTestsData.js index 65e3fe6a..15dd5d81 100644 --- a/test/unit/data/configUtilTests/mergeDeclarationTestsData.js +++ b/test/unit/data/configUtilTests/mergeDeclarationTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationEndpointsTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationEndpointsTestsData.js index 72f0203a..6e4d4eec 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationEndpointsTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationEndpointsTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationEventListenerTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationEventListenerTestsData.js index fb5bf52d..e61ed567 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationEventListenerTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationEventListenerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationIHealthPollerTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationIHealthPollerTestsData.js index 2bc0ce70..d6dd381e 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationIHealthPollerTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationIHealthPollerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationPullConsumerTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationPullConsumerTestsData.js index fc78fc28..a46da55a 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationPullConsumerTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationPullConsumerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationSystemPollerTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationSystemPollerTestsData.js index 6ee6e07f..9fd36655 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationSystemPollerTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationSystemPollerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationSystemTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationSystemTestsData.js index 7bb45f66..20b12da6 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationSystemTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationSystemTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationTestsData.js index 7f4a40a8..79a2c8df 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/configUtilTests/normalizeDeclarationTraceValueTestsData.js b/test/unit/data/configUtilTests/normalizeDeclarationTraceValueTestsData.js index 222b265f..0e68341a 100644 --- a/test/unit/data/configUtilTests/normalizeDeclarationTraceValueTestsData.js +++ b/test/unit/data/configUtilTests/normalizeDeclarationTraceValueTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/customEndpointsTestsData.js b/test/unit/data/customEndpointsTestsData.js index fbc2f761..230a0728 100644 --- a/test/unit/data/customEndpointsTestsData.js +++ b/test/unit/data/customEndpointsTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/dataUtilTestsData.js b/test/unit/data/dataUtilTestsData.js index a02c6960..323e8a8e 100644 --- a/test/unit/data/dataUtilTestsData.js +++ b/test/unit/data/dataUtilTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/deviceUtilTestsData.js b/test/unit/data/deviceUtilTestsData.js index 972d4ca5..e6deb689 100644 --- a/test/unit/data/deviceUtilTestsData.js +++ b/test/unit/data/deviceUtilTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/endpointLoaderTestsData.js b/test/unit/data/endpointLoaderTestsData.js index df8d16dd..9c07a89c 100644 --- a/test/unit/data/endpointLoaderTestsData.js +++ b/test/unit/data/endpointLoaderTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -379,15 +379,15 @@ module.exports = { } }, { - endpoint: '/anotherEndpoint/refObject/suffix/stats', + endpoint: '/anotherEndpoint/refObject/stats', response: { kind: 'anotherEndpoint:stats', - selfLink: 'https://localhost/anotherEndpoint/refObject/suffix/stats?ver=X.X.X', + selfLink: 'https://localhost/anotherEndpoint/refObject/stats?ver=X.X.X', entries: { - 'https://localhost/anotherEndpoint/refObject/suffix/stats': { + 'https://localhost/anotherEndpoint/refObject/stats': { nestedStats: { kind: 'anotherEndpoint:stats', - selfLink: 'https://localhost/anotherEndpoint/refObject/suffix/stats?ver=X.X.X', + selfLink: 'https://localhost/anotherEndpoint/refObject/stats?ver=X.X.X', name: 'anotherStats', statKey: 'statValue' } @@ -423,10 +423,10 @@ module.exports = { kind: 'anotherEndpoint:state', selfLink: 'https://localhost/anotherEndpoint/refObject/suffix?ver=X.X.X', entries: { - 'https://localhost/anotherEndpoint/refObject/suffix/stats': { + 'https://localhost/anotherEndpoint/refObject/stats': { nestedStats: { kind: 'anotherEndpoint:stats', - selfLink: 'https://localhost/anotherEndpoint/refObject/suffix/stats?ver=X.X.X', + selfLink: 'https://localhost/anotherEndpoint/refObject/stats?ver=X.X.X', name: 'anotherStats', statKey: 'statValue' } diff --git a/test/unit/data/eventListenerTestsData.js b/test/unit/data/eventListenerTestsData.js index fb784cff..1b2be9c7 100644 --- a/test/unit/data/eventListenerTestsData.js +++ b/test/unit/data/eventListenerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/messageStreamTestsData.js b/test/unit/data/messageStreamTestsData.js index 5016e82b..63bb0322 100644 --- a/test/unit/data/messageStreamTestsData.js +++ b/test/unit/data/messageStreamTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/normalizeTestsData.js b/test/unit/data/normalizeTestsData.js index f72a8392..9ed2a39e 100644 --- a/test/unit/data/normalizeTestsData.js +++ b/test/unit/data/normalizeTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectClientSslProfiles.js b/test/unit/data/propertiesJsonTests/collectClientSslProfiles.js index a738316f..c8b8cd06 100644 --- a/test/unit/data/propertiesJsonTests/collectClientSslProfiles.js +++ b/test/unit/data/propertiesJsonTests/collectClientSslProfiles.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectContext.js b/test/unit/data/propertiesJsonTests/collectContext.js index 36167a81..f450f66a 100644 --- a/test/unit/data/propertiesJsonTests/collectContext.js +++ b/test/unit/data/propertiesJsonTests/collectContext.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectDeviceGroups.js b/test/unit/data/propertiesJsonTests/collectDeviceGroups.js index 353fd398..225a7fbd 100644 --- a/test/unit/data/propertiesJsonTests/collectDeviceGroups.js +++ b/test/unit/data/propertiesJsonTests/collectDeviceGroups.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectGtmStats.js b/test/unit/data/propertiesJsonTests/collectGtmStats.js index e42bbf9e..43af5320 100644 --- a/test/unit/data/propertiesJsonTests/collectGtmStats.js +++ b/test/unit/data/propertiesJsonTests/collectGtmStats.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectHttpProfiles.js b/test/unit/data/propertiesJsonTests/collectHttpProfiles.js index c2ea2bb5..f37ce9b9 100644 --- a/test/unit/data/propertiesJsonTests/collectHttpProfiles.js +++ b/test/unit/data/propertiesJsonTests/collectHttpProfiles.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectIRules.js b/test/unit/data/propertiesJsonTests/collectIRules.js index 6860e9d6..b86682eb 100644 --- a/test/unit/data/propertiesJsonTests/collectIRules.js +++ b/test/unit/data/propertiesJsonTests/collectIRules.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectLtmPolicies.js b/test/unit/data/propertiesJsonTests/collectLtmPolicies.js index 3c9f0f7e..ba86568a 100644 --- a/test/unit/data/propertiesJsonTests/collectLtmPolicies.js +++ b/test/unit/data/propertiesJsonTests/collectLtmPolicies.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectNetworkTunnels.js b/test/unit/data/propertiesJsonTests/collectNetworkTunnels.js index 9f401a2e..c97fb43e 100644 --- a/test/unit/data/propertiesJsonTests/collectNetworkTunnels.js +++ b/test/unit/data/propertiesJsonTests/collectNetworkTunnels.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectPools.js b/test/unit/data/propertiesJsonTests/collectPools.js index 910e21cb..cddddbb2 100644 --- a/test/unit/data/propertiesJsonTests/collectPools.js +++ b/test/unit/data/propertiesJsonTests/collectPools.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -121,6 +121,42 @@ module.exports = { 'serverside.totConns': 0, 'status.statusReason': 'Pool member does not have service checking enabled', totRequests: 0 + }, + '/Common/_auto_192.0.2.2:80': { + addr: '192.0.2.2', + availabilityState: 'available', + enabledState: 'enabled', + monitorStatus: 'up', + poolName: '/Common/test_pool_0', + port: 80, + 'serverside.bitsIn': 0, + 'serverside.bitsOut': 0, + 'serverside.curConns': 0, + 'serverside.maxConns': 0, + 'serverside.pktsIn': 0, + 'serverside.pktsOut': 0, + 'serverside.totConns': 0, + 'status.statusReason': 'Pool member is available', + totRequests: 0, + fqdn: 'www.thebestwebsite.com' + }, + '/Common/bestwebsite:80': { + addr: '::', + availabilityState: 'available', + enabledState: 'enabled', + monitorStatus: 'fqdn-up', + poolName: '/Common/test_pool_0', + port: 80, + 'serverside.bitsIn': 0, + 'serverside.bitsOut': 0, + 'serverside.curConns': 0, + 'serverside.maxConns': 0, + 'serverside.pktsIn': 0, + 'serverside.pktsOut': 0, + 'serverside.totConns': 0, + 'status.statusReason': 'The DNS server(s) are available', + totRequests: 0, + fqdn: 'www.thebestwebsite.com' } }, name: '/Common/test_pool_0', @@ -179,6 +215,41 @@ module.exports = { ] } }, + { + endpoint: '/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn,selfLink', + response: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2', + items: [ + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'disabled' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'disabled' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'enabled', + tmName: 'www.thebestwebsite.com' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'enabled', + tmName: 'www.thebestwebsite.com' + } + } + ] + } + }, { endpoint: '/mgmt/tm/ltm/pool/~Common~test_pool_0/members/stats', response: { @@ -350,6 +421,172 @@ module.exports = { } } } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80/stats?ver=14.1.0', + entries: { + addr: { + description: '192.0.2.2' + }, + 'connq.ageEdm': { + value: 0 + }, + 'connq.ageEma': { + value: 0 + }, + 'connq.ageHead': { + value: 0 + }, + 'connq.ageMax': { + value: 0 + }, + 'connq.depth': { + value: 0 + }, + 'connq.serviced': { + value: 0 + }, + curSessions: { + value: 0 + }, + monitorRule: { + description: '/Common/http (pool monitor)' + }, + monitorStatus: { + description: 'up' + }, + nodeName: { + description: '/Common/_auto_192.0.2.2' + }, + poolName: { + description: '/Common/test_pool_0' + }, + port: { + value: 80 + }, + 'serverside.bitsIn': { + value: 0 + }, + 'serverside.bitsOut': { + value: 0 + }, + 'serverside.curConns': { + value: 0 + }, + 'serverside.maxConns': { + value: 0 + }, + 'serverside.pktsIn': { + value: 0 + }, + 'serverside.pktsOut': { + value: 0 + }, + 'serverside.totConns': { + value: 0 + }, + sessionStatus: { + description: 'enabled' + }, + 'status.availabilityState': { + description: 'available' + }, + 'status.enabledState': { + description: 'enabled' + }, + 'status.statusReason': { + description: 'Pool member is available' + }, + totRequests: { + value: 0 + } + } + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80/stats?ver=14.1.0', + entries: { + addr: { + description: '::' + }, + 'connq.ageEdm': { + value: 0 + }, + 'connq.ageEma': { + value: 0 + }, + 'connq.ageHead': { + value: 0 + }, + 'connq.ageMax': { + value: 0 + }, + 'connq.depth': { + value: 0 + }, + 'connq.serviced': { + value: 0 + }, + curSessions: { + value: 0 + }, + monitorRule: { + description: '/Common/http (pool monitor)' + }, + monitorStatus: { + description: 'fqdn-up' + }, + nodeName: { + description: '/Common/bestwebsite' + }, + poolName: { + description: '/Common/test_pool_0' + }, + port: { + value: 80 + }, + 'serverside.bitsIn': { + value: 0 + }, + 'serverside.bitsOut': { + value: 0 + }, + 'serverside.curConns': { + value: 0 + }, + 'serverside.maxConns': { + value: 0 + }, + 'serverside.pktsIn': { + value: 0 + }, + 'serverside.pktsOut': { + value: 0 + }, + 'serverside.totConns': { + value: 0 + }, + sessionStatus: { + description: 'enabled' + }, + 'status.availabilityState': { + description: 'available' + }, + 'status.enabledState': { + description: 'enabled' + }, + 'status.statusReason': { + description: 'The DNS server(s) are available' + }, + totRequests: { + value: 0 + } + } + } } } } diff --git a/test/unit/data/propertiesJsonTests/collectServerSslProfiles.js b/test/unit/data/propertiesJsonTests/collectServerSslProfiles.js index f1938e76..183276aa 100644 --- a/test/unit/data/propertiesJsonTests/collectServerSslProfiles.js +++ b/test/unit/data/propertiesJsonTests/collectServerSslProfiles.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectSslCerts.js b/test/unit/data/propertiesJsonTests/collectSslCerts.js index 3a8f6dbb..7a4c2264 100644 --- a/test/unit/data/propertiesJsonTests/collectSslCerts.js +++ b/test/unit/data/propertiesJsonTests/collectSslCerts.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectSystemStats.js b/test/unit/data/propertiesJsonTests/collectSystemStats.js index 65425d04..26c889c8 100644 --- a/test/unit/data/propertiesJsonTests/collectSystemStats.js +++ b/test/unit/data/propertiesJsonTests/collectSystemStats.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectTmstats.js b/test/unit/data/propertiesJsonTests/collectTmstats.js index d34ef5e6..3ccab857 100644 --- a/test/unit/data/propertiesJsonTests/collectTmstats.js +++ b/test/unit/data/propertiesJsonTests/collectTmstats.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/propertiesJsonTests/collectVirtualServers.js b/test/unit/data/propertiesJsonTests/collectVirtualServers.js index f3885388..ee21039a 100644 --- a/test/unit/data/propertiesJsonTests/collectVirtualServers.js +++ b/test/unit/data/propertiesJsonTests/collectVirtualServers.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/pullConsumersTestsData.js b/test/unit/data/pullConsumersTestsData.js index 7d03196d..95846fe4 100644 --- a/test/unit/data/pullConsumersTestsData.js +++ b/test/unit/data/pullConsumersTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/systemPollerTestsData.js b/test/unit/data/systemPollerTestsData.js index adf97358..04b9676d 100644 --- a/test/unit/data/systemPollerTestsData.js +++ b/test/unit/data/systemPollerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/systemStatsTestsData.js b/test/unit/data/systemStatsTestsData.js index 8f340e2d..f9dedf67 100644 --- a/test/unit/data/systemStatsTestsData.js +++ b/test/unit/data/systemStatsTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/data/systemStatsUtilTestsData.js b/test/unit/data/systemStatsUtilTestsData.js index 785c75d4..cfec19e9 100644 --- a/test/unit/data/systemStatsUtilTestsData.js +++ b/test/unit/data/systemStatsUtilTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/dataFilterTests.js b/test/unit/dataFilterTests.js index 816c13af..aa26a0a2 100644 --- a/test/unit/dataFilterTests.js +++ b/test/unit/dataFilterTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/dataPipelineTests.js b/test/unit/dataPipelineTests.js index da2aadf1..ae722d49 100644 --- a/test/unit/dataPipelineTests.js +++ b/test/unit/dataPipelineTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/dataTaggingTests.js b/test/unit/dataTaggingTests.js index 3be46fbd..ae01d4ec 100644 --- a/test/unit/dataTaggingTests.js +++ b/test/unit/dataTaggingTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/declarationTests.js b/test/unit/declarationTests.js index b9f70047..2488d8ba 100644 --- a/test/unit/declarationTests.js +++ b/test/unit/declarationTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -2118,7 +2118,8 @@ describe('Declarations', () => { return declValidator(data) .then((validConfig) => { const poller = validConfig.My_Poller; - assert.deepStrictEqual(poller.endpointList, + assert.deepStrictEqual( + poller.endpointList, { enable: true, items: { @@ -2129,7 +2130,8 @@ describe('Declarations', () => { } }, basePath: '' - }); + } + ); }); }); }); @@ -3351,7 +3353,8 @@ describe('Declarations', () => { return declValidator(data) .then((validConfig) => { const poller = validConfig.My_System.systemPoller; - assert.deepStrictEqual(poller, + assert.deepStrictEqual( + poller, [ { actions: [{ @@ -3370,7 +3373,8 @@ describe('Declarations', () => { interval: 90, enable: true } - ]); + ] + ); }); }); diff --git a/test/unit/endpointLoaderTests.js b/test/unit/endpointLoaderTests.js index bbc77fbe..7f417104 100644 --- a/test/unit/endpointLoaderTests.js +++ b/test/unit/endpointLoaderTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -333,9 +333,11 @@ describe('Endpoint Loader', () => { 'Foo Bar', 'Cached response should have returned in callback' ); - assert.deepStrictEqual(eLoader.cachedResponse.bash, + assert.deepStrictEqual( + eLoader.cachedResponse.bash, 'Foo Bar', - 'Should not have updated cache'); + 'Should not have updated cache' + ); }); }); @@ -360,9 +362,11 @@ describe('Endpoint Loader', () => { expected, 'Updated response should have returned in callback' ); - assert.deepStrictEqual(eLoader.cachedResponse.bash, + assert.deepStrictEqual( + eLoader.cachedResponse.bash, expected, - 'Should have updated cache'); + 'Should have updated cache' + ); }); }); @@ -388,9 +392,11 @@ describe('Endpoint Loader', () => { expected, 'Updated response should have returned in callback' ); - assert.deepStrictEqual(eLoader.cachedResponse.bash, + assert.deepStrictEqual( + eLoader.cachedResponse.bash, expected, - 'Should have updated cache'); + 'Should have updated cache' + ); }); }); }); diff --git a/test/unit/eventListener/baseDataReceiverTests.js b/test/unit/eventListener/baseDataReceiverTests.js index 06510cab..2698c3e2 100644 --- a/test/unit/eventListener/baseDataReceiverTests.js +++ b/test/unit/eventListener/baseDataReceiverTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/eventListener/dataPublisherTests.js b/test/unit/eventListener/dataPublisherTests.js index 58c72812..69af2f7c 100644 --- a/test/unit/eventListener/dataPublisherTests.js +++ b/test/unit/eventListener/dataPublisherTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -140,16 +140,20 @@ describe('Data Publisher', () => { netClientWriteFunction = () => { throw new Error('throwing from client.write()'); }; - return assert.isRejected(dataPublisher.sendDataToListener('someString', 'MyListener'), - /throwing from client.write()/); + return assert.isRejected( + dataPublisher.sendDataToListener('someString', 'MyListener'), + /throwing from client.write()/ + ); }); it('should reject if client.write() emits an error', () => { netClientWriteFunction = function () { this.emit('error', 'emitting error from client.write()'); }; - return assert.isRejected(dataPublisher.sendDataToListener('someString', 'MyListener'), - /emitting error from client.write()/); + return assert.isRejected( + dataPublisher.sendDataToListener('someString', 'MyListener'), + /emitting error from client.write()/ + ); }); }); }); diff --git a/test/unit/eventListener/eventListenerTests.js b/test/unit/eventListener/eventListenerTests.js index 511cdcf8..fa4efa9f 100644 --- a/test/unit/eventListener/eventListenerTests.js +++ b/test/unit/eventListener/eventListenerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/eventListener/messageStreamTests.js b/test/unit/eventListener/messageStreamTests.js index 8e727bda..159d0444 100644 --- a/test/unit/eventListener/messageStreamTests.js +++ b/test/unit/eventListener/messageStreamTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/eventListener/tcpUdpDataReceiverTests.js b/test/unit/eventListener/tcpUdpDataReceiverTests.js index 9f6d0529..4a5e6b67 100644 --- a/test/unit/eventListener/tcpUdpDataReceiverTests.js +++ b/test/unit/eventListener/tcpUdpDataReceiverTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/forwarderTests.js b/test/unit/forwarderTests.js index 3bbcac42..1a43d2fe 100644 --- a/test/unit/forwarderTests.js +++ b/test/unit/forwarderTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -121,14 +121,16 @@ describe('Forwarder', () => { return assert.isFulfilled(forwarder.forward(mockContext) .then(() => { assert.strictEqual(processActionsStub.calledOnce, true, 'should be called only once'); - assert.deepStrictEqual(processActionsStub.firstCall.args[1], + assert.deepStrictEqual( + processActionsStub.firstCall.args[1], [ { enable: true, JMESPath: {}, expression: '{ message: @ }' } - ]); + ] + ); assert.deepStrictEqual(consumersCalled, ['uuid1'], 'should still call consumer when actions are used'); })); }); @@ -161,14 +163,16 @@ describe('Forwarder', () => { return assert.isFulfilled(forwarder.forward(mockContext) .then(() => { assert.strictEqual(processActionsStub.calledOnce, true, 'should be called only once'); - assert.deepStrictEqual(processActionsStub.firstCall.args[1], + assert.deepStrictEqual( + processActionsStub.firstCall.args[1], [ { enable: true, JMESPath: {}, expression: 'badexpression' } - ]); + ] + ); assert.deepStrictEqual(processActionsStub.exceptions[0].message, 'ERROR'); assert.deepStrictEqual(consumersCalled, ['uuid1'], 'should still call consumer when actions are used'); })); diff --git a/test/unit/iHealthTests.js b/test/unit/iHealthTests.js index 6aa27880..f898306d 100644 --- a/test/unit/iHealthTests.js +++ b/test/unit/iHealthTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/ihealthPollerTests.js b/test/unit/ihealthPollerTests.js index abc6c87d..292695e2 100644 --- a/test/unit/ihealthPollerTests.js +++ b/test/unit/ihealthPollerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/loggerTests.js b/test/unit/loggerTests.js index c9aa84f0..1557ab6a 100644 --- a/test/unit/loggerTests.js +++ b/test/unit/loggerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -150,13 +150,43 @@ describe('Logger', () => { }); it('should mask secrets', () => { - const msg = 'passphrase: { cipherText: \'test_passphrase\' }\n' - + '"passphrase": {\ncipherText: "test_passphrase"\n}' - + '\'passphrase": "test_passphrase"'; - const expected = 'this contains secrets: passphrase: {*********}\n' - + '"passphrase": {\ncipherText: "*********"\n}' - + '\'passphrase": "*********"'; - logger.info(`this contains secrets: ${msg}`); + const mask = '*********'; + const decl = { + someSecretData: { + cipherText: 'test_passphrase_1' + }, + someSecretData_2: { + passphrase: 'test_passphrase_2' + }, + someSecretData_3: { + nestedData: { + passphrase: { + cipherText: 'test_passphrase_3' + } + } + }, + someSecretData_4: { + nestedData: { + passphrase: 'test_passphrase_4' + } + }, + jsonData: JSON.stringify({ + someSecretData: { + cipherText: 'test_passphrase_1' + }, + someSecretData_2: { + passphrase: 'test_passphrase_2' + } + }, null, 1) + }; + const expected = 'this contains secrets: {' + + `"someSecretData":{"cipherText":"${mask}"},` + + `"someSecretData_2":{"passphrase":"${mask}"},` + + `"someSecretData_3":{"nestedData":{"passphrase":{"cipherText":"${mask}"}}},` + + `"someSecretData_4":{"nestedData":{"passphrase":"${mask}"}},` + + '"jsonData":"{\\n \\"someSecretData\\": {\\n \\"cipherText\\": \\"*********\\"\\n },\\n \\"someSecretData_2\\": {\\n \\"passphrase\\": \\"*********\\"\\n }\\n}"' + + '}'; + logger.info(`this contains secrets: ${JSON.stringify(decl)}`); assert.include(coreStub.logger.messages.info[0], expected, 'should mask secrets'); logger.info(coreStub.logger.messages.info[0]); diff --git a/test/unit/normalizeTests.js b/test/unit/normalizeTests.js index cf38a1a8..23cfb04a 100644 --- a/test/unit/normalizeTests.js +++ b/test/unit/normalizeTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/outputTests.js b/test/unit/outputTests.js index 03a9e64b..97bf29e2 100644 --- a/test/unit/outputTests.js +++ b/test/unit/outputTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/persistentStorageTests.js b/test/unit/persistentStorageTests.js index 2636e0d7..31fe55d5 100644 --- a/test/unit/persistentStorageTests.js +++ b/test/unit/persistentStorageTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/propertiesJsonTests.js b/test/unit/propertiesJsonTests.js index bb1edf8a..2c10c6da 100644 --- a/test/unit/propertiesJsonTests.js +++ b/test/unit/propertiesJsonTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/pullConsumers/data/prometheusPullConsumerTestsData.js b/test/unit/pullConsumers/data/prometheusPullConsumerTestsData.js index a31b4fca..cc2364b1 100644 --- a/test/unit/pullConsumers/data/prometheusPullConsumerTestsData.js +++ b/test/unit/pullConsumers/data/prometheusPullConsumerTestsData.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -94,6 +94,8 @@ f5_lowestPriogrp{pools="/Sample_02/A1/web_pool1"} 0 # TYPE f5_port gauge f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 80 f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 80 +f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 80 +f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 80 f5_port{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 80 f5_port{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 80 f5_port{pools="/Sample_02/A1/web_pool",members="/Sample_02/192.0.2.10:80"} 80 @@ -101,6 +103,11 @@ f5_port{pools="/Sample_02/A1/web_pool",members="/Sample_02/192.0.2.11:80"} 80 f5_port{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.12:80"} 80 f5_port{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.13:80"} 80 +# HELP f5_totRequests totRequests +# TYPE f5_totRequests gauge +f5_totRequests{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_totRequests{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + # HELP f5_cookiePersistInserts cookiePersistInserts # TYPE f5_cookiePersistInserts gauge f5_cookiePersistInserts{httpProfiles="/Common/http"} 0 @@ -1298,6 +1305,8 @@ f5_serverside_bitsIn{pools="/Common/h.4"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 0 +f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool1"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 0 @@ -1314,6 +1323,8 @@ f5_serverside_bitsOut{pools="/Common/h.4"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 0 +f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool1"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 0 @@ -1330,6 +1341,8 @@ f5_serverside_curConns{pools="/Common/h.4"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 0 +f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool1"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 0 @@ -1340,6 +1353,26 @@ f5_serverside_curConns{pools="/Sample_02/A1/web_pool1"} 0 f5_serverside_curConns{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.12:80"} 0 f5_serverside_curConns{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.13:80"} 0 +# HELP f5_serverside_maxConns serverside.maxConns +# TYPE f5_serverside_maxConns gauge +f5_serverside_maxConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_maxConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + +# HELP f5_serverside_pktsIn serverside.pktsIn +# TYPE f5_serverside_pktsIn gauge +f5_serverside_pktsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_pktsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + +# HELP f5_serverside_pktsOut serverside.pktsOut +# TYPE f5_serverside_pktsOut gauge +f5_serverside_pktsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_pktsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + +# HELP f5_serverside_totConns serverside.totConns +# TYPE f5_serverside_totConns gauge +f5_serverside_totConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_totConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + # HELP f5_cipherUses_adhKeyxchg cipherUses.adhKeyxchg # TYPE f5_cipherUses_adhKeyxchg gauge f5_cipherUses_adhKeyxchg{clientSslProfiles="/Common/clientssl"} 0 @@ -1876,6 +1909,8 @@ f5_lowestPriogrp{pools="/Sample_02/A1/web_pool1"} 0 # TYPE f5_port gauge f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 80 f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 80 +f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 80 +f5_port{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 80 f5_port{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 80 f5_port{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 80 f5_port{pools="/Sample_02/A1/web_pool",members="/Sample_02/192.0.2.10:80"} 80 @@ -1883,12 +1918,19 @@ f5_port{pools="/Sample_02/A1/web_pool",members="/Sample_02/192.0.2.11:80"} 80 f5_port{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.12:80"} 80 f5_port{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.13:80"} 80 +# HELP f5_totRequests totRequests +# TYPE f5_totRequests gauge +f5_totRequests{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_totRequests{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + # HELP f5_serverside_bitsIn serverside.bitsIn # TYPE f5_serverside_bitsIn gauge f5_serverside_bitsIn{pools="/Common/h.4"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 0 +f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool1"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 0 f5_serverside_bitsIn{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 0 @@ -1905,6 +1947,8 @@ f5_serverside_bitsOut{pools="/Common/h.4"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 0 +f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool1"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 0 f5_serverside_bitsOut{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 0 @@ -1921,6 +1965,8 @@ f5_serverside_curConns{pools="/Common/h.4"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.10:80"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/192.0.1.11:80"} 0 +f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_curConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool1"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.12:80"} 0 f5_serverside_curConns{pools="/Sample_01/A1/web_pool1",members="/Sample_01/192.0.1.13:80"} 0 @@ -1930,6 +1976,26 @@ f5_serverside_curConns{pools="/Sample_02/A1/web_pool",members="/Sample_02/192.0. f5_serverside_curConns{pools="/Sample_02/A1/web_pool1"} 0 f5_serverside_curConns{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.12:80"} 0 f5_serverside_curConns{pools="/Sample_02/A1/web_pool1",members="/Sample_02/192.0.2.13:80"} 0 + +# HELP f5_serverside_maxConns serverside.maxConns +# TYPE f5_serverside_maxConns gauge +f5_serverside_maxConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_maxConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + +# HELP f5_serverside_pktsIn serverside.pktsIn +# TYPE f5_serverside_pktsIn gauge +f5_serverside_pktsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_pktsIn{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + +# HELP f5_serverside_pktsOut serverside.pktsOut +# TYPE f5_serverside_pktsOut gauge +f5_serverside_pktsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_pktsOut{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 + +# HELP f5_serverside_totConns serverside.totConns +# TYPE f5_serverside_totConns gauge +f5_serverside_totConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/_auto_192.0.1.12:80"} 0 +f5_serverside_totConns{pools="/Sample_01/A1/web_pool",members="/Sample_01/bestwebsite.com:80"} 0 ` } }; diff --git a/test/unit/pullConsumers/data/system_poller_datasets.json b/test/unit/pullConsumers/data/system_poller_datasets.json index 88b12acb..8b5ad47e 100644 --- a/test/unit/pullConsumers/data/system_poller_datasets.json +++ b/test/unit/pullConsumers/data/system_poller_datasets.json @@ -447,6 +447,42 @@ "serverside.curConns": 0, "availabilityState": "offline", "enabledState": "enabled" + }, + "/Sample_01/_auto_192.0.1.12:80": { + "addr": "192.0.1.12", + "monitorStatus": "unchecked", + "poolName": "/Sample_01/A1/web_pool", + "port": 80, + "serverside.bitsIn": 0, + "serverside.bitsOut": 0, + "serverside.curConns": 0, + "serverside.maxConns": 0, + "serverside.pktsIn": 0, + "serverside.pktsOut": 0, + "serverside.totConns": 0, + "availabilityState": "unknown", + "enabledState": "enabled", + "status.statusReason": "Pool member does not have service checking enabled", + "totRequests": 0, + "fqdn": "bestwebsite.com" + }, + "/Sample_01/bestwebsite.com:80": { + "addr": "::", + "monitorStatus": "fqdn-up", + "poolName": "/Sample_01/A1/web_pool", + "port": 80, + "serverside.bitsIn": 0, + "serverside.bitsOut": 0, + "serverside.curConns": 0, + "serverside.maxConns": 0, + "serverside.pktsIn": 0, + "serverside.pktsOut": 0, + "serverside.totConns": 0, + "availabilityState": "available", + "enabledState": "enabled", + "status.statusReason": "The DNS server(s) are available", + "totRequests": 0, + "fqdn": "bestwebsite.com" } } }, @@ -1629,6 +1665,42 @@ "serverside.curConns": 0, "availabilityState": "offline", "enabledState": "enabled" + }, + "/Sample_01/_auto_192.0.1.12:80": { + "addr": "192.0.1.12", + "monitorStatus": "unchecked", + "poolName": "/Sample_01/A1/web_pool", + "port": 80, + "serverside.bitsIn": 0, + "serverside.bitsOut": 0, + "serverside.curConns": 0, + "serverside.maxConns": 0, + "serverside.pktsIn": 0, + "serverside.pktsOut": 0, + "serverside.totConns": 0, + "availabilityState": "unknown", + "enabledState": "enabled", + "status.statusReason": "Pool member does not have service checking enabled", + "totRequests": 0, + "fqdn": "bestwebsite.com" + }, + "/Sample_01/bestwebsite.com:80": { + "addr": "::", + "monitorStatus": "fqdn-up", + "poolName": "/Sample_01/A1/web_pool", + "port": 80, + "serverside.bitsIn": 0, + "serverside.bitsOut": 0, + "serverside.curConns": 0, + "serverside.maxConns": 0, + "serverside.pktsIn": 0, + "serverside.pktsOut": 0, + "serverside.totConns": 0, + "availabilityState": "available", + "enabledState": "enabled", + "status.statusReason": "The DNS server(s) are available", + "totRequests": 0, + "fqdn": "bestwebsite.com" } }, "tenant": "Sample_01", @@ -2789,4 +2861,4 @@ "telemetryEventCategory": "systemInfo" } } -} +} \ No newline at end of file diff --git a/test/unit/pullConsumers/defaultPullConsumerTests.js b/test/unit/pullConsumers/defaultPullConsumerTests.js index 1a5c9953..3b231b5e 100644 --- a/test/unit/pullConsumers/defaultPullConsumerTests.js +++ b/test/unit/pullConsumers/defaultPullConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/pullConsumers/prometheusPullConsumerTests.js b/test/unit/pullConsumers/prometheusPullConsumerTests.js index f363b6b9..cb9d847a 100644 --- a/test/unit/pullConsumers/prometheusPullConsumerTests.js +++ b/test/unit/pullConsumers/prometheusPullConsumerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/pullConsumersTests.js b/test/unit/pullConsumersTests.js index daa7e7d7..571071e1 100644 --- a/test/unit/pullConsumersTests.js +++ b/test/unit/pullConsumersTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -113,8 +113,11 @@ describe('Pull Consumers', () => { .then((normalized) => configWorker.emitAsync('change', normalized)) .then(() => { const loadedConsumers = pullConsumers.getConsumers(); - assert.strictEqual(Object.keys(loadedConsumers).indexOf('unknowntype'), -1, - 'should not load invalid consumer type'); + assert.strictEqual( + Object.keys(loadedConsumers).indexOf('unknowntype'), + -1, + 'should not load invalid consumer type' + ); }); }); @@ -220,11 +223,13 @@ describe('Pull Consumers', () => { describe('default (no namespace)', () => pullConsumersTestsData.getData.forEach((testConf) => runTestCase(testConf))); - describe('default (no namespace), lookup using f5telemetry_default name', + describe( + 'default (no namespace), lookup using f5telemetry_default name', () => pullConsumersTestsData.getData.forEach((testConf) => { testConf.namespace = 'f5telemetry_default'; runTestCase(testConf); - })); + }) + ); describe('with namespace only', () => { const namespaceOnlyTestsData = testUtil.deepCopy(pullConsumersTestsData.getData); diff --git a/test/unit/requestHandlers/baseHandlerTests.js b/test/unit/requestHandlers/baseHandlerTests.js index 8dc89cd2..7a23305c 100644 --- a/test/unit/requestHandlers/baseHandlerTests.js +++ b/test/unit/requestHandlers/baseHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/declareHandlerTests.js b/test/unit/requestHandlers/declareHandlerTests.js index 79a55970..f67e4556 100644 --- a/test/unit/requestHandlers/declareHandlerTests.js +++ b/test/unit/requestHandlers/declareHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/errorHandlerTests.js b/test/unit/requestHandlers/errorHandlerTests.js index 478e1f1b..3089a35b 100644 --- a/test/unit/requestHandlers/errorHandlerTests.js +++ b/test/unit/requestHandlers/errorHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/eventListenerHandlerTests.js b/test/unit/requestHandlers/eventListenerHandlerTests.js index c8b8d234..974816dc 100644 --- a/test/unit/requestHandlers/eventListenerHandlerTests.js +++ b/test/unit/requestHandlers/eventListenerHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -52,11 +52,17 @@ describe('EventListenerHandler', () => { .then((handler) => { assert.ok(handler === requestHandler, 'should return a reference to original handler'); assert.strictEqual(requestHandler.getCode(), 200, 'should return expected code'); - assert.deepStrictEqual(requestHandler.getBody(), - { data: { data: 'testData' }, message: 'success' }, 'should return expected body'); + assert.deepStrictEqual( + requestHandler.getBody(), + { data: { data: 'testData' }, message: 'success' }, + 'should return expected body' + ); assert.strictEqual(sendDataStub.callCount, 1, 'should be called once'); - assert.deepStrictEqual(sendDataStub.firstCall.args, - [{ data: 'testData' }, 'My_Listener', { namespace: undefined }], 'should be called once'); + assert.deepStrictEqual( + sendDataStub.firstCall.args, + [{ data: 'testData' }, 'My_Listener', { namespace: undefined }], + 'should be called once' + ); }); }); @@ -72,11 +78,17 @@ describe('EventListenerHandler', () => { .then((handler) => { assert.ok(handler === requestHandler, 'should return a reference to original handler'); assert.strictEqual(requestHandler.getCode(), 200, 'should return expected code'); - assert.deepStrictEqual(requestHandler.getBody(), - { data: { data: 'testData' }, message: 'success' }, 'should return expected body'); + assert.deepStrictEqual( + requestHandler.getBody(), + { data: { data: 'testData' }, message: 'success' }, + 'should return expected body' + ); assert.strictEqual(sendDataStub.callCount, 1, 'should be called once'); - assert.deepStrictEqual(sendDataStub.firstCall.args, - [{ data: 'testData' }, 'My_Listener', { namespace: 'My_Namespace' }], 'should be called once'); + assert.deepStrictEqual( + sendDataStub.firstCall.args, + [{ data: 'testData' }, 'My_Listener', { namespace: 'My_Namespace' }], + 'should be called once' + ); }); }); diff --git a/test/unit/requestHandlers/ihealthPollerHandlerTests.js b/test/unit/requestHandlers/ihealthPollerHandlerTests.js index 5748b127..2065bca3 100644 --- a/test/unit/requestHandlers/ihealthPollerHandlerTests.js +++ b/test/unit/requestHandlers/ihealthPollerHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/infoHandlerTests.js b/test/unit/requestHandlers/infoHandlerTests.js index edc3f96e..540e7275 100644 --- a/test/unit/requestHandlers/infoHandlerTests.js +++ b/test/unit/requestHandlers/infoHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/pullConsumerHandlerTests.js b/test/unit/requestHandlers/pullConsumerHandlerTests.js index 0cecb770..7d1710e6 100644 --- a/test/unit/requestHandlers/pullConsumerHandlerTests.js +++ b/test/unit/requestHandlers/pullConsumerHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/routerTests.js b/test/unit/requestHandlers/routerTests.js index 6913cc61..9b4ddd9b 100644 --- a/test/unit/requestHandlers/routerTests.js +++ b/test/unit/requestHandlers/routerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/requestHandlers/systemPollerHandlerTests.js b/test/unit/requestHandlers/systemPollerHandlerTests.js index 13e6d8ca..1c4337b3 100644 --- a/test/unit/requestHandlers/systemPollerHandlerTests.js +++ b/test/unit/requestHandlers/systemPollerHandlerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/restWorkerTests.js b/test/unit/restWorkerTests.js index b6779d24..fd71aa6b 100644 --- a/test/unit/restWorkerTests.js +++ b/test/unit/restWorkerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/assert.js b/test/unit/shared/assert.js index 06afbc98..fe20a1f3 100644 --- a/test/unit/shared/assert.js +++ b/test/unit/shared/assert.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/bootstrap.js b/test/unit/shared/bootstrap.js index c065286f..8d0f7149 100644 --- a/test/unit/shared/bootstrap.js +++ b/test/unit/shared/bootstrap.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/dummies.js b/test/unit/shared/dummies.js index 9d0bf472..0b247f82 100644 --- a/test/unit/shared/dummies.js +++ b/test/unit/shared/dummies.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/restoreCache.js b/test/unit/shared/restoreCache.js index 9a3878ce..4360bebb 100644 --- a/test/unit/shared/restoreCache.js +++ b/test/unit/shared/restoreCache.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/commonTests/validateDeclaration.js b/test/unit/shared/schemaValidation/commonTests/validateDeclaration.js index 7475415d..2605df0a 100644 --- a/test/unit/shared/schemaValidation/commonTests/validateDeclaration.js +++ b/test/unit/shared/schemaValidation/commonTests/validateDeclaration.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/index.js b/test/unit/shared/schemaValidation/index.js index 7fb92295..659579fc 100644 --- a/test/unit/shared/schemaValidation/index.js +++ b/test/unit/shared/schemaValidation/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -83,9 +83,7 @@ module.exports = { * Simply verify that path is string(s) */ if (Array.isArray(propConf.property)) { - propConf.property.forEach((p) => assert.isString( - p, `Property path ${JSON.stringify(propConf.property)} should contain strings only` - )); + propConf.property.forEach((p) => assert.isString(p, `Property path ${JSON.stringify(propConf.property)} should contain strings only`)); } else { assert.isString(propConf.property, `Property name "${propConf.property}" should be a string`); } diff --git a/test/unit/shared/schemaValidation/propertyTests/additionalProperties.js b/test/unit/shared/schemaValidation/propertyTests/additionalProperties.js index 2d4da5a6..9c87d73a 100644 --- a/test/unit/shared/schemaValidation/propertyTests/additionalProperties.js +++ b/test/unit/shared/schemaValidation/propertyTests/additionalProperties.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -45,11 +45,14 @@ module.exports = { combinations.forEach((propSets) => { it(`should allow additional properties - ${propSets.join(', ')}`, () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, Object.assign( lodash.get(testDecl, ctx.property), lodash.pick(testConf.allowed, propSets) - )); + ) + ); return assert.isFulfilled( ctx.validator(testDecl), `property "${ctx.propFullName}" should allow additional properties` @@ -66,14 +69,17 @@ module.exports = { combinations.forEach((propSets) => { it(`should not allow additional properties - ${propSets.join(', ')}`, () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, Object.assign( lodash.get(testDecl, ctx.property), lodash.pick(testConf.notAllowed, propSets) - )); + ) + ); return assert.isRejected( ctx.validator(testDecl), - new RegExp('"keyword":"additionalProperties"'), // check for keyword only (multiple props not allowed) + /"keyword":"additionalProperties"/, // check for keyword only (multiple props not allowed) `property "${ctx.propFullName}" should not allow additional properties` ); }); @@ -89,11 +95,14 @@ module.exports = { combinations.forEach((propSets) => { it(`should fail on attempt to set additional properties - ${propSets.join(', ')}${subTitle}`, () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, Object.assign( lodash.get(testDecl, ctx.property), lodash.pick(testConf.failing, propSets) - )); + ) + ); return assert.isRejected( ctx.validator(testDecl), /keyword/, diff --git a/test/unit/shared/schemaValidation/propertyTests/arrayLength.js b/test/unit/shared/schemaValidation/propertyTests/arrayLength.js index 0006ddf5..9db055f3 100644 --- a/test/unit/shared/schemaValidation/propertyTests/arrayLength.js +++ b/test/unit/shared/schemaValidation/propertyTests/arrayLength.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/defaultValue.js b/test/unit/shared/schemaValidation/propertyTests/defaultValue.js index 0bd72f11..8a833601 100644 --- a/test/unit/shared/schemaValidation/propertyTests/defaultValue.js +++ b/test/unit/shared/schemaValidation/propertyTests/defaultValue.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/dependencies.js b/test/unit/shared/schemaValidation/propertyTests/dependencies.js index ff60679a..9ac907f2 100644 --- a/test/unit/shared/schemaValidation/propertyTests/dependencies.js +++ b/test/unit/shared/schemaValidation/propertyTests/dependencies.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/enum.js b/test/unit/shared/schemaValidation/propertyTests/enum.js index 93bde883..70476f9d 100644 --- a/test/unit/shared/schemaValidation/propertyTests/enum.js +++ b/test/unit/shared/schemaValidation/propertyTests/enum.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/numberRange.js b/test/unit/shared/schemaValidation/propertyTests/numberRange.js index 93a960bb..3f620b7b 100644 --- a/test/unit/shared/schemaValidation/propertyTests/numberRange.js +++ b/test/unit/shared/schemaValidation/propertyTests/numberRange.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/optionalProps.js b/test/unit/shared/schemaValidation/propertyTests/optionalProps.js index e959ca05..4fb6a4b3 100644 --- a/test/unit/shared/schemaValidation/propertyTests/optionalProps.js +++ b/test/unit/shared/schemaValidation/propertyTests/optionalProps.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/required.js b/test/unit/shared/schemaValidation/propertyTests/required.js index 44d1d9a8..638d2950 100644 --- a/test/unit/shared/schemaValidation/propertyTests/required.js +++ b/test/unit/shared/schemaValidation/propertyTests/required.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/propertyTests/stringLength.js b/test/unit/shared/schemaValidation/propertyTests/stringLength.js index 68901d27..10183ae8 100644 --- a/test/unit/shared/schemaValidation/propertyTests/stringLength.js +++ b/test/unit/shared/schemaValidation/propertyTests/stringLength.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -41,12 +41,15 @@ module.exports = { // no sense to test it when minLength is 0 it('should not allow to set string with length less than minLength', () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, testConf.valueCb( testDecl, ctx.property, testConf.minLength - 1 - )); + ) + ); return assert.isRejected( ctx.validator(testDecl), new RegExp(`"keyword":"minLength".*"dataPath":.*${ctx.propFullName}.*"message":"should NOT be shorter than ${testConf.minLength} characters"`), @@ -57,12 +60,15 @@ module.exports = { it('should allow to set string with length equal to minLength', () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, testConf.valueCb( testDecl, ctx.property, testConf.minLength - )); + ) + ); return assert.isFulfilled( ctx.validator(testDecl), `should allow to set string with length equal to ${testConf.minLength} characters` @@ -74,12 +80,15 @@ module.exports = { utils.testControls.getSubTestDescribe(testConf)(`"maxLength" keyword tests (maxLength === ${testConf.maxLength})${subTitle}`, () => { it('should not allow to set string with length more than maxLength', () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, testConf.valueCb( testDecl, ctx.property, testConf.maxLength + 1 - )); + ) + ); return assert.isRejected( ctx.validator(testDecl), new RegExp(`"keyword":"maxLength".*"dataPath":.*${ctx.propFullName}.*"message":"should NOT be longer than ${testConf.maxLength} characters"`), @@ -89,12 +98,15 @@ module.exports = { it('should allow to set string with length equal to maxLength', () => { const testDecl = lodash.cloneDeep(ctx.declaration); - lodash.set(testDecl, ctx.property, + lodash.set( + testDecl, + ctx.property, testConf.valueCb( testDecl, ctx.property, testConf.maxLength - )); + ) + ); return assert.isFulfilled( ctx.validator(testDecl), `should allow to set string with length equal to ${testConf.maxLength} characters` diff --git a/test/unit/shared/schemaValidation/propertyTests/valueTests.js b/test/unit/shared/schemaValidation/propertyTests/valueTests.js index 9f282d40..24958d1c 100644 --- a/test/unit/shared/schemaValidation/propertyTests/valueTests.js +++ b/test/unit/shared/schemaValidation/propertyTests/valueTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/schemaValidation/utils.js b/test/unit/shared/schemaValidation/utils.js index be6409a5..99c582df 100644 --- a/test/unit/shared/schemaValidation/utils.js +++ b/test/unit/shared/schemaValidation/utils.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/stubs.js b/test/unit/shared/stubs.js index 5712f070..e9373a60 100644 --- a/test/unit/shared/stubs.js +++ b/test/unit/shared/stubs.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/shared/util.js b/test/unit/shared/util.js index 0a414c54..787675ae 100644 --- a/test/unit/shared/util.js +++ b/test/unit/shared/util.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -329,6 +329,6 @@ module.exports = { * @returns {Promise} resolved once N .ms passed */ sleep(sleepTime) { - return new Promise((resolve) => setTimeout(resolve, sleepTime)); + return new Promise((resolve) => { setTimeout(resolve, sleepTime); }); } }; diff --git a/test/unit/systemPollerTests.js b/test/unit/systemPollerTests.js index 05642c05..7e98359b 100644 --- a/test/unit/systemPollerTests.js +++ b/test/unit/systemPollerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -140,42 +140,42 @@ describe('System Poller', () => { describe('.getPollersConfig', () => { /* eslint-disable implicit-arrow-linebreak */ systemPollerConfigTestsData.getPollersConfig.forEach((testConf) => - testUtil.getCallableIt(testConf)( - testConf.name, () => configWorker.processDeclaration(testUtil.deepCopy(testConf.declaration)) - .then(() => systemPoller.getPollersConfig(testConf.sysOrPollerName, testConf.funcOptions)) - .then((pollersConfig) => { - pollersConfig = pollersConfig.map((p) => ({ name: p.traceName })); - assert.sameDeepMembers(pollersConfig, testConf.expectedConfig); - // assert.isTrue(coreStub.deviceUtil.decryptSecret.called); - }, (error) => { - if (testConf.errorRegExp) { - return assert.match(error, testConf.errorRegExp, 'should match expected error message'); - } - return Promise.reject(error); - }) - )); + testUtil.getCallableIt(testConf)(testConf.name, () => configWorker.processDeclaration(testUtil.deepCopy( + testConf.declaration + )) + .then(() => systemPoller.getPollersConfig(testConf.sysOrPollerName, testConf.funcOptions)) + .then((pollersConfig) => { + pollersConfig = pollersConfig.map((p) => ({ name: p.traceName })); + assert.sameDeepMembers(pollersConfig, testConf.expectedConfig); + // assert.isTrue(coreStub.deviceUtil.decryptSecret.called); + }, (error) => { + if (testConf.errorRegExp) { + return assert.match(error, testConf.errorRegExp, 'should match expected error message'); + } + return Promise.reject(error); + }))); }); describe('.findSystemOrPollerConfigs', () => { /* eslint-disable implicit-arrow-linebreak */ systemPollerConfigTestsData.findSystemOrPollerConfigs.forEach((testConf) => - testUtil.getCallableIt(testConf)( - testConf.name, () => configWorker.processDeclaration(testUtil.deepCopy(testConf.rawConfig)) - .then(() => { - let actual; - try { - actual = systemPoller.findSystemOrPollerConfigs( - configWorker.currentConfig, - testConf.sysOrPollerName, - testConf.pollerName, - testConf.namespaceName - ); - } catch (err) { - actual = err.message; - } - assert.deepStrictEqual(actual, testConf.expected); - }) - )); + testUtil.getCallableIt(testConf)(testConf.name, () => configWorker.processDeclaration(testUtil.deepCopy( + testConf.rawConfig + )) + .then(() => { + let actual; + try { + actual = systemPoller.findSystemOrPollerConfigs( + configWorker.currentConfig, + testConf.sysOrPollerName, + testConf.pollerName, + testConf.namespaceName + ); + } catch (err) { + actual = err.message; + } + assert.deepStrictEqual(actual, testConf.expected); + }))); }); describe('.fetchPollersData', () => { diff --git a/test/unit/systemStatsTests.js b/test/unit/systemStatsTests.js index 7b8b02d3..4e5fe7c8 100644 --- a/test/unit/systemStatsTests.js +++ b/test/unit/systemStatsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/teemReporterTests.js b/test/unit/teemReporterTests.js index 0d888310..bd3e3194 100644 --- a/test/unit/teemReporterTests.js +++ b/test/unit/teemReporterTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/configTests.js b/test/unit/utils/configTests.js index fd4557e5..3af4f706 100644 --- a/test/unit/utils/configTests.js +++ b/test/unit/utils/configTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -34,7 +34,8 @@ describe('Config Util', () => { let coreStub; const parseDeclaration = (declaration, options) => configWorker.processDeclaration( - testUtil.deepCopy(declaration), options + testUtil.deepCopy(declaration), + options ); before(() => { @@ -294,7 +295,8 @@ describe('Config Util', () => { }; return parseDeclaration(rawDecl) .then(() => { - assert.deepStrictEqual(configUtil.getTelemetryControls(configWorker.currentConfig), + assert.deepStrictEqual( + configUtil.getTelemetryControls(configWorker.currentConfig), { class: 'Controls', name: 'controls', @@ -303,7 +305,8 @@ describe('Config Util', () => { id: 'f5telemetry_default::controls', memoryThresholdPercent: 90, debug: false - }); + } + ); }); }); @@ -321,7 +324,8 @@ describe('Config Util', () => { }; return parseDeclaration(rawDecl) .then(() => { - assert.deepStrictEqual(configUtil.getTelemetryControls(configWorker.currentConfig), + assert.deepStrictEqual( + configUtil.getTelemetryControls(configWorker.currentConfig), { class: 'Controls', name: 'controls', // this is just a guess, depends on ordering @@ -330,7 +334,8 @@ describe('Config Util', () => { id: 'f5telemetry_default::controls', memoryThresholdPercent: 90, debug: false - }); + } + ); }); }); @@ -700,7 +705,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer1); assert.deepStrictEqual( configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer1 + configWorker.currentConfig, + pullConsumer1 ), { class: 'Telemetry_Pull_Consumer_System_Poller_Group', @@ -725,7 +731,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer1); assert.deepStrictEqual( configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer2 + configWorker.currentConfig, + pullConsumer2 ), { class: 'Telemetry_Pull_Consumer_System_Poller_Group', @@ -750,7 +757,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer1); assert.deepStrictEqual( configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer3 + configWorker.currentConfig, + pullConsumer3 ), { class: 'Telemetry_Pull_Consumer_System_Poller_Group', @@ -775,7 +783,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer1); assert.deepStrictEqual( configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer4 + configWorker.currentConfig, + pullConsumer4 ), { class: 'Telemetry_Pull_Consumer_System_Poller_Group', @@ -956,7 +965,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer1); const pollerGroup1 = configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer1 + configWorker.currentConfig, + pullConsumer1 ); assert.isNotEmpty(pollerGroup1); assert.deepStrictEqual(pollerGroup1.id, 'f5telemetry_default::Telemetry_Pull_Consumer_System_Poller_Group_My_Pull_Consumer_1'); @@ -975,7 +985,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer2); const pollerGroup2 = configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer2 + configWorker.currentConfig, + pullConsumer2 ); assert.isNotEmpty(pollerGroup2); assert.deepStrictEqual(pollerGroup2.id, 'f5telemetry_default::Telemetry_Pull_Consumer_System_Poller_Group_My_Pull_Consumer_2'); @@ -994,7 +1005,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer3); const pollerGroup3 = configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer3 + configWorker.currentConfig, + pullConsumer3 ); assert.isNotEmpty(pollerGroup3); assert.deepStrictEqual(pollerGroup3.id, 'My_Namespace::Telemetry_Pull_Consumer_System_Poller_Group_My_Pull_Consumer_1'); @@ -1013,7 +1025,8 @@ describe('Config Util', () => { assert.isNotEmpty(pullConsumer4); const pollerGroup4 = configUtil.getTelemetryPullConsumerSystemPollerGroupForPullConsumer( - configWorker.currentConfig, pullConsumer4 + configWorker.currentConfig, + pullConsumer4 ); assert.isNotEmpty(pollerGroup4); assert.deepStrictEqual(pollerGroup4.id, 'My_Namespace::Telemetry_Pull_Consumer_System_Poller_Group_My_Pull_Consumer_2'); diff --git a/test/unit/utils/dataTests.js b/test/unit/utils/dataTests.js index 1acb0007..8ee18973 100644 --- a/test/unit/utils/dataTests.js +++ b/test/unit/utils/dataTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/datetimeTests.js b/test/unit/utils/datetimeTests.js index 3ad23fa6..68bb28e9 100644 --- a/test/unit/utils/datetimeTests.js +++ b/test/unit/utils/datetimeTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/deviceTests.js b/test/unit/utils/deviceTests.js index edb48b53..78016fbe 100644 --- a/test/unit/utils/deviceTests.js +++ b/test/unit/utils/deviceTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -426,8 +426,10 @@ describe('Device Util', () => { valueRange: 'false true' } }]); - return assert.becomes(deviceUtil.getDeviceNodeMemoryLimit(constants.LOCAL_HOST), - constants.APP_THRESHOLDS.MEMORY.DEFAULT_MB); + return assert.becomes( + deviceUtil.getDeviceNodeMemoryLimit(constants.LOCAL_HOST), + constants.APP_THRESHOLDS.MEMORY.DEFAULT_MB + ); }); it('should return db value when db variables set', () => { @@ -463,8 +465,10 @@ describe('Device Util', () => { } // no second mock to simulate failure to retrieve from provision.db endpoint }]); - return assert.becomes(deviceUtil.getDeviceNodeMemoryLimit(constants.LOCAL_HOST), - constants.APP_THRESHOLDS.MEMORY.DEFAULT_MB); + return assert.becomes( + deviceUtil.getDeviceNodeMemoryLimit(constants.LOCAL_HOST), + constants.APP_THRESHOLDS.MEMORY.DEFAULT_MB + ); }); }); @@ -692,7 +696,7 @@ describe('Device Util', () => { const requestSecret = radiusRequests[0]; assert.lengthOf(radiusRequests, 2, 'largeSecret should be in 2 chunks'); assert.lengthOf(requestSecret, 500, 'length of chunk should be 500'); - assert.ok(new RegExp(/\n/).test(requestSecret), 'newlines should be preserved'); + assert.ok(/\n/.test(requestSecret), 'newlines should be preserved'); }); }); diff --git a/test/unit/utils/eventEmitter.js b/test/unit/utils/eventEmitter.js index 9ff85d86..ce287ddf 100644 --- a/test/unit/utils/eventEmitter.js +++ b/test/unit/utils/eventEmitter.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -55,7 +55,7 @@ describe('Safe Event Emitter', () => { it('should catch listener error in async part', () => { const error = new Error('test error'); - emitter.on(eventName, () => new Promise((resolve, reject) => reject(error))); + emitter.on(eventName, () => new Promise((resolve, reject) => { reject(error); })); return assert.becomes(emitter.safeEmitAsync(eventName), error); }); }); diff --git a/test/unit/utils/ihealthTests.js b/test/unit/utils/ihealthTests.js index 2f9c6e90..f71b93b1 100644 --- a/test/unit/utils/ihealthTests.js +++ b/test/unit/utils/ihealthTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -1176,26 +1176,28 @@ describe('iHealth Utils', () => { describe('.authenticate()', () => { const setupNockEndpoint = (endpointOpts) => { - testUtil.mockEndpoints([Object.assign({ - endpoint: '/auth/pub/sso/login/ihealth-api', - code: 200, - method: 'post', - request: { - user_id: 'username', - user_secret: 'passphrase' - }, - requestHeaders: { - 'Content-Type': 'application/json' - }, - responseHeaders: { - 'Set-Cookie': 'someCookie=someValue; Path=/; Domain=.f5.com' + testUtil.mockEndpoints( + [Object.assign({ + endpoint: '/auth/pub/sso/login/ihealth-api', + code: 200, + method: 'post', + request: { + user_id: 'username', + user_secret: 'passphrase' + }, + requestHeaders: { + 'Content-Type': 'application/json' + }, + responseHeaders: { + 'Set-Cookie': 'someCookie=someValue; Path=/; Domain=.f5.com' + } + }, endpointOpts || {})], + { + host: 'api.f5.com', + port: 443, + proto: 'https' } - }, endpointOpts || {})], - { - host: 'api.f5.com', - port: 443, - proto: 'https' - }); + ); }; beforeEach(() => { @@ -1219,23 +1221,25 @@ describe('iHealth Utils', () => { describe('.fetchQkviewDiagnostics()', () => { const qkviewURI = 'https://ihealth-api.f5.com/qkview/myLovelyQkview'; const setupNockEndpoint = (endpointOpts) => { - testUtil.mockEndpoints([Object.assign({ - endpoint: '/qkview/myLovelyQkview/diagnostics.json', - code: 200, - method: 'get', - requestHeaders: { - Accept: 'application/vnd.f5.ihealth.api.v1.0+json', - Cookie: 'someCookie=someValue' - }, - response: { - diagnostics: 'JSON' + testUtil.mockEndpoints( + [Object.assign({ + endpoint: '/qkview/myLovelyQkview/diagnostics.json', + code: 200, + method: 'get', + requestHeaders: { + Accept: 'application/vnd.f5.ihealth.api.v1.0+json', + Cookie: 'someCookie=someValue' + }, + response: { + diagnostics: 'JSON' + } + }, endpointOpts || {})], + { + host: 'ihealth-api.f5.com', + port: 443, + proto: 'https' } - }, endpointOpts || {})], - { - host: 'ihealth-api.f5.com', - port: 443, - proto: 'https' - }); + ); }; it('should be able to fetch diagnostics JSON', () => { @@ -1283,20 +1287,22 @@ describe('iHealth Utils', () => { describe('.isQkviewReportReady()', () => { const setupNockEndpoint = (endpointOpts) => { - testUtil.mockEndpoints([Object.assign({ - endpoint: '/qkview/myLovelyQkview', - code: 200, - method: 'get', - requestHeaders: { - Accept: 'application/vnd.f5.ihealth.api.v1.0', - Cookie: 'someCookie=someValue' + testUtil.mockEndpoints( + [Object.assign({ + endpoint: '/qkview/myLovelyQkview', + code: 200, + method: 'get', + requestHeaders: { + Accept: 'application/vnd.f5.ihealth.api.v1.0', + Cookie: 'someCookie=someValue' + } + }, endpointOpts || {})], + { + host: 'ihealth-api.f5.com', + port: 443, + proto: 'https' } - }, endpointOpts || {})], - { - host: 'ihealth-api.f5.com', - port: 443, - proto: 'https' - }); + ); }; it('should return true when Qkview report is ready', () => { @@ -1322,24 +1328,26 @@ describe('iHealth Utils', () => { const createReadStreamOrigin = fs.createReadStream; const qkviewFileStreamFile = 'qkviewFileStreamFile'; const setupNockEndpoint = (endpointOpts) => { - testUtil.mockEndpoints([Object.assign({ - endpoint: '/qkview-analyzer/api/qkviews', - code: 200, - method: 'post', - requestHeaders: { - Accept: 'application/vnd.f5.ihealth.api.v1.0+json', - Cookie: 'someCookie=someValue' - }, - response: { - result: 'OK', - location: 'qkviewLocationURI' + testUtil.mockEndpoints( + [Object.assign({ + endpoint: '/qkview-analyzer/api/qkviews', + code: 200, + method: 'post', + requestHeaders: { + Accept: 'application/vnd.f5.ihealth.api.v1.0+json', + Cookie: 'someCookie=someValue' + }, + response: { + result: 'OK', + location: 'qkviewLocationURI' + } + }, endpointOpts || {})], + { + host: 'ihealth-api.f5.com', + port: 443, + proto: 'https' } - }, endpointOpts || {})], - { - host: 'ihealth-api.f5.com', - port: 443, - proto: 'https' - }); + ); }; beforeEach(() => { diff --git a/test/unit/utils/metadataTests.js b/test/unit/utils/metadataTests.js index c8d801d8..ae57b155 100644 --- a/test/unit/utils/metadataTests.js +++ b/test/unit/utils/metadataTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/miscTests.js b/test/unit/utils/miscTests.js index 55c2db39..5c94e709 100644 --- a/test/unit/utils/miscTests.js +++ b/test/unit/utils/miscTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -833,167 +833,311 @@ describe('Misc Util', () => { }); }); - describe('.maskSecrets', () => { - it('should mask secrets - cipherText (without new lines)', () => { - const decl = { - passphrase: { - cipherText: 'test_passphrase' + describe('.maskDefaultSecrets', () => { + const mask = '*********'; + const defaultData = { + someSecretData: { + cipherText: 'test_passphrase_1' + }, + someSecretData_2: { + passphrase: 'test_passphrase_2' + }, + someSecretData_3: { + nestedData: { + passphrase: { + cipherText: 'test_passphrase_3' + } } - }; - const expected = 'this contains secrets: {"passphrase":{*********}}'; - const masked = util.maskSecrets(`this contains secrets: ${JSON.stringify(decl)}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + }, + someSecretData_4: { + nestedData: { + passphrase: 'test_passphrase_4' + } + } + }; + const defaultMaskedData = { + someSecretData: { + cipherText: mask + }, + someSecretData_2: { + passphrase: mask + }, + someSecretData_3: { + nestedData: { + passphrase: { + cipherText: mask + } + } + }, + someSecretData_4: { + nestedData: { + passphrase: mask + } + } + }; + const jsonBeauty = (data) => JSON.stringify(data, null, 4); + const jsonOneLine = (data) => JSON.stringify(data); + + describe('pure JSON data', () => { + it('should mask secrets (without new lines)', () => { + const expected = `this contains secrets: ${jsonOneLine(defaultMaskedData)}`; + const masked = util.maskDefaultSecrets(`this contains secrets: ${jsonOneLine(defaultData)}`); + assert.deepStrictEqual(masked, expected, 'should mask secrets'); + assert.deepStrictEqual(util.maskDefaultSecrets(masked), expected, 'should keep message the same when secrets masked already'); + + assert.deepStrictEqual( + JSON.parse(util.maskDefaultSecrets(jsonOneLine(defaultData))), + defaultMaskedData, + 'should be able to parse JSON with masked data' + ); + }); + + it('should mask secrets (with new lines)', () => { + const expected = `this contains secrets: ${jsonBeauty(defaultMaskedData)}`; + const masked = util.maskDefaultSecrets(`this contains secrets: ${jsonBeauty(defaultData)}`); + assert.deepStrictEqual(masked, expected, 'should mask secrets'); + assert.deepStrictEqual(util.maskDefaultSecrets(masked), expected, 'should keep message the same when secrets masked already'); + + assert.deepStrictEqual( + JSON.parse(util.maskDefaultSecrets(jsonBeauty(defaultData))), + defaultMaskedData, + 'should be able to parse JSON with masked data' + ); + }); }); - it('should mask secrets - cipherText (with new lines)', () => { - const decl = { - passphrase: { - cipherText: 'test_passphrase' + describe('escaped JSON data', () => { + it('should mask secrets (with new lines, serialized multiple times)', () => { + let decl = jsonBeauty(defaultData); + let expectedMsg = jsonBeauty(jsonBeauty(defaultMaskedData)); + for (let i = 0; i < 10; i += 1) { + decl = jsonBeauty(decl); + const masked = util.maskDefaultSecrets(`this contains secrets: ${decl}`); + assert.include( + masked, + `this contains secrets: ${expectedMsg}`, + `should mask secret event after ${i + 1} serialization(s)` + ); + assert.include(util.maskDefaultSecrets(masked), expectedMsg, 'should keep message the same when secrets masked already'); + expectedMsg = jsonBeauty(expectedMsg); } - }; - const expected = 'this contains secrets: {\n "passphrase": {\n "cipherText": "*********"\n }\n}'; - const masked = util.maskSecrets(`this contains secrets: ${JSON.stringify(decl, null, 4)}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); - }); + }); - it('should mask secrets - cipherText (without quotes)', () => { - const decl = '{ passphrase:\n{\ncipherText: \'test_passphrase\'\n}\n}'; - const expected = 'this contains secrets: { passphrase:\n{\ncipherText: \'*********\'\n}\n}'; - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + it('should mask secrets(without new lines, serialized multiple times)', () => { + let decl = jsonOneLine(defaultData); + let expectedMsg = jsonOneLine(jsonOneLine(defaultMaskedData)); + for (let i = 0; i < 10; i += 1) { + decl = jsonOneLine(decl); + const masked = util.maskDefaultSecrets(`this contains secrets: ${decl}`); + assert.include( + masked, + `this contains secrets: ${expectedMsg}`, + `should mask secret event after ${i + 1} serialization(s)` + ); + assert.include(util.maskDefaultSecrets(masked), expectedMsg, 'should keep message the same when secrets masked already'); + expectedMsg = jsonOneLine(expectedMsg); + } + }); }); + }); - it('should mask secrets - cipherText (with non matching quotes)', () => { - const decl = '{ passphrase:\n{\n\'cipherText": \'test_passphrase\'\n}\n}'; - const expected = 'this contains secrets: { passphrase:\n{\n\'cipherText": \'*********\'\n}\n}'; - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + describe('.generateUniquePropName', () => { + it('should return originKey when it doesn\'t exist in the object', () => { + assert.deepStrictEqual(util.generateUniquePropName({}, 'key'), 'key', 'should return originKey'); }); - it('should mask secrets - cipherText (with new lines, serialized 2+ times)', () => { - let decl = JSON.stringify({ - passphrase: { - cipherText: 'test_passphrase' - } - }, null, 4); - let expectedMsg = '"{\\n \\"passphrase\\": {*********}\\n}"'; - for (let i = 0; i < 10; i += 1) { - decl = JSON.stringify(decl, null, 4); - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.include( - masked, - `this contains secrets: ${expectedMsg}`, - `should mask secret event after ${i + 2} serialization(s)` - ); - assert.include(util.maskSecrets(masked), expectedMsg, 'should keep message the same when secrets masked already'); - expectedMsg = JSON.stringify(expectedMsg); - } + it('should return unique key for the object', () => { + assert.deepStrictEqual(util.generateUniquePropName({ key: 1 }, 'key'), 'key0', 'should return unique key'); }); - it('should mask secrets - passphrase (without new lines)', () => { - const decl = { - passphrase: 'test_passphrase' - }; - const expected = 'this contains secrets: {"passphrase":"*********"}'; - const masked = util.maskSecrets(`this contains secrets: ${JSON.stringify(decl)}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + it('should return unique key for the object after couple attempts', () => { + assert.deepStrictEqual(util.generateUniquePropName({ + key: 1, + key0: 2, + key1: 10, + key3: 20 + }, 'key'), 'key2', 'should return unique key'); }); + }); - it('should mask secrets - passphrase (with new lines)', () => { - const decl = { - passphrase: 'test_passphrase' - }; - const expected = 'this contains secrets: {\n "passphrase": "*********"\n}'; - const masked = util.maskSecrets(`this contains secrets: ${JSON.stringify(decl, null, 4)}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + describe('.createJsonSecretsMaskFunc', () => { + const mask = '*********'; + const defaultData = { + doNotTouch: 'ok', + someSecretData: { + secretString: 'test_passphrase_1', + secretArray: ['test_passphrase_2', true, false, null, 10, -2.25, 2.25e10, -2.25e10] + }, + someSecretData_2: { + doNotTouch: 'ok', + secretString: '\\"', + secretFalse: false, + secretNumber: 10 + }, + someSecretData_3: { + nestedData: { + secretTrue: true + }, + secretNull: null, + secretNumber: -2.25e10 + }, + someSecretData_4: { + doNotTouch: 'ok', + secretNumber: -2.25 + }, + secretNumber: 2.25e10, + secretArray: [] + }; + const defaultMaskedData = { + doNotTouch: 'ok', + someSecretData: { + secretString: mask, + secretArray: mask + }, + someSecretData_2: { + doNotTouch: 'ok', + secretString: mask, + secretFalse: mask, + secretNumber: mask + }, + someSecretData_3: { + nestedData: { + secretTrue: mask + }, + secretNull: mask, + secretNumber: mask + }, + someSecretData_4: { + doNotTouch: 'ok', + secretNumber: mask + }, + secretNumber: mask, + secretArray: mask + }; + const jsonBeauty = (data) => JSON.stringify(data, null, 4); + const jsonOneLine = (data) => JSON.stringify(data); + + let maskFn; + + beforeEach(() => { + maskFn = util.createJsonSecretsMaskFunc([ + 'secretArray', + 'secretFalse', + 'secretNull', + 'secretNumber', + 'secretString', + 'secretTrue' + ]); }); - it('should mask secrets - passphrase (with non matching quotes)', () => { - const decl = '{ \'passphrase": \'test_passphrase\'}'; - const expected = 'this contains secrets: { \'passphrase": \'*********\'}'; - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + it('should do nothing when no properties provided', () => { + const emptyMaskFn = util.createJsonSecretsMaskFunc([]); + const ret = emptyMaskFn(jsonOneLine({ key: 'val' })); + assert.deepStrictEqual(maskFn.matchesFound, 0, 'should replace 0 secrets'); + assert.deepStrictEqual(ret, '{"key":"val"}', 'should do nothing'); }); - it('should mask secrets - passphrase (without quotes)', () => { - const decl = '{ passphrase: \'test_passphrase\'}'; - const expected = 'this contains secrets: { passphrase: \'*********\'}'; - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + it('should use non-default mask', () => { + const myMaskFn = util.createJsonSecretsMaskFunc(['secret'], 'test_passphrase_1'); + const ret = myMaskFn(jsonOneLine({ secret: 'val' })); + assert.deepStrictEqual(myMaskFn.matchesFound, 1, 'should replace 1 secrets'); + assert.deepStrictEqual(ret, '{"secret":"test_passphrase_1"}', 'should use non-default mask'); }); - it('should mask secrets - passphrase (with non matching quotes and without new lines)', () => { - const decl = '{ \'passphrase": { cipherText: \'test_passphrase\'}}'; - const expected = 'this contains secrets: { \'passphrase": {*********}}'; - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.deepStrictEqual(masked, expected, 'should mask secrets'); - assert.deepStrictEqual(util.maskSecrets(masked), expected, 'should keep message the same when secrets masked already'); + it('should use empty string as non-default mask', () => { + const myMaskFn = util.createJsonSecretsMaskFunc(['secret'], ''); + const ret = myMaskFn(jsonOneLine({ secret: 'val' })); + assert.deepStrictEqual(myMaskFn.matchesFound, 1, 'should replace 1 secrets'); + assert.deepStrictEqual(ret, '{"secret":""}', 'should use non-default mask'); }); - it('should mask secrets - passphrase (without new lines, serialized multiple times)', () => { - const decl = { - passphrase: 'test_passphrase' - }; - let expectedMsg = '{"passphrase":"*********"}'; - let txt = decl; + it('should be able to parse masked data after multiple serializations', () => { + let decl = defaultData; for (let i = 0; i < 10; i += 1) { - txt = JSON.stringify(txt); - const masked = util.maskSecrets(`this contains secrets: ${txt}`); - assert.include( - masked, - `this contains secrets: ${expectedMsg}`, - `should mask secret event after ${i + 1} serialization(s)` - ); - assert.include(util.maskSecrets(masked), expectedMsg, 'should keep message the same when secrets masked already'); - expectedMsg = JSON.stringify(expectedMsg); + decl = jsonOneLine(decl); } - }); + decl = maskFn(decl); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); - it('should mask secrets - cipherText (without new lines, serialized multiple times)', () => { - let decl = { - passphrase: { - cipherText: 'test_passphrase' - } - }; - let expectedMsg = '{"passphrase":{*********}}'; for (let i = 0; i < 10; i += 1) { - decl = JSON.stringify(decl); - const masked = util.maskSecrets(`this contains secrets: ${decl}`); - assert.include( - masked, - `this contains secrets: ${expectedMsg}`, - `should mask secret event after ${i + 1} serialization(s)` - ); - assert.include(util.maskSecrets(masked), expectedMsg, 'should keep message the same when secrets masked already'); - expectedMsg = JSON.stringify(expectedMsg); + decl = JSON.parse(decl); } - }); - }); - describe('.generateUniquePropName', () => { - it('should return originKey when it doesn\'t exist in the object', () => { - assert.deepStrictEqual(util.generateUniquePropName({}, 'key'), 'key', 'should return originKey'); + assert.deepStrictEqual( + JSON.parse(maskFn(jsonOneLine(defaultData))), + defaultMaskedData, + 'should be able to parse JSON with masked data' + ); }); - it('should return unique key for the object', () => { - assert.deepStrictEqual(util.generateUniquePropName({ key: 1 }, 'key'), 'key0', 'should return unique key'); + describe('pure JSON data', () => { + it('should mask secrets (without new lines)', () => { + const expected = `this contains secrets: ${jsonOneLine(defaultMaskedData)}`; + const masked = maskFn(`this contains secrets: ${jsonOneLine(defaultData)}`); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + assert.deepStrictEqual(masked, expected, 'should mask secrets'); + assert.deepStrictEqual(maskFn(masked), expected, 'should keep message the same when secrets masked already'); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + assert.deepStrictEqual( + JSON.parse(maskFn(jsonOneLine(defaultData))), + defaultMaskedData, + 'should be able to parse JSON with masked data' + ); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + }); + + it('should mask secrets (with new lines)', () => { + const expected = `this contains secrets: ${jsonBeauty(defaultMaskedData)}`; + const masked = maskFn(`this contains secrets: ${jsonBeauty(defaultData)}`); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + assert.deepStrictEqual(masked, expected, 'should mask secrets'); + assert.deepStrictEqual(maskFn(masked), expected, 'should keep message the same when secrets masked already'); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + assert.deepStrictEqual( + JSON.parse(maskFn(jsonBeauty(defaultData))), + defaultMaskedData, + 'should be able to parse JSON with masked data' + ); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + }); }); - it('should return unique key for the object after couple attempts', () => { - assert.deepStrictEqual(util.generateUniquePropName({ - key: 1, - key0: 2, - key1: 10, - key3: 20 - }, 'key'), 'key2', 'should return unique key'); + describe('escaped JSON data', () => { + it('should mask secrets (with new lines, serialized multiple times)', () => { + let decl = jsonBeauty(defaultData); + let expectedMsg = jsonBeauty(jsonBeauty(defaultMaskedData)); + for (let i = 0; i < 10; i += 1) { + decl = jsonBeauty(decl); + const masked = maskFn(`this contains secrets: ${decl}`); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + assert.include( + masked, + `this contains secrets: ${expectedMsg}`, + `should mask secret event after ${i + 1} serialization(s)` + ); + assert.include(maskFn(masked), expectedMsg, 'should keep message the same when secrets masked already'); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + expectedMsg = jsonBeauty(expectedMsg); + } + }); + + it('should mask secrets(without new lines, serialized multiple times)', () => { + let decl = jsonOneLine(defaultData); + let expectedMsg = jsonOneLine(jsonOneLine(defaultMaskedData)); + for (let i = 0; i < 10; i += 1) { + decl = jsonOneLine(decl); + const masked = maskFn(`this contains secrets: ${decl}`); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + assert.include( + masked, + `this contains secrets: ${expectedMsg}`, + `should mask secret event after ${i + 1} serialization(s)` + ); + assert.include(maskFn(masked), expectedMsg, 'should keep message the same when secrets masked already'); + assert.deepStrictEqual(maskFn.matchesFound, 11, 'should replace 11 secrets'); + expectedMsg = jsonOneLine(expectedMsg); + } + }); }); }); }); diff --git a/test/unit/utils/monitorTests.js b/test/unit/utils/monitorTests.js index dbbc19f4..be656624 100644 --- a/test/unit/utils/monitorTests.js +++ b/test/unit/utils/monitorTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/normalizeTests.js b/test/unit/utils/normalizeTests.js index 2b0d1f18..8d39c43c 100644 --- a/test/unit/utils/normalizeTests.js +++ b/test/unit/utils/normalizeTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -671,6 +671,243 @@ describe('Normalize Util', () => { }); }); + describe('.addFqdnToLtmPool()', () => { + it('should add \'fqdn\' when pool member is fqdn node, and not add \'fqdn\' when not fqdn node', () => { + const args = { + data: { + kind: 'tm:ltm:pool:poolstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0?ver=14.1.0', + name: 'test_pool_0', + membersReference: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2', + entries: { + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats?ver=14.1.0', + entries: {} + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80/stats?ver=14.1.0', + entries: {} + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80/stats?ver=14.1.0', + entries: {} + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80/stats?ver=14.1.0', + entries: {} + } + } + }, + items: [ + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'disabled' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'disabled' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'enabled', + tmName: 'www.thebestwebsite.com' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'enabled', + tmName: 'www.thebestwebsite.com' + } + } + ] + } + } + }; + const expected = { + kind: 'tm:ltm:pool:poolstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0?ver=14.1.0', + name: 'test_pool_0', + membersReference: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2', + entries: { + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats?ver=14.1.0', + entries: {} + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80/stats?ver=14.1.0', + entries: {} + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80/stats?ver=14.1.0', + entries: { + fqdn: 'www.thebestwebsite.com' + } + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80/stats?ver=14.1.0', + entries: { + fqdn: 'www.thebestwebsite.com' + } + } + } + }, + items: [ + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'disabled' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'disabled' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~_auto_192.0.2.2:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'enabled', + tmName: 'www.thebestwebsite.com' + } + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~bestwebsite:80?ver=14.1.4.2', + fqdn: { + autopopulate: 'enabled', + tmName: 'www.thebestwebsite.com' + } + } + ] + } + }; + assert.deepStrictEqual(normalizeUtil.addFqdnToLtmPool(args), expected, 'should add fqdn property when pool member is fqdn node'); + }); + + it('should not fail when no fqdn property', () => { + const args = { + data: { + kind: 'tm:ltm:pool:poolstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0?ver=14.1.0', + name: 'test_pool_0', + membersReference: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2', + entries: { + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats?ver=14.1.0', + entries: {} + } + }, + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80/stats?ver=14.1.0', + entries: {} + } + } + }, + items: [ + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80?ver=14.1.4.2' + }, + { + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2%2510:80?ver=14.1.4.2' + } + ] + } + } + }; + assert.doesNotThrow(() => { normalizeUtil.addFqdnToLtmPool(args); }, 'should not throw if no fqdn property in iControlRest'); + }); + + it('should not fail when no pool members', () => { + const args = { + data: { + kind: 'tm:ltm:pool:poolstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0?ver=14.1.0', + name: 'test_pool_0', + membersReference: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2', + items: [] + } + } + }; + const expected = { + kind: 'tm:ltm:pool:poolstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0?ver=14.1.0', + name: 'test_pool_0', + membersReference: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2' + } + }; + assert.deepStrictEqual(normalizeUtil.addFqdnToLtmPool(args), expected, 'should add fqdn property when pool member is fqdn node'); + }); + + it('should not fail when no pool member config data', () => { + const args = { + data: { + kind: 'tm:ltm:pool:poolstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0?ver=14.1.0', + name: 'test_pool_0', + membersReference: { + kind: 'tm:ltm:pool:members:memberscollectionstate', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members?$select=fqdn%2CselfLink&ver=14.1.4.2', + entries: { + 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats': { + nestedStats: { + kind: 'tm:ltm:pool:members:membersstats', + selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~test_pool_0/members/~Common~10.10.0.2:80/stats?ver=14.1.0', + entries: {} + } + } + }, + items: [] + } + } + }; + // Shouldn't need to modify data at all + const expected = util.deepCopy(args.data); + assert.deepStrictEqual(normalizeUtil.addFqdnToLtmPool(args), expected, 'should still succeed if not able to get pool member config data'); + }); + }); + describe('.normalizeMACAddress()', () => { it('should normalize mac address (string)', () => { const inputOutputMap = { diff --git a/test/unit/utils/promiseTests.js b/test/unit/utils/promiseTests.js index b5fa07db..15f30c51 100644 --- a/test/unit/utils/promiseTests.js +++ b/test/unit/utils/promiseTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -210,8 +210,10 @@ describe('Promise Util', () => { for (let i = 1; i < timestamps.length; i += 1) { const actualDelay = timestamps[i] - timestamps[i - 1]; // sometimes it is less than expected - assert.ok(actualDelay >= delay * 0.9, - `Actual delay (${actualDelay}) is less than expected (${delay})`); + assert.ok( + actualDelay >= delay * 0.9, + `Actual delay (${actualDelay}) is less than expected (${delay})` + ); } }); }).timeout(2000); @@ -241,8 +243,10 @@ describe('Promise Util', () => { /* eslint-disable no-restricted-properties */ expectedDelay += backoff * Math.pow(2, i - 1); } - assert.ok(actualDelay >= expectedDelay * 0.9, - `Actual delay (${actualDelay}) is less than expected (${expectedDelay})`); + assert.ok( + actualDelay >= expectedDelay * 0.9, + `Actual delay (${actualDelay}) is less than expected (${expectedDelay})` + ); } }); }).timeout(10000); diff --git a/test/unit/utils/requestsTests.js b/test/unit/utils/requestsTests.js index f63dc3fa..c19b2ba6 100644 --- a/test/unit/utils/requestsTests.js +++ b/test/unit/utils/requestsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/systemStatsTests.js b/test/unit/utils/systemStatsTests.js index 6a5d954c..b58631fe 100644 --- a/test/unit/utils/systemStatsTests.js +++ b/test/unit/utils/systemStatsTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ('EULA') for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ('EULA') for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/test/unit/utils/timersTests.js b/test/unit/utils/timersTests.js index a6aa888d..a293bc56 100644 --- a/test/unit/utils/timersTests.js +++ b/test/unit/utils/timersTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -224,7 +224,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.start().catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 10 }); @@ -251,7 +252,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.start().catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -275,7 +277,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.start(targetFunc, 3).catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -322,7 +325,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.start(targetFunc).catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -368,7 +372,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ) .catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -393,7 +398,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.start( targetFunc, @@ -421,7 +427,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.start( targetFunc, @@ -620,7 +627,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.update().catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 10 }); @@ -647,7 +655,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.update().catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -671,7 +680,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.update(targetFunc, 3).catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -718,7 +728,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.update(targetFunc).catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -764,7 +775,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ) .catch(reject); fakeClock.clockForward(1000, { promisify: true, repeat: 3 }); @@ -789,7 +801,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.update( targetFunc, @@ -817,7 +830,8 @@ describe('Timer Tests', () => { intervalInS: 2, logger: btLogger }, - 'arg1', 'arg2' + 'arg1', + 'arg2' ); timerInst.update( targetFunc, @@ -1063,7 +1077,7 @@ describe('Timer Tests', () => { timestamps.push(Date.now()); if (callCount < 4) { callCount += 1; - return new Promise((innerResolve) => setTimeout(innerResolve, 1100 + callCount * 100)); + return new Promise((innerResolve) => { setTimeout(innerResolve, 1100 + callCount * 100); }); } return timerInst.stop().then(resolve, reject); }, 1); @@ -1258,7 +1272,9 @@ describe('Timer Tests', () => { timestamps.push(Date.now()); if (callCount < 4) { callCount += 1; - return new Promise((innerResolve) => setTimeout(innerResolve, 1100 + callCount * 100)); + return new Promise((innerResolve) => { + setTimeout(innerResolve, 1100 + callCount * 100); + }); } return timers.clearSlidingInterval(intervalID, resolve); }, @@ -1312,9 +1328,12 @@ describe('Timer Tests', () => { }, { interval: 1000, - onError: () => new Promise((innerResolve) => setTimeout( - innerResolve, 1100 + callCount * 100 - )), + onError: () => new Promise((innerResolve) => { + setTimeout( + innerResolve, + 1100 + callCount * 100 + ); + }), onIntervalSlide: (duration, interval) => { durations.push([duration, interval]); } @@ -1368,7 +1387,7 @@ describe('Timer Tests', () => { intervalID = timers.setSlidingInterval(spy, 30); fakeClock.clockForward(1, { promisify: true }); return testUtil.sleep(5) - .then(() => new Promise((resolve) => timers.clearSlidingInterval(intervalID, resolve))) + .then(() => new Promise((resolve) => { timers.clearSlidingInterval(intervalID, resolve); })) .then(() => testUtil.sleep(30)) .then(() => { assert.strictEqual(spy.callCount, 0, 'should not call function once canceled'); diff --git a/test/unit/utils/tracerTests.js b/test/unit/utils/tracerTests.js index 3bf965fa..48b41b94 100644 --- a/test/unit/utils/tracerTests.js +++ b/test/unit/utils/tracerTests.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of @@ -533,13 +533,16 @@ describe('Tracer', () => { }); it('should mask secrets', () => { + const mask = '*********'; const data = { - text: 'passphrase: { cipherText: \'test_passphrase\' }\n' - + '"passphrase": {\ncipherText: "test_passphrase"\n}' - + '\'passphrase": "test_passphrase"', - passphrase: 'test_passphrase', + text: JSON.stringify({ + cipherText: 'test_passphrase_1', + passphrase: 'test_passphrase_2', + passphrase1: { cipherText: 'test_passphrase_3' } + }), + passphrase: 'test_passphrase_4', passphrase2: { - cipherText: 'test_passphrase' + cipherText: 'test_passphrase_5' } }; return tracerInst.write(data) @@ -548,13 +551,14 @@ describe('Tracer', () => { assert.deepStrictEqual( traceData, addTimestamps([{ - passphrase: '*********', + passphrase: mask, passphrase2: { - cipherText: '*********' + cipherText: mask }, - text: 'passphrase: {*********}\n' - + '"passphrase": {*********}' - + '\'passphrase": "*********"' + text: `{"cipherText":"${mask}",` + + `"passphrase":"${mask}",` + + `"passphrase1":{"cipherText":"${mask}"}` + + '}' }]) ); return tracerInst.write(traceData[0].data); @@ -563,23 +567,25 @@ describe('Tracer', () => { assert.deepStrictEqual( readTraceFile(tracerFile), addTimestamps([{ - passphrase: '*********', + passphrase: mask, passphrase2: { - cipherText: '*********' + cipherText: mask }, - text: 'passphrase: {*********}\n' - + '"passphrase": {*********}' - + '\'passphrase": "*********"' + text: `{"cipherText":"${mask}",` + + `"passphrase":"${mask}",` + + `"passphrase1":{"cipherText":"${mask}"}` + + '}' }, { - passphrase: '*********', + passphrase: mask, passphrase2: { - cipherText: '*********' + cipherText: mask }, - text: 'passphrase: {*********}\n' - + '"passphrase": {*********}' - + '\'passphrase": "*********"' - }], 'should modify message when secrets masked already') + text: `{"cipherText":"${mask}",` + + `"passphrase":"${mask}",` + + `"passphrase1":{"cipherText":"${mask}"}` + + '}' + }], 'should not modify message when secrets masked already') ); return tracerInst.write(data[0]); }); diff --git a/test/winstonLogger.js b/test/winstonLogger.js index 08ce142b..d43cb357 100644 --- a/test/winstonLogger.js +++ b/test/winstonLogger.js @@ -1,5 +1,5 @@ /* - * Copyright 2021. F5 Networks, Inc. See End User License Agreement ("EULA") for + * Copyright 2022. F5 Networks, Inc. See End User License Agreement ("EULA") for * license terms. Notwithstanding anything to the contrary in the EULA, Licensee * may copy and modify this software product for its internal business purposes. * Further, Licensee may upload, publish and distribute the modified version of diff --git a/versions.json b/versions.json index 7b59d4ef..93e5e07d 100644 --- a/versions.json +++ b/versions.json @@ -1,7 +1,7 @@ { "versionMetaTimestamp": 1540928503, "latestVersion": { - "name": "1.25 (non-LTS)", + "name": "1.26 (non-LTS)", "url": "/products/extensions/f5-telemetry-streaming/latest/" }, "otherVersions": [