vertoforce / go-splunk

Splunk enterprise API go library
1 stars 1 forks source link

Adding new endpoint support #1

Open vertoforce opened 3 years ago

vertoforce commented 3 years ago

This is a great first contribution, and a simple one. Just pick an endpoint off the splunk enterprise search api docs and implement it in search.go.

It should be simple to add a new request because you can use the BuildRequest helper. You just need to build the model of the request.

You may be wondering, isn't there other splunk go libraries out there? Yes. However this one is specifically for the enterprise API, most others aren't. The ones that are aren't fully built out and don't have the data structures defined. This is the only one that has data structures available.

avasapollo commented 3 years ago

Hello I would like to add some endpoints, there is a way to have the docs in json and not xml? https://docs.splunk.com/Documentation/Splunk/8.0.6/RESTREF/RESTsearch I created a PR for the delete search job https://github.com/vertoforce/go-splunk/pull/2 let me know if I can continue like that (I assume the response was 200 let me know if it is different)

vertoforce commented 3 years ago

Thanks for the PR! Yeah good to go!

As for getting the docs in JSON, do you mean the documentation? Or the response?

avasapollo commented 3 years ago

In the documentation I see just xml

vertoforce commented 3 years ago

Oh right, not sure! Hopefully the xml is completely the same structure as the JSON. In that case you can use quicktype to quickly convert the XML to go structures.

avasapollo commented 3 years ago

Ok sounds good tomorrow I ll add more endpoints

avasapollo commented 3 years ago

ok I added 2 PR https://github.com/vertoforce/go-splunk/pull/4 https://github.com/vertoforce/go-splunk/pull/3 let me know if they are ok