harbor_client.ScanDataExportApi

All URIs are relative to http://localhost/api/v2.0

MethodHTTP requestDescription
download_scan_dataGET /export/cve/download/{execution_id}Download the scan data export file
export_scan_dataPOST /export/cveExport scan data for selected projects
get_scan_data_export_executionGET /export/cve/execution/{execution_id}Get the specific scan data export execution
get_scan_data_export_execution_listGET /export/cve/executionsGet a list of specific scan data export execution jobs for a specified user

download_scan_data

Signature

download_scan_data(execution_id: int, x_request_id: Optional[str], format: Optional[str])-> str

Download the scan data export file

Download the scan data report. Default format is CSV

Example

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

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.ScanDataExportApi(harbor_client.ApiClient(configuration))
execution_id = 56 # int | Execution ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
format = 'format_example' # str | The format of the data to be exported. e.g. CSV or PDF (optional)

try:
    # Download the scan data export file
    api_response = api_instance.download_scan_data(execution_id, x_request_id=x_request_id, format=format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanDataExportApi->download_scan_data: %s\n" % e)

Parameters

NameTypeDescriptionNotes
execution_idintExecution ID
x_request_idstrAn unique ID for the request[optional]
formatstrThe format of the data to be exported. e.g. CSV or PDF[optional]

Return type

str

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: text/csv

[Back to top]

export_scan_data

Signature

export_scan_data(x_scan_data_type: str, criteria: ScanDataExportRequest, x_request_id: Optional[str])-> ScanDataExportJob

Export scan data for selected projects

Export scan data for selected projects

Example

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

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.ScanDataExportApi(harbor_client.ApiClient(configuration))
x_scan_data_type = 'x_scan_data_type_example' # str | The type of scan data to export
criteria = harbor_client.ScanDataExportRequest() # ScanDataExportRequest | The criteria for the export
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Export scan data for selected projects
    api_response = api_instance.export_scan_data(x_scan_data_type, criteria, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanDataExportApi->export_scan_data: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_scan_data_typestrThe type of scan data to export
criteriaScanDataExportRequestThe criteria for the export
x_request_idstrAn unique ID for the request[optional]

Return type

ScanDataExportJob

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

get_scan_data_export_execution

Signature

get_scan_data_export_execution(execution_id: int, x_request_id: Optional[str])-> ScanDataExportExecution

Get the specific scan data export execution

Get the scan data export execution specified by ID

Example

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

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.ScanDataExportApi(harbor_client.ApiClient(configuration))
execution_id = 56 # int | Execution ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the specific scan data export execution
    api_response = api_instance.get_scan_data_export_execution(execution_id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanDataExportApi->get_scan_data_export_execution: %s\n" % e)

Parameters

NameTypeDescriptionNotes
execution_idintExecution ID
x_request_idstrAn unique ID for the request[optional]

Return type

ScanDataExportExecution

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

get_scan_data_export_execution_list

Signature

get_scan_data_export_execution_list(x_request_id: Optional[str])-> ScanDataExportExecutionList

Get a list of specific scan data export execution jobs for a specified user

Get a list of specific scan data export execution jobs for a specified user

Example

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

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.ScanDataExportApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get a list of specific scan data export execution jobs for a specified user
    api_response = api_instance.get_scan_data_export_execution_list(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanDataExportApi->get_scan_data_export_execution_list: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

ScanDataExportExecutionList

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]