Пример #1
0
func TestNoneDeleteService(t *testing.T) {
	if err := cluster.DeleteService(testService2.Id); err != nil {
		t.Errorf("Failed to DELETE service - %v", err)
		t.FailNow()
	}

	_, err := cluster.GetService(testService2.Id)
	if !strings.Contains(err.Error(), "No Service Found") {
		t.Error(err)
	}
}
Пример #2
0
// Delete a service
func deleteService(rw http.ResponseWriter, req *http.Request) {
	// /services/{svcId}
	svcId := req.URL.Query().Get(":svcId")

	// remove from cluster
	err := cluster.DeleteService(svcId)
	if err != nil {
		writeError(rw, req, err, http.StatusInternalServerError)
		return
	}

	writeBody(rw, req, apiMsg{"Success"}, http.StatusOK)
}