Mapping functions of the license_usages
REST API
Available from 9.2.24.
If you have custom tools or internal processes that use the
license_usages
REST API, it is best to adjust them to use REST API in version 2.
Learn how to achieve your goals by using the combination of v2/license_usage
and
v2/license_usage_per_server
REST APIs.
Mapping license_usages
REST API functions
The license_usages
REST API allows you to retrieve information about the peak of
license metric utilization for a product within the last 90 days. To achieve the same result by
using REST API in version 2, you need to combine information from the
v2/license_usage
and v2/license_usage_per_server
REST APIs.
First, run the v2/license_usage
REST API to retrieve license metric utilization
for all products within a selected period. If you want the returned data to cover the same period as
the license_usages
REST API, set the period to the last 90 days.
Then, based on the data that is returned by the v2/license_usage
REST API, use
the v2/license_usage_per_server
REST API. Run it to retrieve detailed license
metric utilization for a particular software product per server for the day when the utilization was
the highest. You need to repeat this step for every product that is returned by the
v2/license_usage
REST API.
Example
Scenario: Retrieving information about the peak of license metric utilization for every product within the last 90 days.
- Run the
v2/license_usage
REST API to retrieve overall license metric utilization for the last 90 days.Example
api/sam/v2/license_usage?startdate=2021-01-01&enddate=2021-03-31 &columns[]=product_name&columns[]=metric_code_name&columns[]=hwm_quantity &columns[]=product_id&columns[]=metric_id&columns[]=bundle_id&columns[]=hwm_peak_time3 &token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- See the values of the product_id, metric_id,
bundle_id, and hwm_peak_time parameters for the first
product that is returned by the
v2/license_usage
REST API.Example
[{ "product_id":24, "product_name":"IBM InfoSphere QualityStage Address Verification Interface", "metric_id":3, "metric_code_name":"PVU_FULL_CAP", "bundle_id":0, "hwm_quantity":8800, "hwm_peak_time":"2021-03-26T23:07:19Z" }]
- Use values from the product_id, metric_id, and
bundle_id parameters to retrieve detailed license metric utilization for a
particular software product per server for the day when the utilization was the highest. The day is
returned in the hwm_peak_time
parameter.
Example
api/sam/v2/license_usage_per_server?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 &date=2021-03-26&criteria{"and":[["product_id","=","24"],["metric_id","=","3"], [bundle_id,"equals","0"]]} Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Because the hwm_peak_time might be different for every product, repeat steps 2 and 3 for every product that is returned in step 1.