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. |
detach_from_datasets |
Remove this capture from all datasets (owner-only). |
listing |
Lists all RF captures in SDS under the current user. |
read |
Reads a specific capture from SDS. |
revoke_share_permissions |
Revoke all direct share permissions on this capture (owner-only). |
update |
Updates a capture in SDS by re-discovering and re-indexing the files. |
Source code in spectrumx/api/captures.py
Methods:
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
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
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
detach_from_datasets
Remove this capture from all datasets (owner-only).
Use before :meth:delete when the capture is still linked to datasets.
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
revoke_share_permissions
Revoke all direct share permissions on this capture (owner-only).
Use this (or the web portal) before :meth:delete when the capture is shared.
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