01 Nov 2022 07:50 PM - last edited on 02 Nov 2022 09:55 AM by MaciejNeumann
I've read the documentation for retrieving license consumption via API but the endpoint "/api/cluster/v2/license/consumption/hour" only retrieves the latest hour.
Is there a way to edit the URL to retrieve data for the last say week/month/year?
In the example provided in the documentation, you can specify a starting timestamp. Are there other parameters you can filter for?
I know I can export the data but that's in a zip file and I prefer to have updated data.
PS: I'm a beginner at this stuff any help is appreciated
Solved! Go to Solution.
01 Nov 2022 07:58 PM
What is your scope? are you looking for overall consumption? Hosts/entities individually?
01 Nov 2022 08:00 PM
Individual entity consumption
01 Nov 2022 08:58 PM
If you are on managed - the most precise method is to use the data in the zip file.
For individual environment or saas I use this script to push license metric bound to individual hosts. It uses the /api/v1/oneagents API to pull consumption and then push the metric value back to the environment. Then you have the license metric in your environment and you can report consumption simply using Data Explorer by filtering on hosts or management zones as you prefer.
Also, the recent version notifies you if some of your hosts are disabled due to overconsumption.
03 Nov 2022 01:30 AM
The consumption data in the zip file is actually not correct. It often outputs wrong hostunit / consumption values, or at least it used to. That's one of the reasons we couldn't use it. In a support case I was told I am not to rely on that data - so I would not.
Same with the consumedHostUnits value in the API, this often does not reflect the real value. That was an issue since we have to get the costs of individual hosts for our actual accounting.
That may be fixed by now, it was a year ago, but that was an issue for us internally.
We ended up writing a script taking the paasMemoryLimit / zosTotalPhysicalMemory and applying the calculations ourselves depending on the mode the hosts (infrastructure, fullstack).
03 Nov 2022 07:16 AM - last edited on 16 Dec 2022 08:42 AM by Ana_Kuzmenchuk
We never had issues with either the zip file or the API (OneAgent API). Both are reporting correct host units. I'd stay away from calculating that on your own unless you know the details such as memory tolerance. (Yes there is some tolerance).
28 Jan 2023 12:40 AM - edited 28 Jan 2023 12:41 AM
We didn't, and I even have a support call which confirms that, even with a statement made we are not to rely on that data. I'd have to re-check that though if that situation changed. We actually implemented the calculation ourselves because of that.
27 Dec 2022 09:46 AM
I am looking for Hosts/entities individually in the SAAS environment.