Using the wsk client

The wsk client will have already been installed by the make quick-start command. The wsk binary can be found at openmaster/bin/wsk. We usually copy the wsk CLI to /usr/local/bin and set up bash completion for it:

$ sudo cp openwhisk-master/bin/wsk /usr/local/bin

$ wsk sdk install bashauto
The bash auto-completion script (wsk_cli_bash_completion.sh) is installed in the current directory.
To enable command line completion of wsk commands, source the auto completion script into your bash environment

$ source wsk_cli_bash_completion.sh
$ wsk

____ ___ _ _ _ _ _
/ / _ _ __ ___ _ __ | | | | |__ (_)___| | __
/ /__ | | | | '_ / _ '_ | | | | '_ | / __| |/ /
/ \____ / | |_| | |_) | __/ | | | |/| | | | | \__ <
/ / \___/| .__/ \___|_| |_|__/\__|_| |_|_|___/_|\_
\___/ tm |_|

Usage:
wsk [command]

...

The first sub-command introduced here is wsk property get. It is to display OpenWhisk information, including the current namespace, the authentication key, and the build number. For example, we use -i or --insecure for insecurely connecting to the OpenWhisk instance as the generated certificate is self-signed:

$ wsk -i property get
client cert
Client key
whisk auth 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
whisk API host localhost:443
whisk API version v1
whisk namespace guest
whisk CLI version 2017-12-05T00:51:32+00:00
whisk API build "09/01/2016"
whisk API build number "latest"

What does the information tell us? We are currently at the guest namespace using API version 1 and the long string, starting with 23bc, is our API key for authentication. Any OpenWhisk client, including the wsk itself, needs this key to connect to the OpenWhisk instance. Our current API gateway is at localhost:443, which will forward all requests to the underlying controllers. The overview of each OpenWhisk component and the architecture will be discussed in the next section.

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

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