diff options
author | Jakub Dudycz <jakub.dudycz@nokia.com> | 2018-08-07 14:18:37 +0200 |
---|---|---|
committer | Jakub Dudycz <jakub.dudycz@nokia.com> | 2018-08-08 14:51:38 +0200 |
commit | dd827e2c1cc984d9ed1fed9914cbef0e985ea625 (patch) | |
tree | ace76509b89db99ca68509991f410426c1316cd3 /hv-collector-utils | |
parent | f16fff6a5c15474d86ea304b499535076d5a368c (diff) |
Create health check module
Create ves-hv-collector-health-check module with dummy api server and connect it with ves-hv-collector-main
This is a preparation for health check mechanism implementation
Change-Id: I2f668ab7337b1ed7e2afea6c56f34880de3ef1b5
Issue-ID: DCAEGEN2-659
Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
Diffstat (limited to 'hv-collector-utils')
2 files changed, 9 insertions, 0 deletions
diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt index c00ce68d..16634889 100644 --- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt +++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt @@ -60,6 +60,9 @@ abstract class ArgBasedConfiguration<T>(private val parser: CommandLineParser) { protected fun CommandLine.stringValue(cmdLineOpt: CommandLineOption, default: String): String = optionValue(cmdLineOpt).getOrElse { default } + protected fun CommandLine.intValue(cmdLineOpt: CommandLineOption, default: Int): Int = + intValue(cmdLineOpt).getOrElse { default } + protected fun CommandLine.intValue(cmdLineOpt: CommandLineOption): Option<Int> = optionValue(cmdLineOpt).map(String::toInt) diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt index 44de9d7a..836a05df 100644 --- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt +++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt @@ -23,6 +23,12 @@ import org.apache.commons.cli.Option enum class CommandLineOption(val option: Option) { + 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") .longOpt("listen-port") .required() |