houshengbo commented on a change in pull request #2592: Make the result of
response consistent for both Wsk CLI and REST
URL:
https://github.com/apache/incubator-openwhisk/pull/2592#discussion_r133757169
##########
File path: tests/src/test/scala/common/WskTestHelpers.scala
##########
@@ -31,6 +31,55 @@ import spray.json._
import java.time.Instant
/**
+ * An arbitrary response of a whisk action. Includes the result as a JsObject
as the
+ * structure of "result" is not defined.
+ */
+case class ActivationResponse(result: Option[JsObject], status: String,
success: Boolean)
+
+object ActivationResponse extends DefaultJsonProtocol {
+ implicit val serdes = jsonFormat3(ActivationResponse.apply)
+}
+
+/**
+ * Activation record as it is returned by the CLI.
+ */
+ case class ActivationResult (
+ activationId: String,
+ logs: Option[List[String]],
+ response: ActivationResponse,
+ start: Instant,
+ end: Option[Instant], // This field is optional in responses of REST
calls.
+ duration: Option[Long], // This field is optional in responses of REST
calls.
Review comment:
Do we add the default values to end and duration on the rest api server side
or fill in them on the client side when we receive the response?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services