REST API - /api/sam/swinventory/products - licenseType

Hi All

One of my integrations is using a call to ‘/api/sam/swinventory/products’ to retrieve the product information, and this method call returns values such as:

{
“nmbOfAllRows”: “7”,
“licenseType”: “6”,
“level”: “product”,
“children”: “true”,
“confidence”: “55”,
“productReleaseComponent”: “IBM BigFix Inventory”,
“isConfirmed”: “false”,
“id”: “22554”,
“type”: “root”
}

In earlier versions of the API, the ‘licenseType’ attribute returned the name of the metric type, such as “PVU” / “RVU” etc. But in newer versions of BigFix Inventory the API now returns an integer rather than the name, which I assume is either an enum or a lookup id, but I cannot find what the returned values represent. The licenseType attribute does not seem to be documented in the BigFix API documentation from what I can see.

Is there either a way to retrieve the original licenseType name, or a list of what each of the values represent?

Thanks in advance.

Gary
-=-

Are you open to using V2 of the API?

Example conversation - clearing a license metric threshold
1.To retrieve information about the identifier of the product for which you want to clear the license
metric threshold, use the following
GET request. The request returns product ID and name, metric ID and name, and the threshold value.Request
GET
api/sam/v2/license_usage?columns=product_id&columns=product_name
&columns=metric_id&columns=metric_name&columns=threshold
&token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623
Response
[{
“product_id”:
29258,
“product_name”:
“WebSphere
Service
Registry
and
Repository”,
“metric_id”:
3,
“metric_name”:
“PVU
Full
Capacity”
“threshold”:
300
}]

Also there is a fair amount of information about metric types here.

Hi @jgo

I will be migrating to the new v2 API in the future, but in the meantime I’m looking for a fix for the current users of my integration. I simply need to know what each integer returned by the ‘/api/sam/swinventory/products’ for licenseType represents, then I can create a lookup to fix it.

The method call you mention, ‘/api/sam/v2/license_usage’ is for license usage, which is the equivalent of ‘/api/sam/license_usages’ in the v1 API, which also returns the ‘metric_name’ attribute, but that is not the information I’m looking for.

Odd that it is so difficult to find out what each of the values for licenseType represent now the API has change to represent it as an integer instead of the text description. :frowning:

Thanks

Gary

Hi @GarySmith

I think this is what you’re looking for:
https://www.ibm.com/support/knowledgecenter/en/SS8JFY_9.2.0/com.ibm.lmt.doc/Inventory/integration/r_metric_mapping.html

Thanks @itsmpro92.

That covers the v2 API metrics, the latest version of that page is:

https://www.ibm.com/support/knowledgecenter/en/SSKLLW_9.5.0/com.ibm.bigfix.inventory.doc/Inventory/integration/r_metric_mapping.html

This will be great going forward when I migrate my integrations to the v2 API.

In the meantime, I need to find a similar lookup list for the v1 API…

Cheers

Gary

@GarySmith I would be very surprised if the data provided by v1 API differed from that provided by the v2 API, given that the underlying data schema has not changed. When viewed in the UI, I would expect your BFI components to have a metric of RVU MAPC (6 = INTERNAL_RVU_MAPC = RVU MAPC). Is this not the case?

Hi @GarySmith,

as wrote by @itsmpro92, the mapping can be found under the following link: https://www.ibm.com/support/knowledgecenter/SSKLLW_9.5.0/com.ibm.bigfix.inventory.doc/Inventory/integration/r_metric_mapping.html#reference_vys_ysj_b1b

This old API is returning only information about products licensed based on PVU and RVU MAPC metrics. For info about all the supported metric types, yo7u need to use the new V2 API.

However, I can see that this licenseType attribute is not documented at all (as well as the above limitation for just 2 license types). I will open internal defect to have this fixed.

Also - this attribute was always an ID, not metric name. Can you provide more details in which BFI version the API returned metric name not ID?

Thanks @itsmpro92, @Tomasz_Stopa. :slight_smile:

I found the specific information I need for the v1 API here:

https://www.ibm.com/support/knowledgecenter/en/SS8JFY_9.2.0/com.ibm.lmt.doc/Inventory/integration/r_get_swinventory_products.html

licenseType
Indicates the type of the license that is assigned to the product. Possible values are:

1 - Other
5 - PVU
6 - RVU MAPC