in whisk/api.go [433:466]
func (s *ApiService) Delete(api *ApiDeleteRequest, options *ApiDeleteRequestOptions) (*http.Response, error) {
route := "web/whisk.system/apimgmt/deleteApi.http"
Debug(DbgInfo, "Api DELETE route: %s\n", route)
routeUrl, err := addRouteOptions(route, options)
if err != nil {
Debug(DbgError, "addRouteOptions(%s, %#v) error: '%s'\n", route, options, err)
errMsg := wski18n.T("Unable to add route options '{{.options}}'",
map[string]interface{}{"options": options})
whiskErr := MakeWskErrorFromWskError(errors.New(errMsg), err, EXIT_CODE_ERR_GENERAL, DISPLAY_MSG,
NO_DISPLAY_USAGE)
return nil, whiskErr
}
Debug(DbgError, "Api DELETE route with options: %s\n", routeUrl)
req, err := s.client.NewRequestUrl("DELETE", routeUrl, nil, DoNotIncludeNamespaceInUrl, AppendOpenWhiskPathPrefix, EncodeBodyAsJson, AuthRequired)
if err != nil {
Debug(DbgError, "http.NewRequestUrl(DELETE, %s, nil, DoNotIncludeNamespaceInUrl, AppendOpenWhiskPathPrefix, EncodeBodyAsJson) 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
}
retApi := new(ApiDeleteResponse)
resp, err := s.client.Do(req, &retApi, ExitWithErrorOnTimeout)
if err != nil {
Debug(DbgError, "s.client.Do() error - HTTP req %s; error '%s'\n", req.URL.String(), err)
return resp, err
}
return nil, nil
}