commit | a7f74db6724419d52126670284da070346303336 | [log] [tgz] |
---|---|---|
author | rodric rabbah <rodric@gmail.com> | Mon Apr 03 14:03:03 2017 -0400 |
committer | Vincent Hou <shou@us.ibm.com> | Tue Jun 06 12:03:49 2017 -0400 |
tree | 1f56575d4da1118954c63d35b36aacd1ec82e25c | |
parent | 4a1611d03542eb9b77b4b65793e10f1b85cc3dc5 [diff] |
Enable tests for unicode for python, swift. (#2070) Re-enable build swift/python containers (for tests to run). Add unicode unit test for swift action container. Allow for reinit with swift for use with invoke.py. Fix unicode regression for swift actions. Refactor unicode tests to add coverage - now also for base action container. Set string encoding to utf-8 for swift action proxy. Rewrite result extraction to avoid splitting and printing logs one line at a time. Skip decoding when process output is a string; already utf-8. Consolidate base64 encoding in CLI; remove Jar field in exec.
go-whisk
is a Go client library for accessing the IBM Whisk API.
import "github.ibm.com/BlueMix-Fabric/go-whisk/whisk"
Construct a new whisk client, then use various services to access different parts of the whisk api. For example to get the hello
action:
client, _ := whisk.NewClient(http.DefaultClient, nil)
action, resp, err := client.Actions.List("hello")
Some API methods have optional parameters that can be passed. For example, to list the first 30 actions, after the 30th action:
client, _ := whisk.NewClient(http.DefaultClient, nil)
options := &whisk.ActionListOptions{
Limit: 30,
Skip: 30,
}
actions, resp, err := client.Actions.List(options)
Whisk can be configured by passing in a *whisk.Config
object as the second argument to whisk.New( ... )
. For example:
u, _ := url.Parse("https://whisk.stage1.ng.bluemix.net:443/api/v1/")
config := &whisk.Config{
Namespace: "_",
AuthKey: "aaaaa-bbbbb-ccccc-ddddd-eeeee",
BaseURL: u
}
client, err := whisk.Newclient(http.DefaultClient, config)
import (
"net/http"
"net/url"
"github.ibm.com/BlueMix-Fabric/go-whisk/whisk"
)
func main() {
client, err := whisk.NewClient(http.DefaultClient, nil)
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
options := &whisk.ActionListOptions{
Limit: 30,
Skip: 30,
}
actions, resp, err := client.Actions.List(options)
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
fmt.Println("Returned with status: ", resp.Status)
fmt.Println("Returned actions: \n%+v", actions)
}