openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk] branch master updated: Add documentation for save action feature (#2873)
Date Tue, 24 Oct 2017 21:39:26 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f4e6b6  Add documentation for save action feature (#2873)
8f4e6b6 is described below

commit 8f4e6b60ecf07d2bbf2c43a904a916c9ce2c7e84
Author: James Dubee <jwdubee@us.ibm.com>
AuthorDate: Tue Oct 24 17:39:23 2017 -0400

    Add documentation for save action feature (#2873)
    
    * Add documentation for save action feature
    
    * Review updates
---
 docs/actions.md | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/docs/actions.md b/docs/actions.md
index b9dcdd9..91d2bf8 100644
--- a/docs/actions.md
+++ b/docs/actions.md
@@ -277,7 +277,9 @@ Rather than pass all the parameters to an action every time, you can bind
certai
 An action can be invoked through the REST interface via an HTTPS request. To get an action
URL, execute the following command:
 
 ```
-$ wsk action get actionName --url
+wsk action get actionName --url
+```
+```
 ok: got action actionName
 https://${APIHOST}/api/v1/namespaces/${NAMESPACE}/actions/actionName
 ```
@@ -286,6 +288,26 @@ https://${APIHOST}/api/v1/namespaces/${NAMESPACE}/actions/actionName
 action invocations using the REST interface, see
 [Using REST APIs with OpenWhisk](rest_api.md#actions).
 
+### Saving action code
+
+Code associated with an existing action is fetched and saved locally. Saving is performed
on all actions except sequences and docker actions. When saving action code to a file, the
code is saved in the current working directory, and the saved file path is displayed.
+
+1. Save action code to a filename that corresponds with an existing action name. A file extension
that corresponds to the action kind is  used, or an extension of `.zip` will be used for action
code that is a zip file.
+  ```
+  wsk action get actionName --save
+  ```
+  ```
+  ok: saved action code to /absolutePath/currentDirectory/actionName.js
+  ```
+
+2. Instead of allowing the CLI to determine the filename and extension  of the saved code,
a custom filename and extension can be provided by using the `--save-as` flag.
+  ```
+  wsk action get actionName --save-as codeFile.js
+  ```
+  ```
+  ok: saved action code to /absolutePath/currentDirectory/codeFile.js
+  ```
+
 ### Creating asynchronous actions
 
 JavaScript functions that run asynchronously may need to return the activation result after
the `main` function has returned. You can accomplish this by returning a Promise in your action.

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message