Captures API | <Client>.captures
spectrumx.api.captures
API functions specific to captures.
Classes:
| Name | Description |
|---|---|
CaptureAPI |
|
Classes
CaptureAPI
Methods:
| Name | Description |
|---|---|
advanced_search |
Advanced searches for RF captures in SDS. |
create |
Creates a new RF capture in SDS. |
delete |
Deletes a capture from SDS by its UUID. |
listing |
Lists all RF captures in SDS under the current user. |
read |
Reads a specific capture from SDS. |
update |
Updates a capture in SDS by re-discovering and re-indexing the files. |
Source code in spectrumx/api/captures.py
Functions
advanced_search
advanced_search(
*,
field_path: str,
query_type: str,
filter_value: str | dict[str, Any],
) -> list[Capture]
Advanced searches for RF captures in SDS.
SDS querying examples: https://github.com/spectrumx/sds-code/tree/master/gateway#opensearch-query-tips
OpenSearch query DSL documentation: https://docs.opensearch.org/docs/latest/query-dsl/
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_path
|
str
|
The field to search captures by e.g.:
|
required |
query_type
|
str
|
The type of query to perform e.g.:
|
required |
filter_value
|
str | dict[str, Any]
|
required |
Returns: A list of captures matching the query.
Source code in spectrumx/api/captures.py
create
create(
*,
top_level_dir: Path | PurePosixPath,
capture_type: CaptureType,
index_name: str = "",
channel: str | None = None,
scan_group: str | None = None,
name: str | None = None,
) -> Capture
Creates a new RF capture in SDS.
An SDS capture is a collection of RF files that follow a predetermined structure which makes them suitable for indexing and searching. Example capture types include Digital-RF and RadioHound. The exact file structure and what files get indexed depend on the capture type.
Notes:
-
This method doesn't upload files, it is a lightweight method that only groups files already in SDS into a capture. To upload files, see
upload()andupload_file()from your SDS client instance. -
The
top_level_diris the path in SDS relative to your user directory where the files were uploaded to, not your local filesystem path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
top_level_dir
|
Path | PurePosixPath
|
Virtual directory in SDS where capture files are stored. |
required |
capture_type
|
CaptureType
|
One of |
required |
index_name
|
str
|
The SDS index name. Leave empty to automatically select. |
''
|
channel
|
str | None
|
(For Digital-RF) the DRF channel name to index. |
None
|
scan_group
|
str | None
|
(For RadioHound) UUIDv4 that groups RH files. |
None
|
name
|
str | None
|
Optional custom name for the capture. |
None
|
Returns: The created capture object. Raises: CaptureError: If the capture couldn't be created e.g.: if it already exists, or the user doesn't have permission to create it.
Source code in spectrumx/api/captures.py
delete
Deletes a capture from SDS by its UUID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_uuid
|
UUID
|
The UUID of the capture to delete. |
required |
Returns: True if the capture was deleted successfully, or if in dry run mode. Raises: CaptureError: If the capture couldn't be deleted e.g.: if it doesn't exist; if it has already been deleted; if this user doesn't own it.
Source code in spectrumx/api/captures.py
listing
listing(
*, capture_type: CaptureType | None = None
) -> list[Capture]
Lists all RF captures in SDS under the current user.
Note a capture must be manually ".create()-d" before it can be listed, even
if all the files are uploaded to SDS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_type
|
CaptureType | None
|
The type of capture to list. If empty, it lists everything. |
None
|
Returns: A list of the RF captures found owned by the requesting user.
Source code in spectrumx/api/captures.py
read
read(capture_uuid: UUID) -> Capture
Reads a specific capture from SDS.
This differs from the .listing() method by retrieving more information about
the capture, including the associated files' UUID, directory, and name;
useful when working with a specific capture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_uuid
|
UUID
|
The UUID of the capture to read. |
required |
Returns: The capture object.
Source code in spectrumx/api/captures.py
update
Updates a capture in SDS by re-discovering and re-indexing the files.
Note that, just like the .create(), this method doesn't upload files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
capture_uuid
|
UUID
|
The UUID of the capture to update. |
required |
Returns: None