in whisk/action.go [264:289]
func (s *ActionService) Delete(actionName string) (*http.Response, error) {
// Encode resource name as a path (with no query params) before inserting it into the URI
// This way any '?' chars in the name won't be treated as the beginning of the query params
actionName = (&url.URL{Path: actionName}).String()
route := fmt.Sprintf("actions/%s", actionName)
Debug(DbgInfo, "HTTP route: %s\n", route)
req, err := s.client.NewRequest("DELETE", route, nil, IncludeNamespaceInUrl)
if err != nil {
Debug(DbgError, "http.NewRequest(DELETE, %s, nil) error: '%s'\n", route, err)
errMsg := wski18n.T("Unable to create HTTP request for DELETE '{{.route}}': {{.err}}",
map[string]interface{}{"route": route, "err": err})
whiskErr := MakeWskErrorFromWskError(errors.New(errMsg), err, EXIT_CODE_ERR_NETWORK, DISPLAY_MSG,
NO_DISPLAY_USAGE)
return nil, whiskErr
}
a := new(Action)
resp, err := s.client.Do(req, a, ExitWithSuccessOnTimeout)
if err != nil {
Debug(DbgError, "s.client.Do() error - HTTP req %s; error '%s'\n", req.URL.String(), err)
return resp, err
}
return resp, nil
}