Obtaining activation results

Each time an action is invoked, OpenWhisk creates an activation record for it. To see the activation record, we may invoke an action without the --result parameter, for example:

$ wsk -i action invoke --param hello world whisk_go
ok: invoked /guest/whisk_go with id 6ba2c0fd6f4348b8a2c0fd6f4388b864

The ID 6ba2c0fd6f4348b8a2c0fd6f4388b864 is called an activation ID. We can now obtain the activation record using the wsk activation get command. Putting a field name after the activation ID will filter it to display only that field. The following example shows only the field response of the activation record 6ba2c0:

$ wsk -i activation get 6ba2c0fd6f4348b8a2c0fd6f4388b864 response
ok: got activation 6ba2c0fd6f4348b8a2c0fd6f4388b864, displaying field response
{
"status": "success",
"statusCode": 0,
"success": true,
"result": {
"keys": [
"hello"
],
"message": "Hello from Go",
"values": [
"world"
]
}
}

In the activation record, the JSON result is placed under the result key. You may observe that all the data is correctly serialized to JSON and recorded there.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset