Retrieval of license usage
You use the GET
operation on the api/sam/license_usages
element
to request information about license usage reported by your computer
systems.
This API retrieves peak license usage over the last 90
days. PVU and RVU full capacity and subcapacity license usage is retrieved
only on the host computer system level. To retrieve information about
license usage reported by your computer systems, use the following
URL:
https://hostname:port/api/sam/license_usages?token=token
Important:
- To use this API, you must be assigned to the All Computers group and have the View License Metrics permission.
- Each API request must be authenticated with the token parameter. 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.
- This API retrieves data for the last 90 days, until the last successful import.
- By default, the data retrieves is sorted by
computer_system_id
,software_title_id
, andmetric_name
columns.
Operation details | Description |
---|---|
Operation | GET /api/sam/license_usages |
Purpose | Returns information about license usage |
HTTP method | GET |
Resource URI | https://server_host_name:port_number/api/sam/license_usages |
URL link relation | n/a |
URI query parameters | For a list of applicable query parameters, see: Query parameters. |
Request headers |
Used to negotiate the language of the response. If this header is not specified, the content is returned in the server language. |
Request payload | n/a |
Request Content-Type |
|
Response headers |
Specifies the content type of the response. |
Specifies the language of the response content. If this header is not specified, the content is returned in the server language. |
|
Specifies the import status. |
|
Specifies the percentage progress of an import. |
|
Specifies the status of the last import. |
|
Specifies the time of the last successful import. |
|
Response payload | License Usages element |
Response Content-Type |
|
Normal HTTP response codes |
|
Error HTTP response codes |
Message body includes an error message with details. |
Query parameters
You
can use query parameters to narrow down the results of your search.
The following table presents query parameters that you can use for
the api/sam/license_usages element.
Parameter | Description | Required | Value |
---|---|---|---|
columns[] | Specify which columns to retrieve. If you do
not specify this parameter, a set of default columns is retrieved.
Example: Retrieve the name and version columns:
|
No | String |
order | Specify how to sort the returned 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 peak license usage descending:
|
No | String |
limit | Specify the number of rows to retrieve. If you omit this parameter, all rows are retrieved. | No | 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:
|
No | Numeric |
token | A unique user authentication identifier. You can view your token in the Profile preferences of BigFix Inventory. | Yes | Alphanumeric |
criteria | Retrieve records which match specific
conditions. The parameter should have the following structure, written
on one line:
For more information about operators, see Common connectors and operators. Example: Retrieve license usage
for software whose publisher name contains "BigFix":
|
Example HTTP conversation
- Request
GET api/sam/license_usages ?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623 Host: localhost:9081 Accept: application/json Accept-Language: en-US
- Response header
HTTP/1.1 200 OK Content-Type: application/json Content-Language: en-US
- Response body (JSON)
- If a particular entry is hidden by default, it is not retrieved
by using the general URL. To retrieve such data, you must use query
parameters to specify the name of the hidden column. For example,
you can retrieve the
software_title_dimension.name
column by using the columns[] parameter:URL?columns[]=software_title_dimension.name
{ "software_title_id": 36181, "metric_name": "RVU_FULL_CAP", "computer_system_id": 4, "peak_value": 1, "peak_date": "2014-04-14", "peak_time": "2014-04-14T13:05:10Z", "reporting_period_start_date": "2014-04-01", "reporting_period_end_date": "2014-04-30", "software_title_dimension": //hidden by default { "name": "BigFix Protection", "guid": "d78048cf-842b-44e8-8036-e7e2bf8afb31", "publisher_name": "BigFix", "publisher_guid": "8a759f0c-b91a-4d7d-8c4a-a9d85e06c13d" } }