Closed rudranil-das closed 2 years ago
Workaround used in ixia-c controller for time-being is, Instead of
result.SetStatusCode200(response)
used the following,
result.StatusCode200().FromJson(response.ToJson())
FYI, Same observation is seen with GetStatesResponse as well.
This should address in https://github.com/open-traffic-generator/snappi/releases/tag/v0.7.1
Snappi version: This issue is observed with dev version of snappi [https://github.com/open-traffic-generator/snappi/tree/gosnappi_server_tmp/gosnappi]. But could be a pre-existing issue.
In ixia-c controller GetMetrics implementation on top of Gosnappi http server, (http://gitlab.it.keysight.com/athena/controller/blob/dev-gosnappi-http/internal/service/results.go), we tried to do following,
And the expectation is the get_metrics call (as mentioned below) would succeed for all choices (port/flow/...)
For choice = "port" it does, but for choice="flow" it shows following weird response,
When the scenario is checked with debug-prints in GetMetrics hook of metrics_controller.go (of gosnappi server),
it reflected the following output,
i.e. the Msg() reflects the correct parameters, but ToJson() does not.
I think this reflects the SetStatusCode200 did not work on GetMetricsResponse where MetricsResponse is not of default choice-type (i.e. "port")