fix(http): provide support for telegraf update in http client

pull/17871/head
Johnny Steenbergen 2020-04-24 12:51:18 -07:00 committed by Johnny Steenbergen
parent 1ac383de66
commit af0fc05f5e
1 changed files with 9 additions and 1 deletions

View File

@ -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.