api: rename jobs.Delete -> jobs.Deregister

This commit is contained in:
Ryan Uber 2015-09-16 17:16:01 -07:00
parent 5ddb67f3cf
commit 8f9877edaa
2 changed files with 5 additions and 5 deletions

View File

@ -80,8 +80,8 @@ func (j *Jobs) Evaluations(jobID string, q *QueryOptions) ([]*Evaluation, *Query
return resp, qm, nil
}
// Delete is used to remove an existing job.
func (j *Jobs) Delete(jobID string, q *WriteOptions) (string, *WriteMeta, error) {
// Deregister is used to remove an existing job.
func (j *Jobs) Deregister(jobID string, q *WriteOptions) (string, *WriteMeta, error) {
var resp deregisterJobResponse
wm, err := j.client.delete("/v1/job/"+jobID, &resp, q)
if err != nil {

View File

@ -141,7 +141,7 @@ func TestJobs_Evaluations(t *testing.T) {
}
}
func TestJobs_Delete(t *testing.T) {
func TestJobs_Deregister(t *testing.T) {
c, s := makeClient(t, nil, nil)
defer s.Stop()
jobs := c.Jobs()
@ -155,14 +155,14 @@ func TestJobs_Delete(t *testing.T) {
assertWriteMeta(t, wm)
// Attempting delete on non-existing job does not error
_, wm2, err := jobs.Delete("nope", nil)
_, wm2, err := jobs.Deregister("nope", nil)
if err != nil {
t.Fatalf("err: %s", err)
}
assertWriteMeta(t, wm2)
// Deleting an existing job works
evalID, wm3, err := jobs.Delete("job1", nil)
evalID, wm3, err := jobs.Deregister("job1", nil)
if err != nil {
t.Fatalf("err: %s", err)
}