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?

  • Hi Shad, I hope you are well.

    Did you get the method to do it? Could you please share the way to get it from API and the storage breakdown?

    Million thanks! 

  • Just throwing my keys in the bowl too, or hat in the ring... 

    Just had the same thought myself.  I am intersted to log our DB and FS storage over time so I can predict the rate that we are likely to fill up.

    An API call would be cool for this.

    I suspect it is a different authentication to accessing your normal cloud instance though?
     Insights:  https://sugarcloud-insights-euw2.service.sugarcrm.com/usage
     Instance: https://yourinstancename.sugaropencloud.uk/ or .eu etc..

    I see it is a very old post, so hopefully get it restarted 

    Bazzilion thanks ;-)

  • HI

    From 12.2 the backups can be downloaded from the Insights URL via API
    If you follow the same authentication process and observe the endpoint of the first page: You can use it to retrieve the cloud usage per instance. 

    Endpoint - https://<sugar_insights_url>/api/v1/app_instance

    It returns something like this
    Mind that the OAuth token needs to be from an Admin user. 

    Let me know if this works for you. 

  • 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

  • WOW

    This is actually awesome ;), 
    Thanks for sharing and I am really happy that I helped you initiate this project. 
    *Sorry for the late nights though. 

    Happy monitoring!!