API v2: Reports¶
Data Structures¶
Attribute | Type | Required | Description |
---|---|---|---|
id | string | Unique and read-only report subscription identifier | |
defined_report_id | string | Defined report identifier. | |
user_id | string | Identifier of the user who created the report. | |
period | string {day, week, month, quarter, year} | Period of generating reports. | |
created_by | string | Identifier of the user who created the report. | |
created_at | string | Read-only. Timestamp of creation. | |
modified_at | string | Read-only. Timestamp of modification. | |
removed | boolean | Read-only |
Request for Retrieving Available Attributes of the DefinedReportSubscriptionModel
Method | GET
|
Path | /api/v2/objspec/defined_report_subscription
|
Attribute | Type | Required | Description |
---|---|---|---|
id | string | Unique and read-only object Identifier | |
title | string | Report title. | |
defined_report_id | string | Defined report identifier. | |
generated_at | string | Read-only. Report generated timestamp. | |
created_by | string | Identifier of the user who created the report. | |
created_at | string | Read-only. Timestamp of creation. | |
modified_at | string | Read-only. Timestamp of modification. | |
removed | boolean | Read-only |
Request for Retrieving Available Attributes of the ReportModel
Method | GET
|
Path | /api/v2/objspec/report
|
Attribute | Type | Required | Description |
---|---|---|---|
id | string | Unique and read-only object Identifier | |
title | string | Defined report title. | |
type | string | Defined report type. | |
created_by | string | Identifier of the user who created the report. | |
created_at | string | Read-only. Timestamp of creation. | |
modified_at | string | Read-only. Timestamp of modification. | |
removed | boolean | Read-only |
Request for Retrieving Available Attributes of the DefinedReportModel
Method | GET
|
Path | /api/v2/objspec/defined_report
|
Note
To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.
The next chapter describes procedures for creating separate requests.
Retrieving Existing Reports List¶
Request
Method | GET
|
Path | /api/v2/report
|
Example Request
Sending GET https://10.0.0.0/api/v2/report
curl -s -k -X GET -H 'Authorization: sgfeea6jsaz4mum9su8w61877n1g06sk' 'https://10.0.214.98/api/v2/report'
Retrieving Defined Reports List¶
Request
Method | GET
|
Path | /api/v2/report
|
Example Request
Sending GET https://10.0.0.0/api/v2/report/defined
curl -s -k -X GET -H 'Authorization: sgfeea6jsaz4mum9su8w61877n1g06sk' 'https://10.0.214.98/api/v2/report/defined'
Retrieving Defined Report Subscriptions List¶
Request
Method | GET
|
Path | /api/v2/report/subscription
|
Example Request
Sending GET https://10.0.0.0/api/v2/report/subscription
curl -s -k -X GET -H 'Authorization: sgfeea6jsaz4mum9su8w61877n1g06sk' 'https://10.0.214.98/api/v2/report/subscription'
Retrieving or Downloading Report File¶
Request
Method | GET
|
Path | /api/v2/report/<id>/<ext>
|
Path | /api/v2/report/download/<id>/<ext>
|
You can use one of three available extensions: csv, pdf, or html.
Example Request
Sending GET https://10.0.0.0/api/v2/report/9124292845052624897/html
curl -s -k -X GET -H 'Authorization: sgfeea6jsaz4mum9su8w61877n1g06sk' 'https://10.0.214.98/api/v2/report/9124292845052624897html'
Response
Report in HTML.
Defining Report Subscription¶
Request
Method | POST
|
Path | /api/v2/report/subscription
|
Headers | Content-Type: Application/HTML
|
Body | DefinedReportSubscriptionModel
|
In the table below are the defined_report_id
values and their corresponding titles required to define the subscription report.
Value of defined_report_id |
Title |
---|---|
5 | System report |
6 | Account access report |
7 | Safe access report |
8 | Server access report |
9 | Session approvals by user |
10 | Session sharing invites by user |
11 | Session summary |
12 | Sessions by server report |
13 | User access report |
14 | User activity report |
15 | User privilege report |
16 | User report |
Example Request
Sending POST https://10.0.0.0/api/v2/report/subscription
curl -s -k -X POST -H 'Authorization: sgfeea6jsaz4mum9su8w61877n1g06sk' 'https://10.0.214.98/api/v2/report/subscription' -H 'Content-Type: application/json' -d'{"period":"day","defined_report_id":"6"}'
Response
{
"defined_report_subscription": {
"id": "9124292845052624899"
},
"result": "success"
}
Generating Reports on Demand¶
Request
Method | POST
|
Path | /api/v2/report
|
Headers | Content-Type: Application/HTML
|
Body | ReportModel
|
Example Request
Sending POST https://10.0.0.0/api/v2/report
curl -s -k -X POST -H 'Authorization: sgfeea6jsaz4mum9su8w61877n1g06sk' 'https://10.0.214.98/api/v2/report' -H 'Content-Type: application/json' -d'{"criteria":[{"field":"protocol","value":"ssh"},{"field":"user","value":"5620492334958379010"}]}
Response
{
"report": {
"id": "5620492334958379016"
},
"result": "success"
}
Deleting Report¶
Request
Method | DELETE
|
Path | /api/v2/report/<id>
|
Example Request
Sending DELETE https://10.0.0.0/api/v2/report/9124292845052624902
curl -s -k -X DELETE -H 'Authorization: vg1ei6rgo58fsbobr7octp0w3afd9vsm' https://10.0.214.98/api/v2/report/9124292845052624902
Response
{
"result": "success"
}
Deleting Defined Report Subscription¶
Request
Method | DELETE
|
Path | /api/v2/report/subscription/<id>
|
Example Request
Sending DELETE https://10.0.0.0/api/v2/report/subscription/9124292845052624902
curl -s -k -X DELETE -H 'Authorization: vg1ei6rgo58fsbobr7octp0w3afd9vsm' https://10.0.214.98/api/v2/report/subscription/9124292845052624902
Response
{
"result": "success"
}