Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Latest commit

 

History

History
649 lines (452 loc) · 18.7 KB

ReportApi.md

File metadata and controls

649 lines (452 loc) · 18.7 KB

rapid7vmconsole.ReportApi

All URIs are relative to https://localhost:3780

Method HTTP request Description
create_report POST /api/3/reports Reports
delete_report DELETE /api/3/reports/{id} Report
delete_report_instance DELETE /api/3/reports/{id}/history/{instance} Report History
download_report GET /api/3/reports/{id}/history/{instance}/output Report Download
generate_report POST /api/3/reports/{id}/generate Report Generation
get_report GET /api/3/reports/{id} Report
get_report_formats GET /api/3/report_formats Report Formats
get_report_instance GET /api/3/reports/{id}/history/{instance} Report History
get_report_instances GET /api/3/reports/{id}/history Report Histories
get_report_template GET /api/3/report_templates/{id} Report Template
get_report_templates GET /api/3/report_templates Report Templates
get_reports GET /api/3/reports Reports
update_report PUT /api/3/reports/{id} Report

create_report

CreatedReferenceintLink create_report(report=report)

Reports

Configures a new report for generation. Report types are controlled through either or both a format and template. Non-templatized (export) report formats do not require a template and have their output format preset. Templatized (document and file) report formats support a report template that governs the content of the output and the output format can be chosen from a list of supported formats.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
report = rapid7vmconsole.Report() # Report | The specification of a report configuration. (optional)

try:
    # Reports
    api_response = api_instance.create_report(report=report)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->create_report: %s\n" % e)

Parameters

Name Type Description Notes
report Report The specification of a report configuration. [optional]

Return type

CreatedReferenceintLink

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_report

Links delete_report(id)

Report

Deletes the configuration of a report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.

try:
    # Report
    api_response = api_instance.delete_report(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->delete_report: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_report_instance

Links delete_report_instance(id, instance)

Report History

Deletes an instance of a generated report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.
instance = 'instance_example' # str | The identifier of the report instance.

try:
    # Report History
    api_response = api_instance.delete_report_instance(id, instance)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->delete_report_instance: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.
instance str The identifier of the report instance.

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

download_report

str download_report(id, instance)

Report Download

Returns the contents of a generated report. The report content is usually returned in a GZip compressed format.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.
instance = 'instance_example' # str | The identifier of the report instance.

try:
    # Report Download
    api_response = api_instance.download_report(id, instance)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->download_report: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.
instance str The identifier of the report instance.

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/octet-stream, application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

generate_report

ReferenceWithReportIDLink generate_report(id)

Report Generation

Generates a configured report and returns the instance identifier of the report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.

try:
    # Report Generation
    api_response = api_instance.generate_report(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->generate_report: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.

Return type

ReferenceWithReportIDLink

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_report

Report get_report(id)

Report

Returns the configuration details of a report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.

try:
    # Report
    api_response = api_instance.get_report(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_report: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.

Return type

Report

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_report_formats

ResourcesAvailableReportFormat get_report_formats()

Report Formats

Returns all available report formats. A report format indicates an output file format specification (e.g. PDF, XML, etc). Some printable formats may be templated, and others may not. The supported templates for each formated are provided.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()

try:
    # Report Formats
    api_response = api_instance.get_report_formats()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_report_formats: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ResourcesAvailableReportFormat

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_report_instance

ReportInstance get_report_instance(id, instance)

Report History

Returns the details for a generation of the report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.
instance = 'instance_example' # str | The identifier of the report instance.

try:
    # Report History
    api_response = api_instance.get_report_instance(id, instance)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_report_instance: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.
instance str The identifier of the report instance.

Return type

ReportInstance

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_report_instances

ResourcesReportInstance get_report_instances(id)

Report Histories

Returns all historical details for generation of the report over time.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.

try:
    # Report Histories
    api_response = api_instance.get_report_instances(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_report_instances: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.

Return type

ResourcesReportInstance

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_report_template

ReportTemplate get_report_template(id)

Report Template

Returns the details of a report template. Report templates govern the contents generated within a report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 'id_example' # str | The identifier of the report template;

try:
    # Report Template
    api_response = api_instance.get_report_template(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_report_template: %s\n" % e)

Parameters

Name Type Description Notes
id str The identifier of the report template;

Return type

ReportTemplate

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_report_templates

ResourcesReportTemplate get_report_templates()

Report Templates

Returns all available report templates.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()

try:
    # Report Templates
    api_response = api_instance.get_report_templates()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_report_templates: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ResourcesReportTemplate

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_reports

PageOfReport get_reports(page=page, size=size, sort=sort)

Reports

Returns all defined report configurations.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
page = 0 # int | The index of the page (zero-based) to retrieve. (optional) (default to 0)
size = 10 # int | The number of records per page to retrieve. (optional) (default to 10)
sort = ['sort_example'] # list[str] | The criteria to sort the records by, in the format: `property[,ASC|DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters. (optional)

try:
    # Reports
    api_response = api_instance.get_reports(page=page, size=size, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->get_reports: %s\n" % e)

Parameters

Name Type Description Notes
page int The index of the page (zero-based) to retrieve. [optional] [default to 0]
size int The number of records per page to retrieve. [optional] [default to 10]
sort list[str] The criteria to sort the records by, in the format: `property[,ASC DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.

Return type

PageOfReport

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_report

Links update_report(id, report=report)

Report

Updates the configuration details of a report.

Example

from __future__ import print_function
import time
import rapid7vmconsole
from rapid7vmconsole.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = rapid7vmconsole.ReportApi()
id = 56 # int | The identifier of the report.
report = rapid7vmconsole.Report() # Report | The specification of a report configuration. (optional)

try:
    # Report
    api_response = api_instance.update_report(id, report=report)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ReportApi->update_report: %s\n" % e)

Parameters

Name Type Description Notes
id int The identifier of the report.
report Report The specification of a report configuration. [optional]

Return type

Links

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]