• 0
jamiemurphyit

Ruby - Rest API - Easier signing! Ruby - Windows and Linux compatible

Question

So this is less of an ask the community and more of a show the community.

Ive written some Ruby code that makes it much much easier to use the LogicMonitor API.
It does all the signing for you so you can just focus on your API calls and worry less about the secure signing. 

https://gist.github.com/ITJamie/4937de9139c682c02c34ff2d17051d58

It uses the following rest-client library https://github.com/rest-client/rest-client and injects the authentication method into the rest-client library. Ive included some examples of usage in my gist. Let me know if your having difficulty and i will test and patch as needed

For an example of how easy this makes using the Rest API

 

temp_url = @URL + '/service/services'
response = RestClient.get(temp_url)

# Printing API server response
puts "\nServer response: #{response}"

 

Edited by jamiemurphyit

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Thanks for sharing, Jamie!  We love to see what power users like yourself come up with.  We are working on publishing SDKs for our REST API in at least a few languages (which will make the authentication less cumbersome), but you beat us to it :) 

Share this post


Link to post
Share on other sites
  • 0

That's amazing to hear Sarah. Do you plan on working with customers when developing these sdks? This gist I posted is an extract from our larger internal chef library (I hope to publish that some day when I can make it fully generic) would love to get involved in helping ye create a rubygem to cover all usecaes. 

Share this post


Link to post
Share on other sites
  • 0

Hi Jamie - We absolutely plan on involving customers, and would love to work with you on this.  We're still figuring out the best way to enable that collaboration, and will reach out soon with more detail.  Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now