Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed additional Status Code checks #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions splunk/resource_splunk_inputs_udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,7 @@ func inputsUDPDelete(d *schema.ResourceData, meta interface{}) error {
return err
}
defer resp.Body.Close()

switch resp.StatusCode {
case 200, 201:
return nil

default:
errorResponse := &models.InputsUDPResponse{}
_ = json.NewDecoder(resp.Body).Decode(errorResponse)
err := errors.New(errorResponse.Messages[0].Text)
return err
}
return nil
}

// Helpers
Expand Down
18 changes: 4 additions & 14 deletions splunk/resource_splunk_saved_searches.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ func savedSearches() *schema.Resource {
"4 - Warning",
},
"action_snow_event_param_description": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: " A brief description of the event.",
},
"action_snow_event_param_ci_identifier": {
Expand Down Expand Up @@ -1693,17 +1693,7 @@ func savedSearchesDelete(d *schema.ResourceData, meta interface{}) error {
return err
}
defer resp.Body.Close()

switch resp.StatusCode {
case 200, 201:
return nil

default:
errorResponse := &models.InputsUDPResponse{}
_ = json.NewDecoder(resp.Body).Decode(errorResponse)
err := errors.New(errorResponse.Messages[0].Text)
return err
}
return nil
}

func getSavedSearchesConfig(d *schema.ResourceData) (savedSearchesObj *models.SavedSearchObject) {
Expand Down