Export

Methods described in this section relate to the unified export API for TenableOne. These methods can be accessed at TenableOne.inventory.export.

class ExportAPI(api: APISession)[source]
assets(filters: List[PropertyFilter] | None = None, query: Query | None = None, properties: List[str] | None = None, use_readable_name: bool | None = None, max_chunk_file_size: int | None = None, sort_by: str | None = None, sort_direction: SortDirection | None = None, file_format: DatasetFileFormat | None = None, compress: bool | None = None) ExportRequestId[source]

Export assets from TenableOne inventory

Parameters:
  • filters (list[PropertyFilter], optional) – A list of filters to apply to the export. Defaults to None.

  • query (Query, optional) – The query to apply.

  • properties (list[str], optional) – Properties to include about the assets returned in the search results. List of property names. Defaults to None.

  • use_readable_name (bool, optional) – If true, the readable name of the property will be used instead of the internal (key) name. Defaults to True.

  • max_chunk_file_size (int, optional) – Maximum size in bytes for each chunk file when exporting large datasets. Defaults to 20971520 (20 MB).

  • sort_by (str, optional) – Field to sort by.

  • sort_direction (SortDirection, optional) – Sorting direction, either SortDirection.ASC or SortDirection.DESC.

  • file_format (DatasetFileFormat, optional) – The file format to be received. If not specified, the default format will be JSON. Supported formats include: CSV and JSON. Defaults to DatasetFileFormat.JSON.

  • compress (bool, optional) – Whether to compress the export using GZIP compression. Compressed files are smaller but require decompression before processing.

Returns:

The export request ID.

Return type:

ExportRequestId

Examples

>>> export_id = tenable_one.inventory.export.assets(
...     properties=["cpe", "version", "file_location"],
...     sort_by="name",
...     sort_direction=SortDirection.ASC,
...     file_format=DatasetFileFormat.CSV
... )
>>> print(export_id.export_id)
assets_status(status: str | None = None, limit: int | None = None) ExportJobsResponse[source]

List asset export jobs submitted in the last 3 days

This endpoint only returns asset export jobs that were submitted within the last 3 days. Results are sorted by last refreshed time (newest first).

Parameters:
  • status (str, optional) – Filter by export status (e.g., ‘FINISHED’, ‘PROCESSING’, ‘ERROR’). Multiple values can be provided as a comma-separated string (e.g., ‘FINISHED,PROCESSING’).

  • limit (int, optional) – Maximum number of export jobs to return from the last 3 days. Note: This endpoint only returns jobs submitted within the last 3 days, so the actual number of results may be less than the limit if fewer jobs exist within that time window. Defaults to 1000 if not specified. Minimum: 1, Maximum: 1000.

Returns:

Response containing list of asset export job information from the last 3 days.

Return type:

ExportJobsResponse

Examples

>>> response = tenable_one.inventory.export.assets_status()
>>> for job in response.exports:
...     print(f"Export ID: {job.export_id}, Status: {job.status}")
>>> # Filter by status
>>> finished_jobs = tenable_one.inventory.export.assets_status(status='FINISHED')
>>> # Limit results to 100 most recent jobs
>>> recent_jobs = tenable_one.inventory.export.assets_status(limit=100)
download(export_id: str, chunk_id: str, fobj: BytesIO | None = None) bytes | BytesIO[source]

Download export chunk

Parameters:
  • export_id (str) – The export ID.

  • chunk_id (str) – The chunk ID to download.

  • fobj (BytesIO, optional) – A file-like object to write the downloaded data to. If not provided, the data will be returned as bytes. If provided, the data will be streamed directly to the file object and the file object will be returned.

Returns:

The exported data as bytes if fobj is not provided, or the file object if fobj is provided.

Return type:

Union[bytes, BytesIO]

Examples

Download to bytes: >>> data = tenable_one.inventory.export.download(“export-123”, “0”) >>> with open(“export.csv”, “wb”) as f: … f.write(data)

Stream to file object: >>> with open(“export.csv”, “wb”) as f: … fobj = BytesIO() … tenable_one.inventory.export.download(“export-123”, “0”, fobj) … f.write(fobj.getvalue())

findings(filters: List[PropertyFilter] | None = None, query: Query | None = None, properties: List[str] | None = None, use_readable_name: bool | None = None, max_chunk_file_size: int | None = None, sort_by: str | None = None, sort_direction: SortDirection | None = None, file_format: DatasetFileFormat | None = None, compress: bool | None = None) ExportRequestId[source]

Export findings from TenableOne inventory

Parameters:
  • filters (list[PropertyFilter], optional) – A list of filters to apply to the export. Defaults to None.

  • query (Query, optional) – The query to apply.

  • properties (list[str], optional) – Properties to include about the findings returned in the search results. List of property names. Defaults to None.

  • use_readable_name (bool, optional) – If true, the readable name of the property will be used instead of the internal (key) name. Defaults to True.

  • max_chunk_file_size (int, optional) – Maximum size in bytes for each chunk file when exporting large datasets. Defaults to 20971520 (20 MB).

  • sort_by (str, optional) – Field to sort by.

  • sort_direction (SortDirection, optional) – Sorting direction, either SortDirection.ASC or SortDirection.DESC.

  • file_format (DatasetFileFormat, optional) – The file format to be received. If not specified, the default format will be JSON. Supported formats include: CSV and JSON. Defaults to DatasetFileFormat.JSON.

  • compress (bool, optional) – Whether to compress the export using GZIP compression. Compressed files are smaller but require decompression before processing.

Returns:

The export request ID.

Return type:

ExportRequestId

Examples

>>> export_id = tenable_one.inventory.export.findings(
...     properties=["severity", "status", "created_at"],
...     sort_by="severity",
...     sort_direction=SortDirection.DESC,
...     file_format=DatasetFileFormat.CSV
... )
>>> print(export_id.export_id)
findings_status(status: str | None = None, limit: int | None = None) ExportJobsResponse[source]

List finding export jobs submitted in the last 3 days

This endpoint only returns finding export jobs that were submitted within the last 3 days. Results are sorted by last refreshed time (newest first).

Parameters:
  • status (str, optional) – Filter by export status (e.g., ‘FINISHED’, ‘PROCESSING’, ‘ERROR’). Multiple values can be provided as a comma-separated string (e.g., ‘FINISHED,PROCESSING’).

  • limit (int, optional) – Maximum number of export jobs to return from the last 3 days. Note: This endpoint only returns jobs submitted within the last 3 days, so the actual number of results may be less than the limit if fewer jobs exist within that time window. Defaults to 1000 if not specified. Minimum: 1, Maximum: 1000.

Returns:

Response containing list of finding export job information from the last 3 days.

Return type:

ExportJobsResponse

Examples

>>> response = tenable_one.inventory.export.findings_status()
>>> for job in response.exports:
...     print(f"Export ID: {job.export_id}, Status: {job.status}")
>>> # Filter by status
>>> finished_jobs = tenable_one.inventory.export.findings_status(status='FINISHED')
>>> # Limit results to 100 most recent jobs
>>> recent_jobs = tenable_one.inventory.export.findings_status(limit=100)
status(export_id: str) ExportRequestStatus[source]

Get export status

Parameters:

export_id (str) – The export ID to check status for.

Returns:

The export status information.

Return type:

ExportRequestStatus

Examples

>>> status = tenable_one.inventory.export.status("export-123")
>>> print(f"Status: {status.status}")
>>> print(f"Chunks available: {status.chunks_available}")