diff options
author | kjaniak <kornel.janiak@nokia.com> | 2018-11-29 13:44:50 +0100 |
---|---|---|
committer | kjaniak <kornel.janiak@nokia.com> | 2018-12-05 14:53:20 +0100 |
commit | 0f7bc6b6ec219b6e22a4b5b5a4ee1efd4e54efba (patch) | |
tree | 593dc7b9487d148160110be532e038f8a383846b /sources/hv-collector-xnf-simulator | |
parent | d632aef8303701a1802f817c3d6fdcd4064c32b2 (diff) |
Enhance of logging in test part
Change-Id: Ibdec0ac5cead7e46ada4c32983b9ccf962df703b
Issue-ID: DCAEGEN2-1004
Signed-off-by: kjaniak <kornel.janiak@nokia.com>
Diffstat (limited to 'sources/hv-collector-xnf-simulator')
-rw-r--r-- | sources/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/XnfApiServer.kt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sources/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/XnfApiServer.kt b/sources/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/XnfApiServer.kt index 06f1cffe..16019384 100644 --- a/sources/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/XnfApiServer.kt +++ b/sources/hv-collector-xnf-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/xnf/impl/adapters/XnfApiServer.kt @@ -20,6 +20,7 @@ package org.onap.dcae.collectors.veshv.simulators.xnf.impl.adapters import arrow.core.Either +import arrow.core.getOrElse import arrow.effects.IO import org.onap.dcae.collectors.veshv.simulators.xnf.impl.OngoingSimulations import org.onap.dcae.collectors.veshv.simulators.xnf.impl.XnfSimulator @@ -64,9 +65,13 @@ internal class XnfApiServer( } private fun startSimulationHandler(ctx: Context) { - logger.info("Starting asynchronous scenario") + logger.info("Attempting to start asynchronous scenario") ctx.request.body.then { body -> val id = startSimulation(body) + when (id) { + is Either.Left -> logger.warn { "Failed to start scenario, ${id.a}"} + is Either.Right -> logger.info { "Scenario started, details: ${id.b}" } + } ctx.response.sendEitherErrorOrResponse(id) } } @@ -78,9 +83,12 @@ internal class XnfApiServer( } private fun simulatorStatusHandler(ctx: Context) { + logger.debug("Checking task status") val id = UUID.fromString(ctx.pathTokens["id"]) + logger.debug { "Checking status for id: $id" } val status = ongoingSimulations.status(id) val response = Responses.statusResponse(status.toString(), status.message) + logger.info { "Task $id status: $response" } ctx.response.sendAndHandleErrors(IO.just(response)) } |