Skip to content

Commit

Permalink
Update sumologic/sumologic_field.go
Browse files Browse the repository at this point in the history
Co-authored-by: Raghavendra Khare <[email protected]>
  • Loading branch information
priyanshgoel and raghavxk authored Jan 3, 2025
1 parent 441204a commit dea7231
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions sumologic/sumologic_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,20 @@ func (s *Client) FindFieldId(name string) (string, error) {
}

func (s *Client) DisableField(id string) error {
urlWithoutParams := "v1/fields/%s/disable"
sprintfArgs := []interface{}{}
sprintfArgs = append(sprintfArgs, id)

urlWithParams := fmt.Sprintf(urlWithoutParams, sprintfArgs...)
urlWithParams := fmt.Sprintf("v1/fields/%s/disable", id)

_, err := s.Delete(urlWithParams)

return err
}

func (s *Client) EnableField(id string) error {
urlWithoutParams := "v1/fields/%s/enable"
sprintfArgs := []interface{}{}
sprintfArgs = append(sprintfArgs, id)

urlWithParams := fmt.Sprintf(urlWithoutParams, sprintfArgs...)
urlWithParams := fmt.Sprintf("v1/fields/%s/enable", id)

_, err := s.Put(urlWithParams, nil)

return err
}


type Field struct {
FieldId string `json:"fieldId"`
DataType string `json:"dataType"`
Expand Down

0 comments on commit dea7231

Please sign in to comment.