From 334a5dd7f2055f7e60d8ec4a810bf8f15950b14b Mon Sep 17 00:00:00 2001 From: rood_ni <41773436+roodni@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:43:49 +0900 Subject: [PATCH 1/2] Modify URL path of DeleteGraphDef --- graph_defs.go | 2 +- graph_defs_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/graph_defs.go b/graph_defs.go index 0eac93c..e4cfd03 100644 --- a/graph_defs.go +++ b/graph_defs.go @@ -25,6 +25,6 @@ func (c *Client) CreateGraphDefs(graphDefs []*GraphDefsParam) error { // DeleteGraphDef deletes a graph definition. func (c *Client) DeleteGraphDef(name string) error { - _, err := requestJSON[any](c, http.MethodDelete, "/api/v0/graph-defs/delete", map[string]string{"name": name}) + _, err := requestJSON[any](c, http.MethodDelete, "/api/v0/graph-defs", map[string]string{"name": name}) return err } diff --git a/graph_defs_test.go b/graph_defs_test.go index d24c5db..1deb821 100644 --- a/graph_defs_test.go +++ b/graph_defs_test.go @@ -102,8 +102,8 @@ func TestGraphDefsOmitJSON(t *testing.T) { func TestDeleteGraphDef(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - if req.URL.Path != "/api/v0/graph-defs/delete" { - t.Error("request URL should be /api/v0/graph-defs/delete but:", req.URL.Path) + if req.URL.Path != "/api/v0/graph-defs" { + t.Error("request URL should be /api/v0/graph-defs but:", req.URL.Path) } if req.Method != "DELETE" { From c32ceb6fa4061e1e87514498c2ff8db159e17ed3 Mon Sep 17 00:00:00 2001 From: rood_ni <41773436+roodni@users.noreply.github.com> Date: Tue, 4 Jun 2024 15:49:01 +0900 Subject: [PATCH 2/2] retract v0.33.0 --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index aeef2f4..5338d85 100644 --- a/go.mod +++ b/go.mod @@ -3,3 +3,5 @@ module github.com/mackerelio/mackerel-client-go go 1.18 require github.com/kylelemons/godebug v1.1.0 + +retract v0.33.0 // API endpoint for DeleteGraphDef has changed. \ No newline at end of file