Get instance storage from Cloud Insights

Hello,

With the new Cloud Insights feature built into the Admin of On-Demand instances is there any way to retrieve instance storage via an API request?

Parents Reply Children
  • Hi ...

    Thank you so much for the reply.   I am no developer but have got that working perfectly in postman, returning everything I need.   I love your thinking and how you got the the solution.   So I feel I side project coming on then to grab the FS & DB storage maybe weekly, and plot that in a chart over time.  Comletely pointless? Maybe...  But interesting Nerd

    Thanks again...

    Luke.  (with too many side projects!)

  • Hi & ,
    Tagging in too as we had joked about some of these 'side projects'. 

    Well, this one I actually got finished! Joy

    I just wanted to share my progress and maybe posting this will help anybody else do similar.

    Following your advice above Andre I used postman to authenticate as per usual via the rest api, then use the token to get the data from the Insights api: Endpoint - https://<sugar_insights_url>/api/v1/app_instance

    Fast forward to a couple of days ago and too many late nights, and probably too much work time, I now have this:

    • Google Apps Script code authenticates via rest the API. < this runs at ~2am daily
    • Uses the access token to make the request into the Insights server (from Andre above).
    • Parse that data into variables.
    • Shove the variables data into a new row in a DATA sheet within the google spreadsheet.
    • I then have a second sheet which brings the specific cells across from data and populates a couple of charts.
    • Then in Sheets you can move a chart to a new sheet all of its own. < right click your chart
    • On that new chart sheet I have 'published' it, so that gives me a url.
    • Back on my own SugarCRM Admin Dash (after adding the url to Content Security Policy) I added the published chart sheet to a Web Page Dashlet...

    All that means I now have a chart on my dashboard showing insights database and file system storage logged over time.  I will keep an eye this to see when I need to pull my finger out and start culling old records / big files etc.. (which is the next phase of this project, maybe data archiver).

    I am happy to share the code from Apps Script if anybody is interested.  It may not be the best code in the world, my first ever javascript attempt so no warranties are available...  sold as seen, no refunds and all knowledge will be denied.

    I hope there was not an easier way to accomplish this...
    ...if you know of a such a way - please keep it to yourself.

    And here it is in all it's glory...
    Ok, I know it its just a bunch of flat lines, but over time... it will become awesome Metal

  • , Andre's reply above ought to be marked as best answer / verified answer