From 1838366d51a172b0240a5e23c5d691b544a7a6be Mon Sep 17 00:00:00 2001 From: Dhrumin Desai Date: Mon, 9 Aug 2021 16:52:04 -0400 Subject: Helm-generator - seedcode delivery for helm chart generation tool from component spec Issue-ID: DCAEGEN2-2694 Change-Id: I3e317e312f90b061c0cdff155b8673967aea414b Signed-off-by: Dhrumin Desai --- .../HelmChartGeneratorApplication.java | 97 ++ .../src/main/resources/Usage.txt | 32 + .../blueprint/addons/templates/certificates.yaml | 21 + .../src/test/input/blueprint/base/Chart.yaml | 39 + .../input/blueprint/base/templates/configmap.yaml | 19 + .../input/blueprint/base/templates/deployment.yaml | 18 + .../input/blueprint/base/templates/secret.yaml | 19 + .../input/blueprint/base/templates/service.yaml | 19 + .../src/test/input/blueprint/base/values.yaml | 96 ++ .../src/test/input/specs/invalidSpecNoHelm.json | 419 +++++++ .../test/input/specs/invalidSpecNoServices.json | 432 ++++++++ .../src/test/input/specs/invalidSpecSchema.json | 382 +++++++ .../input/specs/schemas/component-spec-schema.json | 1158 ++++++++++++++++++++ .../src/test/input/specs/ves.json | 455 ++++++++ .../src/test/input/specs/vesWithDb.json | 452 ++++++++ .../specs/vescollector-componentspec-v3-helm.json | 475 ++++++++ .../HelmChartGeneratorApplicationTests.java | 36 + 17 files changed, 4169 insertions(+) create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/HelmChartGeneratorApplication.java create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/main/resources/Usage.txt create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/addons/templates/certificates.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/Chart.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/configmap.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/deployment.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/secret.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/service.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/invalidSpecNoHelm.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/invalidSpecNoServices.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/invalidSpecSchema.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/schemas/component-spec-schema.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/ves.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/vesWithDb.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/vescollector-componentspec-v3-helm.json create mode 100644 mod2/helm-generator/helmchartgenerator-cli/src/test/java/org/onap/dcaegen2/platform/helmchartgenerator/HelmChartGeneratorApplicationTests.java (limited to 'mod2/helm-generator/helmchartgenerator-cli/src') diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/HelmChartGeneratorApplication.java b/mod2/helm-generator/helmchartgenerator-cli/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/HelmChartGeneratorApplication.java new file mode 100644 index 0000000..617947f --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/HelmChartGeneratorApplication.java @@ -0,0 +1,97 @@ +/* + * # ============LICENSE_START======================================================= + * # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + * # ================================================================================ + * # Licensed under the Apache License, Version 2.0 (the "License"); + * # you may not use this file except in compliance with the License. + * # You may obtain a copy of the License at + * # + * # http://www.apache.org/licenses/LICENSE-2.0 + * # + * # Unless required by applicable law or agreed to in writing, software + * # distributed under the License is distributed on an "AS IS" BASIS, + * # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * # See the License for the specific language governing permissions and + * # limitations under the License. + * # ============LICENSE_END========================================================= + */ + +package org.onap.dcaegen2.platform.helmchartgenerator; + +import lombok.extern.slf4j.Slf4j; +import org.onap.dcaegen2.platform.helmchartgenerator.chartbuilder.ChartBuilder; +import org.onap.dcaegen2.platform.helmchartgenerator.distribution.ChartDistributor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.core.io.ClassPathResource; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Main class to run the application. + * @author Dhrumin Desai + */ +@SpringBootApplication +@Slf4j +public class HelmChartGeneratorApplication implements CommandLineRunner { + + @Autowired + private final ChartBuilder builder; + + @Autowired + private final ChartDistributor distributor; + + public HelmChartGeneratorApplication(ChartBuilder builder, ChartDistributor distributor) { + this.builder = builder; + this.distributor = distributor; + } + + public static void main(String[] args) { + SpringApplication.run(HelmChartGeneratorApplication.class, args); + } + + @Override + public void run(String... args) throws Exception { + List argList = new ArrayList<>(Arrays.asList(args)); + boolean isDistribute = false; + if(argList.contains("--help") || argList.size() < 3){ + printUsage(); + return; + } + if(argList.contains("--distribute")){ + isDistribute = true; + argList.remove("--distribute"); + } + + log.info("STARTED HELM GENERATION:"); + final File chartPackage = builder.build(argList.get(0), argList.get(1), argList.get(2), + getSpecSchemaLocation(argList)); + if(isDistribute) { + log.info("Distributing.."); + distributor.distribute(chartPackage); + } + } + + private String getSpecSchemaLocation(List argList) { + String specSchemaLocation; + try { + specSchemaLocation = argList.get(3); + } + catch (Exception e) { + specSchemaLocation = ""; + } + return specSchemaLocation; + } + + private void printUsage() throws IOException { + InputStream inputStream = new ClassPathResource("Usage.txt").getInputStream(); + log.info(new String(inputStream.readAllBytes())); + } +} diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/main/resources/Usage.txt b/mod2/helm-generator/helmchartgenerator-cli/src/main/resources/Usage.txt new file mode 100644 index 0000000..7aaec03 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/main/resources/Usage.txt @@ -0,0 +1,32 @@ + +Helm Chart Generator: + +- generate a helm chart from the base helm template and parsed component spec file. +- distribute a helm chart to Chartmuseum + +Environment variables: + +| Name | Description | +|------------------------------------|-----------------------------------------------------------------------------------| +| $CHARTMUSEUM_BASEURL | set a Chartmuseum base url for chart distribution. | +| $CHARTMUSEUM_AUTH_BASIC_USERNAME | set a Chartmuseum username for the basic auth. | +| $CHARTMUSEUM_AUTH_BASIC_PASSWORD | set a Chartmuseum password for the basic auth. | + +Requirements: + +- Helm Chart Generator uses 'helm' command installed on the host machine, so 'helm' command must be installed. +- For the distribution, $CHARTMUSEUM_BASEURL, $CHARTMUSEUM_AUTH_BASIC_USERNAME and $CHARTMUSEUM_AUTH_BASIC_PASSWORD + must be set. + +Usage: + helmchartgenerator-.jar (with JAR) + OR + HelmChartGeneratorApplication.java (with the main class) + + - Arguments must be passed in the numeric order mentioned below. +Arguments: + 1. Spec file location (Required) + 2. Chart directory location (helm template location) (Required) + 3. Output directory location (Required) + 4. Component spec schema (Optional) (Note: Default componentSpec schema will be used if not passed.) + 5. --distribute flag (Optional) diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/addons/templates/certificates.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/addons/templates/certificates.yaml new file mode 100644 index 0000000..a871343 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/addons/templates/certificates.yaml @@ -0,0 +1,21 @@ +{{/* + # ============LICENSE_START======================================================= + # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + # ================================================================================ + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # ============LICENSE_END========================================================= +*/}} + +{{ if and .Values.certDirectory .Values.global.cmpv2Enabled .Values.global.CMPv2CertManagerIntegration }} +{{ include "certManagerCertificate.certificate" . }} +{{ end }} diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/Chart.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/Chart.yaml new file mode 100644 index 0000000..239978f --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/Chart.yaml @@ -0,0 +1,39 @@ +# ============LICENSE_START======================================================= +# Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= + +apiVersion: v2 +appVersion: "Honolulu" +description: TBD +name: TBD +version: TBD + +dependencies: + - name: common + version: ~8.x-0 + repository: '@local' + - name: repositoryGenerator + version: ~8.x-0 + repository: '@local' + - name: readinessCheck + version: ~8.x-0 + repository: '@local' + - name: dcaegen2-services-common + version: ~8.x-0 + repository: '@local' + - name: postgres + version: ~8.x-0 + repository: '@local' + condition: postgres.enabled diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/configmap.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/configmap.yaml new file mode 100644 index 0000000..eaa7f34 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/configmap.yaml @@ -0,0 +1,19 @@ +{{/* + # ============LICENSE_START======================================================= + # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + # ================================================================================ + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # ============LICENSE_END========================================================= +*/}} + +{{ include "dcaegen2-services-common.configMap" . }} diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/deployment.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/deployment.yaml new file mode 100644 index 0000000..6d554d3 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/deployment.yaml @@ -0,0 +1,18 @@ +{{/* + # ============LICENSE_START======================================================= + # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + # ================================================================================ + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # ============LICENSE_END========================================================= +*/}} +{{ include "dcaegen2-services-common.microserviceDeployment" . }} \ No newline at end of file diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/secret.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/secret.yaml new file mode 100644 index 0000000..2162630 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/secret.yaml @@ -0,0 +1,19 @@ +{{/* + # ============LICENSE_START======================================================= + # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + # ================================================================================ + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # ============LICENSE_END========================================================= +*/}} + +{{ include "common.secretFast" . }} diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/service.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/service.yaml new file mode 100644 index 0000000..115398a --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/templates/service.yaml @@ -0,0 +1,19 @@ +{{/* + # ============LICENSE_START======================================================= + # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + # ================================================================================ + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # ============LICENSE_END========================================================= +*/}} + +{{ include "common.service" . }} diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml new file mode 100644 index 0000000..e83afd3 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml @@ -0,0 +1,96 @@ +# ============LICENSE_START======================================================= +# Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + nodePortPrefixExt: 304 + +################################################################# +# Filebeat configuration defaults. +################################################################# +filebeatConfig: + logstashServiceName: log-ls + logstashPort: 5044 + +################################################################# +# initContainer images. +################################################################# +tlsImage: onap/org.onap.dcaegen2.deployments.tls-init-container:2.1.0 +consulLoaderImage: onap/org.onap.dcaegen2.deployments.consul-loader-container:1.1.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +image: TBD #DONE +pullPolicy: Always + +#policy sync image +dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1 + +#postgres enable/disable +postgres: + enabled: false + +# log directory where logging sidecar should look for log files +# if absent, no sidecar will be deployed +#logDirectory: TBD #/opt/app/VESCollector/logs #DONE + +# directory where TLS certs should be stored +# if absent, no certs will be retrieved and stored +#certDirectory: TBD #/opt/app/dcae-certificate #DONE + +# TLS role -- set to true if microservice acts as server +# If true, an init container will retrieve a server cert +# and key from AAF and mount them in certDirectory. +#tlsServer: TBD #DONE + +# dependencies +readinessCheck: + wait_for: + - dcae-config-binding-service + - aaf-cm + +# probe configuration #NEED DISCUSSION +readiness: + initialDelaySeconds: TBD + periodSeconds: TBD + path: TBD + scheme: TBD + port: TBD + +# Resource Limit flavor -By Default using small +flavor: small +# Segregation for Different environment (Small and Large) +resources: + small: + limits: + cpu: 2 + memory: 2Gi + requests: + cpu: 1 + memory: 1Gi + large: + limits: + cpu: 4 + memory: 4Gi + requests: + cpu: 2 + memory: 2Gi + unlimited: {} diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/invalidSpecNoHelm.json b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/invalidSpecNoHelm.json new file mode 100644 index 0000000..f5e27f6 --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/invalidSpecNoHelm.json @@ -0,0 +1,419 @@ +{ + "self": { + "version": "1.8.0", + "name": "dcae-ves-collector", + "description": "Collector for receiving VES events through restful interface", + "component_type": "docker" + }, + "streams": { + "subscribes": [], + "publishes": [ + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-fault" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-measurement" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-syslog" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-heartbeat" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-other" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-mobileflow" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-statechange" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-thresholdCrossingAlert" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-voicequality" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-sipsignaling" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-pnfRegistration" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-notification" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-perf3gpp" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-fault-supervision" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-provisioning" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-heartbeat" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-performance-assurance" + } + ] + }, + "services": { + "calls": [], + "provides": [ + { + "route": "/eventListener/v1", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v2", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v3", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v4", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v5", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "5.28.4" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v7", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "7.30.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + } + ] + }, + "parameters": [ + { + "name": "streams_publishes", + "value": { + "ves-fault": { + "dmaap_info": { + "topic_url": "http://message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + }, + "type": "message_router" + } + }, + "description": "standard http port collector will open for listening;", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + } + , + { + "name": "collector.service.port", + "value": 8080, + "description": "standard http port collector will open for listening;", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.service.secure.port", + "value": 8443, + "description": "secure http port collector will open for listening ", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": true + }, + { + "name": "collector.keystore.file.location", + "value": "/opt/app/dcae-certificate/cert.jks", + "description": "fs location of keystore file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.keystore.passwordfile", + "value": "/opt/app/dcae-certificate/jks.pass", + "description": "location of keystore password file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.truststore.file.location", + "value": "/opt/app/dcae-certificate/trust.jks", + "description": "fs location of truststore file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.truststore.passwordfile", + "value": "/opt/app/dcae-certificate/trust.pass", + "description": "location of truststore password file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.dmaap.streamid", + "value": "fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance", + "description": "domain-to-streamid mapping used by VESCollector to distributes events based on domain. Both primary and secondary config_key are included for resilency (multiple streamid can be included commma separated). The streamids MUST match to topic config_keys. For single site without resiliency deployment - configkeys with -secondary suffix can be removed", + "sourced_at_deployment": true, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "auth.method", + "value": "noAuth", + "description": "Property to manage application mode, possible configurations: noAuth - default option - no security (http) , certOnly - auth by certificate (https), basicAuth - auth by basic auth username and password (https),certBasicAuth - auth by certificate and basic auth username / password (https),", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "header.authlist", + "value": "sample1,$2a$10$pgjaxDzSuc6XVFEeqvxQ5u90DKJnM/u7TJTcinAlFJVaavXMWf/Zi|userid1,$2a$10$61gNubgJJl9lh3nvQvY9X.x4e5ETWJJ7ao7ZhJEvmfJigov26Z6uq|userid2,$2a$10$G52y/3uhuhWAMy.bx9Se8uzWinmbJa.dlm1LW6bYPdPkkywLDPLiy", + "description": "List of id and base 64 encoded password.For each onboarding VNF - unique userid and password should be assigned and communicated to VNF owner. Password value should be base64 encoded in config here", + "policy_editable": false, + "sourced_at_deployment": true, + "designer_editable": true + }, + { + "name": "collector.schema.checkflag", + "value": 1, + "description": "Schema check validation flag. When enabled, collector will validate input VES events against VES Schema defined on collector.schema.file ", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.schema.file", + "value": "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2.1_ONAP.json\"}", + "description": "VES schema file name per version used for validation", + "designer_editable": true, + "sourced_at_deployment": false, + "policy_editable": false + }, + { + "name": "event.transform.flag", + "value": 1, + "description": "flag to enable tranformation rules defined under eventTransform.json; this is applicable when event tranformation rules preset should be activated for transforming ’) the value declared.", + "type": "number" + }, + "greater_or_equal": { + "description": "Constrains a property or parameter to a value greater than or equal to (‘>=’) the value declared.", + "type": "number" + }, + "less_than": { + "description": "Constrains a property or parameter to a value less than (‘<’) the value declared.", + "type": "number" + }, + "less_or_equal": { + "description": "Constrains a property or parameter to a value less than or equal to (‘<=’) the value declared.", + "type": "number" + }, + "valid_values": { + "description": "Constrains a property or parameter to a value that is in the list of declared values.", + "type": "array" + }, + "length": { + "description": "Constrains the property or parameter to a value of a given length.", + "type": "number" + }, + "min_length": { + "description": "Constrains the property or parameter to a value to a minimum length.", + "type": "number" + }, + "max_length": { + "description": "Constrains the property or parameter to a value to a maximum length.", + "type": "number" + } + } + }, + "stream_message_router": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "config_key": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "message router", + "message_router" + ] + } + }, + "required": [ + "format", + "version", + "config_key", + "type" + ] + }, + "stream_kafka": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "config_key": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "kafka" + ] + } + }, + "required": [ + "format", + "version", + "config_key", + "type" + ] + }, + "publisher_http": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "config_key": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "http", + "https" + ] + } + }, + "required": [ + "format", + "version", + "config_key", + "type" + ] + }, + "publisher_message_router": { + "$ref": "#/definitions/stream_message_router" + }, + "publisher_data_router": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "config_key": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "data router", + "data_router" + ] + } + }, + "required": [ + "format", + "version", + "config_key", + "type" + ] + }, + "publisher_kafka": { + "$ref": "#/definitions/stream_kafka" + }, + "subscriber_http": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "route": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "http", + "https" + ] + } + }, + "required": [ + "format", + "version", + "route", + "type" + ] + }, + "subscriber_message_router": { + "$ref": "#/definitions/stream_message_router" + }, + "subscriber_data_router": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + }, + "route": { + "type": "string" + }, + "type": { + "description": "Type of stream to be used", + "type": "string", + "enum": [ + "data router", + "data_router" + ] + }, + "config_key": { + "description": "Data router subscribers require config info to setup their endpoints to handle requests. For example, needs username and password", + "type": "string" + } + }, + "required": [ + "format", + "version", + "route", + "type", + "config_key" + ] + }, + "subscriber_kafka": { + "$ref": "#/definitions/stream_kafka" + }, + "provider": { + "oneOf": [ + { + "$ref": "#/definitions/docker-provider" + }, + { + "$ref": "#/definitions/cdap-provider" + } + ] + }, + "cdap-provider": { + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/formatPair" + }, + "response": { + "$ref": "#/definitions/formatPair" + }, + "service_name": { + "type": "string" + }, + "service_endpoint": { + "type": "string" + }, + "verb": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "DELETE" + ] + } + }, + "required": [ + "request", + "response", + "service_name", + "service_endpoint", + "verb" + ] + }, + "docker-provider": { + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/formatPair" + }, + "response": { + "$ref": "#/definitions/formatPair" + }, + "route": { + "type": "string" + }, + "verb": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "DELETE" + ] + } + }, + "required": [ + "request", + "response", + "route" + ] + }, + "caller": { + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/formatPair" + }, + "response": { + "$ref": "#/definitions/formatPair" + }, + "config_key": { + "type": "string" + } + }, + "required": [ + "request", + "response", + "config_key" + ] + }, + "formatPair": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/name" + }, + "version": { + "$ref": "#/definitions/version" + } + } + }, + "name": { + "type": "string" + }, + "version": { + "type": "string", + "pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$" + }, + "artifact": { + "type": "object", + "description": "Component artifact object", + "properties": { + "uri": { + "type": "string", + "description": "Uri to artifact" + }, + "type": { + "type": "string", + "enum": [ + "jar", + "docker image" + ] + } + }, + "required": [ + "uri", + "type" + ] + }, + "auxilary_cdap": { + "title": "cdap component specification schema", + "type": "object", + "properties": { + "streamname": { + "type": "string" + }, + "artifact_name": { + "type": "string" + }, + "artifact_version": { + "type": "string", + "pattern": "^(\\d+\\.)(\\d+\\.)(\\*|\\d+)$" + }, + "namespace": { + "type": "string", + "description": "optional" + }, + "programs": { + "type": "array", + "uniqueItems": true, + "items": { + "$ref": "#/definitions/cdap_program" + } + } + }, + "required": [ + "streamname", + "programs", + "artifact_name", + "artifact_version" + ] + }, + "cdap_program_type": { + "type": "string", + "enum": [ + "flows", + "mapreduce", + "schedules", + "spark", + "workflows", + "workers", + "services" + ] + }, + "cdap_program": { + "type": "object", + "properties": { + "program_type": { + "$ref": "#/definitions/cdap_program_type" + }, + "program_id": { + "type": "string" + } + }, + "required": [ + "program_type", + "program_id" + ] + }, + "auxilary_docker": { + "title": "Docker component specification schema", + "type": "object", + "properties": { + "helm": { + "type": "object", + "properties": { + "applicationEnv": { + "type": "object" + }, + "service": { + "description": "Mapping for kubernetes services", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "NodePort", + "Cluster" + ] + }, + "name": { + "type": "string" + }, + "ports": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "type", + "name", + "ports" + ] + } + }, + "required": [ + "service" + ] + }, + "healthcheck": { + "description": "Define the health check that Consul should perfom for this component", + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/docker_healthcheck_http" + }, + { + "$ref": "#/definitions/docker_healthcheck_script" + } + ] + }, + "ports": { + "description": "Port mapping to be used for Docker containers. Each entry is of the format :.", + "type": "array", + "items": { + "type": "string" + } + }, + "log_info": { + "description": "Component specific details for logging", + "type": "object", + "properties": { + "log_directory": { + "description": "The path in the container where the component writes its logs. If the component is following the EELF requirements, this would be the directory where the four EELF files are being written. (Other logs can be placed in the directory--if their names in '.log', they'll also be sent into ELK.)", + "type": "string" + }, + "alternate_fb_path": { + "description": "By default, the log volume is mounted at /var/log/onap/ in the sidecar container's file system. 'alternate_fb_path' allows overriding the default. Will affect how the log data can be found in the ELK system.", + "type": "string" + } + }, + "additionalProperties": false + }, + "tls_info": { + "description": "Component information to use tls certificates", + "type": "object", + "properties": { + "cert_directory": { + "description": "The path in the container where the component certificates will be placed by the init container", + "type": "string" + }, + "use_tls": { + "description": "Boolean flag to determine if the application is using tls certificates", + "type": "boolean" + }, + "use_external_tls": { + "description": "Boolean flag to determine if the application is using tls certificates for external communication", + "type": "boolean" + } + }, + "required": [ + "cert_directory", + "use_tls" + ], + "additionalProperties": false + }, + "databases": { + "description": "The databases the application is connecting to using the pgaas", + "type": "object", + "additionalProperties": { + "type": "string", + "enum": [ + "postgres" + ] + } + }, + "policy": { + "properties": { + "trigger_type": { + "description": "Only value of docker is supported at this time.", + "type": "string", + "enum": [ + "docker" + ] + }, + "script_path": { + "description": "Script command that will be executed for policy reconfiguration", + "type": "string" + } + }, + "required": [ + "trigger_type", + "script_path" + ], + "additionalProperties": false + }, + "volumes": { + "description": "Volume mapping to be used for Docker containers. Each entry is of the format below", + "type": "array", + "items": { + "type": "object", + "oneOf": [ + { + "$ref": "#/definitions/host_path_volume" + }, + { + "$ref": "#/definitions/config_map_volume" + } + ] + } + } + }, + "required": [ + "healthcheck" + ], + "additionalProperties": false + }, + "host_path_volume": { + "type": "object", + "properties": { + "host": { + "type": "object", + "path": { + "type": "string" + } + }, + "container": { + "type": "object", + "bind": { + "type": "string" + }, + "mode": { + "type": "string" + } + } + }, + "required": [ + "host", + "container" + ] + }, + "config_map_volume": { + "type": "object", + "properties": { + "config_volume": { + "type": "object", + "name": { + "type": "string" + } + }, + "container": { + "type": "object", + "bind": { + "type": "string" + }, + "mode": { + "type": "string" + } + } + }, + "required": [ + "config_volume", + "container" + ] + }, + "docker_healthcheck_http": { + "properties": { + "type": { + "description": "Consul health check type", + "type": "string", + "enum": [ + "http", + "https", + "HTTP", + "HTTPS" + ] + }, + "interval": { + "description": "Interval duration in seconds i.e. 10s", + "default": "15s", + "type": "string" + }, + "timeout": { + "description": "Timeout in seconds i.e. 10s", + "default": "1s", + "type": "string" + }, + "endpoint": { + "description": "Relative endpoint used by Consul to check health by making periodic HTTP GET calls", + "type": "string" + }, + "port": { + "description": "Port mapping for readiness section", + "type": "integer" + }, + "initialDelaySeconds": { + "description": "Initial delay in seconds for readiness section", + "type": "integer" + } + }, + "required": [ + "type", + "endpoint" + ] + }, + "docker_healthcheck_script": { + "properties": { + "type": { + "description": "Consul health check type", + "type": "string", + "enum": [ + "script", + "docker" + ] + }, + "interval": { + "description": "Interval duration in seconds i.e. 10s", + "default": "15s", + "type": "string" + }, + "timeout": { + "description": "Timeout in seconds i.e. 10s", + "default": "1s", + "type": "string" + }, + "script": { + "description": "Script command that will be executed by Consul to check health", + "type": "string" + } + }, + "required": [ + "type", + "script" + ] + } + } +} \ No newline at end of file diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/ves.json b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/ves.json new file mode 100644 index 0000000..3829a1a --- /dev/null +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/specs/ves.json @@ -0,0 +1,455 @@ +{ + "self": { + "version": "1.8.0", + "name": "dcae-ves-collector", + "description": "Collector for receiving VES events through restful interface", + "component_type": "docker" + }, + "streams": { + "subscribes": [], + "publishes": [ + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-fault" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-measurement" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-syslog" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-heartbeat" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-other" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-mobileflow" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-statechange" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-thresholdCrossingAlert" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-voicequality" + }, + { + "format": "VES_specification", + "version": "5.28.4", + "type": "message router", + "config_key": "ves-sipsignaling" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-pnfRegistration" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-notification" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-perf3gpp" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-fault-supervision" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-provisioning" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-heartbeat" + }, + { + "format": "VES_specification", + "version": "7.30.2", + "type": "message router", + "config_key": "ves-3gpp-performance-assurance" + } + ] + }, + "services": { + "calls": [], + "provides": [ + { + "route": "/eventListener/v1", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v2", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v3", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v4", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "4.27.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v5", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "5.28.4" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + }, + { + "route": "/eventListener/v7", + "verb": "POST", + "request": { + "format": "VES_specification", + "version": "7.30.2" + }, + "response": { + "format": "ves.coll.response", + "version": "1.0.0" + } + } + ] + }, + "parameters": [ + { + "name": "streams_publishes", + "value": { + "ves-fault": { + "dmaap_info": { + "topic_url": "http://message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + }, + "type": "message_router" + } + }, + "description": "standard http port collector will open for listening;", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + } + , + { + "name": "collector.service.port", + "value": 8080, + "description": "standard http port collector will open for listening;", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.service.secure.port", + "value": 8443, + "description": "secure http port collector will open for listening ", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": true + }, + { + "name": "collector.keystore.file.location", + "value": "/opt/app/dcae-certificate/cert.jks", + "description": "fs location of keystore file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.keystore.passwordfile", + "value": "/opt/app/dcae-certificate/jks.pass", + "description": "location of keystore password file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.truststore.file.location", + "value": "/opt/app/dcae-certificate/trust.jks", + "description": "fs location of truststore file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.truststore.passwordfile", + "value": "/opt/app/dcae-certificate/trust.pass", + "description": "location of truststore password file in vm", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.dmaap.streamid", + "value": "fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance", + "description": "domain-to-streamid mapping used by VESCollector to distributes events based on domain. Both primary and secondary config_key are included for resilency (multiple streamid can be included commma separated). The streamids MUST match to topic config_keys. For single site without resiliency deployment - configkeys with -secondary suffix can be removed", + "sourced_at_deployment": true, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "auth.method", + "value": "noAuth", + "description": "Property to manage application mode, possible configurations: noAuth - default option - no security (http) , certOnly - auth by certificate (https), basicAuth - auth by basic auth username and password (https),certBasicAuth - auth by certificate and basic auth username / password (https),", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "header.authlist", + "value": "sample1,$2a$10$pgjaxDzSuc6XVFEeqvxQ5u90DKJnM/u7TJTcinAlFJVaavXMWf/Zi|userid1,$2a$10$61gNubgJJl9lh3nvQvY9X.x4e5ETWJJ7ao7ZhJEvmfJigov26Z6uq|userid2,$2a$10$G52y/3uhuhWAMy.bx9Se8uzWinmbJa.dlm1LW6bYPdPkkywLDPLiy", + "description": "List of id and base 64 encoded password.For each onboarding VNF - unique userid and password should be assigned and communicated to VNF owner. Password value should be base64 encoded in config here", + "policy_editable": false, + "sourced_at_deployment": true, + "designer_editable": true + }, + { + "name": "collector.schema.checkflag", + "value": 1, + "description": "Schema check validation flag. When enabled, collector will validate input VES events against VES Schema defined on collector.schema.file ", + "sourced_at_deployment": false, + "policy_editable": false, + "designer_editable": false + }, + { + "name": "collector.schema.file", + "value": "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2.1_ONAP.json\"}", + "description": "VES schema file name per version used for validation", + "designer_editable": true, + "sourced_at_deployment": false, + "policy_editable": false + }, + { + "name": "event.transform.flag", + "value": 1, + "description": "flag to enable tranformation rules defined under eventTransform.json; this is applicable when event tranformation rules preset should be activated for transforming