harbor_client.ScanAllApi

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

MethodHTTP requestDescription
create_scan_all_schedulePOST /system/scanAll/scheduleCreate a schedule or a manual trigger for the scan all job.
get_latest_scan_all_metricsGET /scans/all/metricsGet the metrics of the latest scan all process
get_latest_scheduled_scan_all_metricsGET /scans/schedule/metricsGet the metrics of the latest scheduled scan all process
get_scan_all_scheduleGET /system/scanAll/scheduleGet scan all's schedule.
stop_scan_allPOST /system/scanAll/stopStop scanAll job execution
update_scan_all_schedulePUT /system/scanAll/scheduleUpdate scan all's schedule.

create_scan_all_schedule

Signature

create_scan_all_schedule(schedule: Schedule, x_request_id: Optional[str])-> None

Create a schedule or a manual trigger for the scan all job.

This endpoint is for creating a schedule or a manual trigger for the scan all job, which scans all of images in Harbor.

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.ScanAllApi(harbor_client.ApiClient(configuration))
schedule = harbor_client.Schedule() # Schedule | Create a schedule or a manual trigger for the scan all job.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Create a schedule or a manual trigger for the scan all job.
    api_instance.create_scan_all_schedule(schedule, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling ScanAllApi->create_scan_all_schedule: %s\n" % e)

Parameters

NameTypeDescriptionNotes
scheduleScheduleCreate a schedule or a manual trigger for the scan all job.
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

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

[Back to top]

get_latest_scan_all_metrics

Signature

get_latest_scan_all_metrics(x_request_id: Optional[str])-> Stats

Get the metrics of the latest scan all process

Get the metrics of the latest scan all process

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.ScanAllApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the metrics of the latest scan all process
    api_response = api_instance.get_latest_scan_all_metrics(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanAllApi->get_latest_scan_all_metrics: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

Stats

Authorization

basic

HTTP request headers

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

[Back to top]

get_latest_scheduled_scan_all_metrics

Signature

get_latest_scheduled_scan_all_metrics(x_request_id: Optional[str])-> Stats

Get the metrics of the latest scheduled scan all process

Get the metrics of the latest scheduled scan all process

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.ScanAllApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the metrics of the latest scheduled scan all process
    api_response = api_instance.get_latest_scheduled_scan_all_metrics(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanAllApi->get_latest_scheduled_scan_all_metrics: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

Stats

Authorization

basic

HTTP request headers

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

[Back to top]

get_scan_all_schedule

Signature

get_scan_all_schedule(x_request_id: Optional[str])-> Schedule

Get scan all’s schedule.

This endpoint is for getting a schedule for the scan all job, which scans all of images in Harbor.

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.ScanAllApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get scan all's schedule.
    api_response = api_instance.get_scan_all_schedule(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ScanAllApi->get_scan_all_schedule: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

Schedule

Authorization

basic

HTTP request headers

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

[Back to top]

stop_scan_all

Signature

stop_scan_all(x_request_id: Optional[str])-> None

Stop scanAll job execution

Stop scanAll job execution

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.ScanAllApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Stop scanAll job execution
    api_instance.stop_scan_all(x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling ScanAllApi->stop_scan_all: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

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

[Back to top]

update_scan_all_schedule

Signature

update_scan_all_schedule(schedule: Schedule, x_request_id: Optional[str])-> None

Update scan all’s schedule.

This endpoint is for updating the schedule of scan all job, which scans all of images in Harbor.

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.ScanAllApi(harbor_client.ApiClient(configuration))
schedule = harbor_client.Schedule() # Schedule | Updates the schedule of scan all job, which scans all of images in Harbor.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Update scan all's schedule.
    api_instance.update_scan_all_schedule(schedule, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling ScanAllApi->update_scan_all_schedule: %s\n" % e)

Parameters

NameTypeDescriptionNotes
scheduleScheduleUpdates the schedule of scan all job, which scans all of images in Harbor.
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

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

[Back to top]