You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/08/10 15:44:52 UTC

[GitHub] tleyden opened a new issue #25: Not adding "api" to the URL

tleyden opened a new issue #25: Not adding "api" to the URL 
URL: https://github.com/apache/incubator-openwhisk-client-go/issues/25
 
 
   I'm running against Bluemix, and trying to list activations with:
   
   ```
   	config, err := WhiskConfigFromEnvironment()
   	if err != nil {
   		return nil, err
   	}
   	client, _ := whisk.NewClient(http.DefaultClient, config)
   	activations, resp, err := client.Activations.List(nil)
   ```
   
   In `WhiskConfigFromEnvironment()` I?m setting `config.AUTH` and `config.APIHOST` based on what?s in my `~/.wskprops` file.
   
   However it's getting a 404 because it's trying to go to `http://openwhisk.ng.bluemix.net/v1/namespaces/_/activations`, which is missing `api` in the base url.  
   
   If I run `wsk -d activation list` I can see that it goes to `https://openwhisk.ng.bluemix.net/api/v1/namespaces/_/activations?limit=30&skip=0`.
   
   I verified that it fixes the issue w/ this (hacky) workaround:
   
   ```
       requestUrlString := strings.Replace(requestUrl.String(), "v1", "api/v1", 1)
   
       req, err := http.NewRequest(method, requestUrlString, buf)
   ```     
   
   After that change, `client.Activations.List(nil)` returns the list of activations.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services