Scanners
get_scanner(registration_id)
async
Fetch a scanner by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
registration_id |
Union[int, str]
|
The ID of the scanner to fetch. |
required |
Returns:
Type | Description |
---|---|
ScannerRegistration
|
The scanner. |
create_scanner(scanner)
async
Creates a new scanner. Returns location of the created scanner.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scanner |
ScannerRegistrationReq
|
The scanner to create. |
required |
Returns:
Type | Description |
---|---|
str
|
The location of the created scanner. |
update_scanner(registration_id, scanner)
async
Update a scanner.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
registration_id |
Union[int, str]
|
The ID of the scanner to update. |
required |
scanner |
ScannerRegistrationReq
|
The updated scanner definition. |
required |
delete_scanner(registration_id, missing_ok=None)
async
Delete a scanner by ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
registration_id |
Union[int, str]
|
The ID of the scanner to delete. |
required |
missing_ok |
Optional[bool]
|
DEPRECATED: Whether to ignore 404 error when deleting the scanner. |
None
|
Returns:
Type | Description |
---|---|
Optional[ScannerRegistration]
|
The scanner, or None if the scanner is not found and |
Raises:
Type | Description |
---|---|
HarborAPIException
|
Successful deletion request that returns an empty response. |
get_scanners(query=None, sort=None, page=1, page_size=10, limit=None)
async
Get a list of scanners.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
Optional[str]
|
A query string to filter the scanners. Supported query patterns are:
The value of range and list can be:
All of these query patterns should be put in the query string
and separated by |
None
|
sort |
Optional[str]
|
The sort order of the scanners. |
None
|
page |
int
|
The page of results to return |
1
|
page_size |
int
|
The number of results to return per page |
10
|
limit |
Optional[int]
|
The maximum number of results to return |
None
|
Returns:
Type | Description |
---|---|
List[ScannerRegistration]
|
description |
set_default_scanner(registration_id, is_default=True)
async
ping_scanner_adapter(settings)
async
Ping a scanner adapter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings |
ScannerRegistrationSettings
|
The settings of the scanner adapter. |
required |