commit | 0d1bdd0ef01da6087b596509d5b4c5cb3c438133 | [log] [tgz] |
---|---|---|
author | dubeejw <jwdubee@us.ibm.com> | Wed Sep 07 14:36:27 2016 -0400 |
committer | Vincent Hou <shou@us.ibm.com> | Tue Jun 06 12:03:47 2017 -0400 |
tree | 9955f59ae605ea85bdffc875c7207d2a12ffd2e3 | |
parent | fd86817c07f1f266de3f40b03ebbf40b59114748 [diff] |
Allow Namespace Get to Retrieve Different Namespaces - Fix defect that prevents 'namespace get' from getting different namespaces - Add a test that ensures 'namespace get' works on different namespaces, and displays the proper error message when the user cannot access a namespace Display More Informative Error Messages for Bad HTTP Requests - Display "connection failued, or timed out" when HTTP requests fail Update User-facing messages - Display the appropriate namespace with 'namespace get' fails - Remove "Request failed" error messages Update Displayed Entity Name, and Test - Dispaly "default" instead of "_" when showing namespaces - Expect "FORBIDDEN" exit code when "namespace get" is called on a namespage the user does not have access to Display Label Instead of Default Namespace - Show "default" instead of "_" when list namespaces Standardize Error Across List Commands - Use the same error message format across list commands
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)
}