weldr: Add support for the v1 API to /projects/source/delete

This changes store.DeleteSource to DeleteSourceByName for v0 use and
DeleteSourceByID for v1 usage.

It includes a new client function DeleteSourceV1, adds a new test, and
converts the tests for the previous Source V1 API commits to use
DeleteSourceV1.
This commit is contained in:
Brian C. Lane 2020-04-30 15:45:54 -07:00 committed by Tom Gundersen
parent 982d292a96
commit 37258803b4
4 changed files with 61 additions and 12 deletions

View file

@ -115,3 +115,12 @@ func DeleteSourceV0(socket *http.Client, sourceName string) (*APIResponse, error
}
return NewAPIResponse(body)
}
// DeleteSourceV1 deletes the named source and returns an APIResponse
func DeleteSourceV1(socket *http.Client, sourceName string) (*APIResponse, error) {
body, resp, err := DeleteRaw(socket, "/api/v1/projects/source/delete/"+sourceName)
if resp != nil || err != nil {
return resp, err
}
return NewAPIResponse(body)
}