2 * ============LICENSE_START=======================================================
3 * dcaegen2-collectors-veshv
4 * ================================================================================
5 * Copyright (C) 2018-2019 NOKIA
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.onap.dcae.collectors.veshv.commandline
22 import org.apache.commons.cli.Option
25 enum class CommandLineOption(val option: Option, val required: Boolean = false) {
26 HEALTH_CHECK_API_PORT(
28 .longOpt("health-check-api-port")
30 .desc("Health check rest api listen port")
35 .longOpt("listen-port")
41 CONFIGURATION_FIRST_REQUEST_DELAY(
43 .longOpt("first-request-delay")
45 .desc("Delay of first request for configuration in seconds")
48 CONFIGURATION_REQUEST_INTERVAL(
50 .longOpt("request-interval")
52 .desc("Interval of configuration requests in seconds")
59 .desc("VesHvCollector port")
67 .desc("VesHvCollector host")
73 .longOpt("kafka-bootstrap-servers")
75 .desc("Comma-separated Kafka bootstrap servers in <host>:<port> format")
81 .longOpt("kafka-topics")
83 .desc("Comma-separated Kafka topics")
89 .longOpt("ssl-disable")
90 .desc("Disable SSL encryption")
97 .desc("Key store in PKCS12 format")
102 .longOpt("key-store-password")
104 .desc("Key store password")
109 .longOpt("trust-store")
111 .desc("File with trusted certificate bundle in PKCS12 format")
114 TRUST_STORE_PASSWORD(
116 .longOpt("trust-store-password")
118 .desc("Trust store password")
123 .longOpt("idle-timeout-sec")
126 """Idle timeout for remote hosts. After given time without any data exchange the
127 |connection might be closed.""".trimMargin()
131 MAXIMUM_PAYLOAD_SIZE_BYTES(
133 .longOpt("max-payload-size")
135 .desc("Maximum supported payload size in bytes")
140 .longOpt("log-level")
148 .desc("If present will start in dummy mode (dummy external services)")
152 fun environmentVariableName(prefix: String = DEFAULT_ENV_PREFIX): String =
153 option.longOpt.toUpperCase().replace('-', '_').let { mainPart ->
154 "${prefix}_${mainPart}"
158 private const val DEFAULT_ENV_PREFIX = "VESHV"