Client SDK Python API Reference
This page provides a comprehensive reference for the Aria Client SDK Python API, which enables control and data streaming from Aria devices.
Utility Functions
set_log_level(level: Level) -> None
Set the SDK log verbosity level.
Parameters:
level(Level): The desired log level
Example:
import aria.sdk_gen2 as sdk_gen2
from aria.sdk import Level
sdk_gen2.set_log_level(Level.INFO)
Core Classes
DeviceClient
The DeviceClient class manages connections to Aria devices and handles device discovery.
Constructor
DeviceClient()
Creates a new DeviceClient instance.
Methods
authenticate(target: DeviceTarget = DeviceTarget()) -> str
Authenticate with the device using credentials.
Parameters:
target(DeviceTarget, optional): Target device to authenticate with. Defaults to an empty DeviceTarget (auto-detect).
Returns: Certificate hash pushed to the device (str)
Raises: RuntimeError if authentication fails
connect(target: DeviceTarget = DeviceTarget()) -> Device
Establish a connection to an Aria device.
Parameters:
target(DeviceTarget, optional): Target device to connect to. Defaults to an empty DeviceTarget (auto-detect).
Returns: Device object representing the connected device
Raises: RuntimeError if connection fails
is_connected(device: Device) -> bool
Check if a device is currently connected.
Parameters:
device(Device): The device to check connection status for
Returns: bool - True if connected, False otherwise
usb_network_devices() -> List[DeviceTarget]
Get a list of devices available via USB network connection.
Returns: List of DeviceTarget objects
Raises: RuntimeError if unable to query devices
usb_devices() -> List[Any]
Get a list of USB devices.
Returns: List of USB device objects
active_connections() -> List[Device]
Get a list of all currently active device connections.
Returns: List of Device objects
disconnect(device: Device) -> None
Disconnect from a specific device.
Parameters:
device(Device): The device to disconnect from
disconnect_all() -> None
Disconnect from all connected devices.
set_recording_manager_tls(enable_tls: bool) -> None
Enable or disable TLS for the recording manager.
Parameters:
enable_tls(bool): Whether to enable TLS
set_client_config(config: DeviceClientConfig) -> None
Configure the device client settings.
Parameters:
config(DeviceClientConfig): Configuration object for the client
Device
The Device class represents a connected Aria device and provides methods to control it.
Methods
connection_id() -> str
Get the unique connection identifier for this device.
Returns: String connection ID
status() -> DeviceStatus
Get current device status.
Returns: DeviceStatus object
Raises: RuntimeError if unable to retrieve device status
serial() -> str
Get the device serial number.
Returns: String serial number
Raises: RuntimeError if unable to retrieve serial number
Streaming Methods
start_streaming()
Start streaming data from the device.
Returns: None
Raises: RuntimeError if unable to start streaming
stop_streaming()
Stop streaming data from the device.
Returns: None
Raises: RuntimeError if unable to stop streaming
is_streaming() -> bool
Check if the device is currently streaming.
Returns: bool - True if streaming, False otherwise
get_streaming_info() -> StreamingInfo
Get information about the current streaming session.
Returns: StreamingInfo object
set_streaming_config(streaming_config: HttpStreamingConfig) -> None
Configure streaming settings.
Parameters:
streaming_config(HttpStreamingConfig): Streaming configuration object
install_streaming_certs(streaming_certificates: Optional[StreamingCertsPem] = None)
Install streaming certificates on the device. If no certificates are provided, default certificates are installed.
Parameters:
streaming_certificates(StreamingCertsPem, optional): Custom certificates in PEM format. Defaults to None (uses default certs).
Returns: None
Raises: RuntimeError if certificate installation fails
uninstall_streaming_certs()
Remove streaming certificates from the device.
Returns: None
Raises: RuntimeError if certificate removal fails
Recording Methods
set_recording_config(recording_config: RecordingConfig) -> None
Configure recording settings.
Parameters:
recording_config(RecordingConfig): Recording configuration object
start_recording() -> str
Start recording on the device.
Returns: UUID of the recording (str)
Raises: RuntimeError if unable to start recording
stop_recording()
Stop the current recording.
Returns: None
Raises: RuntimeError if unable to stop recording
is_recording() -> bool
Check if the device is currently recording.
Returns: bool - True if recording, False otherwise
get_recording_state() -> RecordingState
Get the current recording state of the device.
Returns: RecordingState object with recording details
get_device_session_state() -> DeviceSessionState
Get the combined recording and streaming session state.
Returns: DeviceSessionState object
list_recordings() -> List[RecordingInfo]
Get a list of all recordings on the device.
Returns: List of RecordingInfo objects
Raises: RuntimeError if unable to list recordings
recording_info(uuid: str) -> RecordingInfo
Get detailed information about a specific recording.
Parameters:
uuid(str): Recording UUID
Returns: RecordingInfo object
Raises: RuntimeError if recording not found or unable to retrieve info
delete_recording(uuid: str)
Delete a specific recording from the device.
Parameters:
uuid(str): Recording UUID to delete
Returns: None
Raises: RuntimeError if unable to delete recording
download_recording(uuid: str, output_path: str = "")
Download a specific recording from the device.
Parameters:
uuid(str): Recording UUID to downloadoutput_path(str, optional): Local path to save the recording. Defaults to current directory.
Returns: None
Raises: RuntimeError if download fails
download_all_recordings(output_path: str = "")
Download all recordings from the device.
Parameters:
output_path(str, optional): Local directory to save recordings. Defaults to current directory.
Returns: None
Raises: RuntimeError if download fails
delete_all_recordings()
Delete all recordings from the device.
Returns: None
Raises: RuntimeError if unable to delete recordings
download_thumbnail(uuid: str, output_path: str = "")
Download a thumbnail for a specific recording.
Parameters:
uuid(str): Recording UUIDoutput_path(str, optional): Local path to save the thumbnail. Defaults to current directory.
Returns: None
download_all_thumbnails(uuid: str, output_dir: str = "")
Download all thumbnails for a specific recording.
Parameters:
uuid(str): Recording UUIDoutput_dir(str, optional): Local directory to save thumbnails. Defaults to current directory.
Returns: None
set_file_conflict_action(action: FileConflictAction) -> None
Set the action to take when a file conflict occurs during download.
Parameters:
action(FileConflictAction): The conflict resolution action
device_profiles() -> Dict[str, DataFlowProfileList]
Get all profiles available on the device, organized by category.
Returns: Dictionary mapping profile category names to DataFlowProfileList objects
Example:
profiles = device.device_profiles()
for category, profile_list in profiles.items():
print(f"Category: {category} (hash: {profile_list.hash})")
for profile in profile_list.profiles:
print(f" {profile.name}: {profile.description} (type: {profile.type})")