From af0fc05f5e25b0b3237c452c4cfea26a78e10e02 Mon Sep 17 00:00:00 2001 From: Johnny Steenbergen Date: Fri, 24 Apr 2020 12:51:18 -0700 Subject: [PATCH] fix(http): provide support for telegraf update in http client --- http/telegraf.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/http/telegraf.go b/http/telegraf.go index f1b42d2215..7fef7a813d 100644 --- a/http/telegraf.go +++ b/http/telegraf.go @@ -485,7 +485,15 @@ func (s *TelegrafService) CreateTelegrafConfig(ctx context.Context, tc *platform // UpdateTelegrafConfig updates a single telegraf config. // Returns the new telegraf config after update. func (s *TelegrafService) UpdateTelegrafConfig(ctx context.Context, id platform.ID, tc *platform.TelegrafConfig, userID platform.ID) (*platform.TelegrafConfig, error) { - panic("not implemented") + var teleResp platform.TelegrafConfig + err := s.client. + PutJSON(tc, prefixTelegraf, id.String()). + DecodeJSON(&teleResp). + Do(ctx) + if err != nil { + return nil, err + } + return &teleResp, nil } // DeleteTelegrafConfig removes a telegraf config by ID.