diff options
Diffstat (limited to 'sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt')
-rw-r--r-- | sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt | 82 |
1 files changed, 54 insertions, 28 deletions
diff --git a/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt b/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt index 9439bff5..e869901d 100644 --- a/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt +++ b/sources/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt @@ -23,118 +23,144 @@ import org.apache.commons.cli.Option enum class CommandLineOption(val option: Option, val required: Boolean = false) { - HEALTH_CHECK_API_PORT(Option.builder("H") + HEALTH_CHECK_API_PORT( + Option.builder("H") .longOpt("health-check-api-port") .hasArg() .desc("Health check rest api listen port") .build() ), - LISTEN_PORT(Option.builder("p") + LISTEN_PORT( + Option.builder("p") .longOpt("listen-port") .hasArg() .desc("Listen port") .build(), - required = true + required = true ), - CONSUL_CONFIG_URL(Option.builder("c") + CONSUL_CONFIG_URL( + Option.builder("c") .longOpt("config-url") .hasArg() .desc("URL of ves configuration on consul") .build(), - required = true + required = true ), - CONSUL_FIRST_REQUEST_DELAY(Option.builder("d") + CONSUL_FIRST_REQUEST_DELAY( + Option.builder("d") .longOpt("first-request-delay") .hasArg() .desc("Delay of first request to consul in seconds") .build() ), - CONSUL_REQUEST_INTERVAL(Option.builder("I") + CONSUL_REQUEST_INTERVAL( + Option.builder("I") .longOpt("request-interval") .hasArg() .desc("Interval of consul configuration requests in seconds") .build() ), - VES_HV_PORT(Option.builder("v") + VES_HV_PORT( + Option.builder("v") .longOpt("ves-port") .hasArg() .desc("VesHvCollector port") .build(), - required = true + required = true ), - VES_HV_HOST(Option.builder("h") + VES_HV_HOST( + Option.builder("h") .longOpt("ves-host") .hasArg() .desc("VesHvCollector host") .build(), - required = true + required = true ), - KAFKA_SERVERS(Option.builder("s") + KAFKA_SERVERS( + Option.builder("s") .longOpt("kafka-bootstrap-servers") .hasArg() .desc("Comma-separated Kafka bootstrap servers in <host>:<port> format") .build(), - required = true + required = true ), - KAFKA_TOPICS(Option.builder("f") + KAFKA_TOPICS( + Option.builder("f") .longOpt("kafka-topics") .hasArg() .desc("Comma-separated Kafka topics") .build(), - required = true + required = true ), - SSL_DISABLE(Option.builder("l") + SSL_DISABLE( + Option.builder("l") .longOpt("ssl-disable") .desc("Disable SSL encryption") .build() ), - KEY_STORE_FILE(Option.builder("k") + KEY_STORE_FILE( + Option.builder("k") .longOpt("key-store") .hasArg() .desc("Key store in PKCS12 format") .build() ), - KEY_STORE_PASSWORD(Option.builder("kp") + KEY_STORE_PASSWORD( + Option.builder("kp") .longOpt("key-store-password") .hasArg() .desc("Key store password") .build() ), - TRUST_STORE_FILE(Option.builder("t") + TRUST_STORE_FILE( + Option.builder("t") .longOpt("trust-store") .hasArg() .desc("File with trusted certificate bundle in PKCS12 format") .build() ), - TRUST_STORE_PASSWORD(Option.builder("tp") + TRUST_STORE_PASSWORD( + Option.builder("tp") .longOpt("trust-store-password") .hasArg() .desc("Trust store password") .build() ), - IDLE_TIMEOUT_SEC(Option.builder("i") + IDLE_TIMEOUT_SEC( + Option.builder("i") .longOpt("idle-timeout-sec") .hasArg() - .desc("""Idle timeout for remote hosts. After given time without any data exchange the - |connection might be closed.""".trimMargin()) + .desc( + """Idle timeout for remote hosts. After given time without any data exchange the + |connection might be closed.""".trimMargin() + ) .build() ), - MAXIMUM_PAYLOAD_SIZE_BYTES(Option.builder("m") + MAXIMUM_PAYLOAD_SIZE_BYTES( + Option.builder("m") .longOpt("max-payload-size") .hasArg() .desc("Maximum supported payload size in bytes") .build() ), - DUMMY_MODE(Option.builder("u") + LOG_LEVEL( + Option.builder("ll") + .longOpt("log-level") + .hasArg() + .desc("Log level") + .build() + ), + DUMMY_MODE( + Option.builder("u") .longOpt("dummy") .desc("If present will start in dummy mode (dummy external services)") .build() ); fun environmentVariableName(prefix: String = DEFAULT_ENV_PREFIX): String = - option.longOpt.toUpperCase().replace('-', '_').let { mainPart -> - "${prefix}_${mainPart}" - } + option.longOpt.toUpperCase().replace('-', '_').let { mainPart -> + "${prefix}_${mainPart}" + } companion object { private const val DEFAULT_ENV_PREFIX = "VESHV" |