REST API for retrieving audit snapshots
Available from 9.2.38.
You can use the GET
operation on
the restapi/v2/audit_snapshot
element to generate the audit snapshot.
Enabling REST API in upgraded License Metric Tool
- If you upgraded to application update 9.2.38, REST API for retrieving audit snapshots is not enabled by default. To enable the REST API, edit the web.xml file. For more information, see: Enabling REST API for retrieving audit snapshots in upgraded License Metric Tool.
- If you upgraded to application update 9.2.38.1 or later, the REST API is enabled by default and you do not need to perform this procedure.
Permissions
You must have the View License Metric and View Audit Trail permissions to perform this
task.
Resource URL
https://server_url:server_port/restapi/v2/audit_snapshot
Resource information
Operation details | Description |
---|---|
HTTP method | GET |
Request headers |
|
Request format | application/json |
Response headers |
|
Response payload | Compressed ZIP file. |
Response format | application/octet-stream |
Response codes |
|
Query parameters
Parameter | Description | Required | Value |
---|---|---|---|
startdate | Start date of the audit snapshot in the YYYY-MM-DD
format. |
✓ | String |
enddate | End date of the audit snapshot in the YYYY-MM-DD
format. |
✓ | String |
computerGroupId | Identifier of the computer group for which the audit snapshot is generated. If the computer group is not provided, the snapshot is generated for the computer group to which the user is assigned. | String | |
reportId | Identifier of the saved report view of the All Metrics report for which you want to generate the audit snapshot. If the ID is not provided, the report is generated for the whole All Metrics report. | String | |
comment | Comment that you want to include in the audit snapshot. Only ASCII characters are accepted.
Spaces need to be escaped by using the %20 or + , for example:
|
String | |
locale | Locale of the audit snapshot. If not locale is provided, the snapshot is generated in
en-US . |
|
|
obfuscate | Indicates whether sensitive data including server names, computer names, and IP addresses
should be obfuscated in the audit snapshot. By default, the data is not obfuscated. Note: If you want
to include a file that allows to de-obfuscate the data in the audit snapshot, set the value of the
include_mapping_file_to_obfuscated_audit_snapshot_report parameter to
True on the Advanced Server Settings panel.
|
|
Example conversation with the minimal set of parameters
The following example shows how to generate the audit snapshot by providing the minimal set of
required parameters: start date and end date. The example conversation uses cURL commands. You can
use a different method of making REST API calls.
- Request
- To generate the audit snapshot, use the following GET request.
Where:curl -X GET -k -J -O -H "Token: token" "https://server_url:server_port/restapi/v2/audit_snapshot? startdate=2024-07-13&enddate=2024-10-11" -s -D -
- -X
- Specifies the type of the HTTP request.
- -k
- Use this option to disable License Metric Tool certificate verification procedure.
- -J -O
- Indicates that the name of the file with the audit snapshot will be based on the information
that is returned in the
Content-Disposition
element: audit_snapshot_timestamp.zip - -H
- Specifies the header of the request.
- -s
- Indicates that the progress of creating the file is not shown.
- -D -
- Indicates that the response status is returned.
- token
- Specifies the token that is used to authenticate REST API requests.
- Response
-
Important: The audit snapshot cannot be generated during the import. If generating the snapshot is triggered during the import, the
409
error is returned. The generated file does not have the .zip extension and cannot be used.HTTP/1.1 200 OK Strict-Transport-Security: max-age=31536000 Content-Type: application/octet-stream Content-Disposition: attachment; filename="audit_snapshot_2024-10-23_15-00-51.625.zip" Content-Length: 157904 Content-Language: en-US Date: Wed, 23 Oct 2024 15:00:51 GMT
Example conversation with additional parameters
The following example shows how to generate the audit snapshot for a specific saved report view
of the All Metrics report, and for a selected computer group. The example conversation uses cURL
commands. You can use a different method of making REST API calls.
- Request
-
- To obtain the ID of the report view for which you want to generate the snapshot, perform the
following steps.
- Log in to License Metric Tool, hover over Reports, and click Saved Reports.
- Hover over Configure, and click Configure View.
- Select ID, and click Submit. ID of the saved report view is provided in the ID column.
- To obtain the ID of the computer group for which you want to generate the snapshot, perform the
following steps.
- In the top navigation bar, hover over Reports, and click Computer Groups.
- Hover over Configure, and click Configure View.
- Select ID, and click Submit. ID of the computer group is provided in the ID column.
- To generate the audit snapshot, use the following GET request.
Where:curl -X GET -k -J -O -H "Token: token" "https://server_url:server_port/restapi/v2/audit_snapshot? startdate=2024-07-13&enddate=2024-10-11" -s -D -
- -X
- Specifies the type of the HTTP request.
- -k
- Use this option to disable License Metric Tool certificate verification procedure.
- -J -O
- Indicates that the name of the file with the audit snapshot will be based on the information
that is returned in the
Content-Disposition
element: audit_snapshot_timestamp.zip - -H
- Specifies the header of the request.
- -s
- Indicates that the progress of creating the file is not shown.
- -D -
- Indicates that the response status is returned.
- token
- Specifies the token that is used to authenticate REST API requests.
- To obtain the ID of the report view for which you want to generate the snapshot, perform the
following steps.
- Response
-
HTTP/1.1 200 OK Strict-Transport-Security: max-age=31536000 Content-Type: application/octet-stream Content-Disposition: attachment; filename="audit_snapshot_2024-10-23_15-00-51.625.zip" Content-Length: 157904 Content-Language: en-US Date: Wed, 23 Oct 2024 15:00:51 GMT