Retrieval of license metric utilization (v2)
Available from 9.2.10. You use the GET
operation on the api/sam/v2/license_usage
element to request information about
utilization of license metrics by products that are installed in your infrastructure. By default,
the results are returned for the computer group of the user whose token is used for authentication
and cover the period for which data is aggregated in this group. They also include custom fields
that were added to the All Metrics
report.
Permissions
You must have the View License Metrics permission to use this API.
Resource URL
https://hostname:port/api/sam/v2/license_usage?token=token
Resource information
Operation details | Description |
---|---|
HTTP method | GET |
Request headers |
Negotiates the language of the response. If the header is not specified, the content is returned in the server language. |
Request format | application/json |
Response headers |
Specifies the content type of the response. |
Specifies the language of the response content. If the header is not specified, the content is returned in the server language. |
|
Specifies the date starting from which the data is retrieved. |
|
Specifies the date until which the data is retrieved. |
|
Specifies ID of the computer group for which data is retrieved. |
|
Response payload | License Usage element |
Response format | application/json |
Response codes |
|
Schema description
GET api/sam/v2/schemas/license_usage.json?token=token
Available columns
Column | Description | Displayed by default | Type |
---|---|---|---|
product_publisher_name | Name of the product publisher. | ✓ | String |
product_id | Identifier of the software product. | Integer | |
product_name | Name of the software product. | ✓ | String |
product_family_guid | GUID of the software product. | String | |
metric_id | Identifier of the license metric. For explanation of the returned values, see: Metric IDs and code names. | String | |
metric_name | Name of the license metric. The value that is returned by the metric_name
parameter is provided as reference and can slightly differ from the value that is provided as a
metric description in Metric ID, code name, and description.
It is best to retrieve metrics by using metric_id or
metric_code_name parameters and then check the exact metric description by
referring to Metric ID, code name, and description. |
String | |
metric_code_name | Code name of the license metric. For explanation of the returned values, see: Metric IDs and code names. | ✓ | String |
hwm_quantity | The highest number of metric units that the product used within the period for which the data is retrieved. When metric quantity is not measured for a particular license metric, the value returned by the hwm_quantity parameter is -1. The value -1 cannot be used for sorting nor filtering. | ✓ | Integer |
threshold | The maximum number of metric units that the product is entitled to use within a computer group. The value is set manually and is used to calculate the metric threshold delta. | Integer | |
threshold_delta | It is calculated by subtracting metric quantity from the threshold. When you specify a threshold for a license metric that is not calculated, the value returned by the threshold_delta parameter is 2147483647. The value 2147483647 cannot be used for sorting nor filtering. | Integer | |
imported_part_numbers | Part number that was imported to BigFix Inventory. It represents the product that is listed in the product_name column and its license metric. | String | |
is_reaggregation_needed | Specifies whether recalculation is needed for the product. The parameter cannot be used to filter or sort the results. | Boolean | |
custom_field_number | Custom field that was added to the All Metrics report. To view the list of all custom fields, view the license_usage.json schema. | Various | |
hwm_peak_time | The date and time when the highest number of metric units was used by a product in the
selected period of time. If the value of hwm_quantity parameter is -1, the
value of hwm_peak_time is meaningless. Note: Retrieving
hwm_peak_time might noticeably increase the time of retrieving the
data. |
String |
Query parameters
Parameter | Description | Required | Value |
---|---|---|---|
columns[] | Specify which columns to retrieve. If you do not specify this parameter, only
default columns are retrieved. Example: Retrieve product name and threshold
delta
|
String | |
computerGroupId | Specify ID of the computer group for which you want to retrieve the data. If
you do not specify this parameter, the data is retrieved for the computer group of the user whose
token is used for authentication. If you specify the parameter, you can retrieve the data for a
subgroup of this computer group. To view IDs of computer groups, log in to BigFix Inventory and go to . Then, hover of the icon , click Configure View, and select the ID column to display it on the report. Example: Retrieve data for computer group
5
|
Integer | |
order | Specify how to sort the retrieved data. The default direction for sorting
columns is ascending. If you want to specify a descending sort, append desc to the
column name. Example: Order by threshold
delta
|
Alphanumeric | |
limit | Specify the number of rows to retrieve. If you omit this parameter, all rows
are retrieved. Example: Retrieve 100 records
|
Numeric | |
offset | Specify the number of rows to skip for retrieving results. You can use it
together with the limit parameter to paginate results. Example: Retrieve 50
records starting after record
150
|
Numeric | |
startdate | Specify the date starting from which you want to retrieve the data. Specify it in the
YYYY-MM-DD format. If you do not specify the filter, its default value is the date
of the last successful import of data to BigFix Inventory minus the
number of days for which data is calculated in the computer group (90 days by default).Example:
Retrieve data starting from 14th July
2017
|
Date | |
enddate | Specify the date until which you want to retrieve the data. Specify it in the
YYYY-MM-DD format. If you do not specify the filter, its default value is the date
of the last successful import of data to BigFix Inventory.Example:
Retrieve data from 1st October 2017 to 31st October
2017
|
Date | |
token | A unique user authentication identifier. You can retrieve it by using REST API for retrieving authentication token. You can also log in to BigFix Inventory, hover over the User icon , and click Profile. Then, click Show token. | ✓ | Alphanumeric |
criteria | Retrieve records which match specific conditions. The parameter should have the following
structure, written in one line:
Note: The
license_usage REST API does not support nested filtering criteria.Example 1: Retrieve software instances whose product name contains "BigFix" AND the threshold
delta is below
0
In
case of the Example 2: Retrieve software products for which the threshold is
specified
Example
3: Retrieve software products for which the threshold is not
specified
If you created custom fields that use the date values, you can retrieve data also for a period instead of a specific date. To do so, use last or next as <operator>, and then specify the time value in the following convention: PxD/PxW/PxM/PxY, where x is a number in the 1-999 range, and D, W, M, or Y is a designator that represents days, weeks, months, or years respectively. Example 4: Retrieve software products
for which entitlement ends within next
month
For more information about operators, see: Common connectors and operators. |
String |
Example conversation - default columns
- Request
-
GET api/sam/v2/license_usage?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Response header
-
Status Code: 200 OK Content-Type: application/json computerGroupId: 0 enddate: 2017-10-31 startdate: 2017-10-01
- Response body
-
[{ "product_publisher_name": "IBM", "product_name": "WebSphere Service Registry and Repository", "metric_code_name": "PVU_FULL_CAP", "hwm_quantity": 480 }]
Example conversation - all columns
- Request
-
GET api/sam/v2/license_usage?columns[]=product_publisher_name&columns[]=product_id &columns[]=product_name&columns[]=product_family_guid&columns[]=metric_id &columns[]=metric_name&columns[]=metric_code_name&columns[]=hwm_quantity &columns[]=threshold&columns[]=threshold_delta&columns[]=imported_part_numbers &columns[]=is_reaggregation_needed&token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Response body
-
[{ "product_publisher_name": "IBM", "product_id": 29258, "product_name": "WebSphere Service Registry and Repository", "product_family_guid": "3b31a72e-468d-47bb-825a-ea26c8e85199", "metric_id": 3, "metric_code_name": "PVU_FULL_CAP", "metric_name": "PVU Full Capacity", "hwm_quantity": 480, "threshold": null, "threshold_delta": null, "imported_part_numbers": null, "is_reaggregation_needed": 0 }]
Example conversation - additional column
- Request
-
GET api/sam/v2/license_usages?columns[]=product_name &columns[]=metric_name&columns[]=threshold_delta &token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Response body
-
[{ "product_name": "WebSphere Service Registry and Repository", "metric_name": "PVU Full Capacity", "threshold_delta": 100 }]
Example conversation - custom field
- Request - check list of created custom fields
-
GET api/sam/v2/schemas/license_usage.json?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623
- Response - list of all columns, including custom fields
-
[{ "product_name": { "type": "string", "description": "Name of the software product." }, ... "custom_field_1": { "type": "date", "title": "Entitlement End" } }]
- Request
-
GET api/sam/v2/license_usages?columns[]=product_name &columns[]=custom_field_1&token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Response body
-
[{ "product_name": "WebSphere Service Registry and Repository", "custom_field_1": "2017-10-01" }]