API Reference Overview¶
The Unraid API library provides a comprehensive set of resources that allow you to interact with all aspects of your Unraid server. This section provides detailed documentation for each resource.
Available Resources¶
Resource | Description |
---|---|
Array | Manage the Unraid array - start, stop, and check status |
Disk | Control and monitor disks within the array |
Docker | Manage Docker containers |
VM | Control virtual machines |
System | System-wide operations and information |
User | User management functions |
Notification | Handle Unraid notifications |
Client Structure¶
The client object provides access to various resources through properties. For example:
Python
from unraid_api import UnraidClient
client = UnraidClient("192.168.1.10", api_key="your-api-key")
# Access resources through properties
client.array # Array resource
client.disk # Disk resource
client.docker # Docker resource
client.vm # VM resource
client.system # System resource
client.user # User resource
client.notification # Notification resource
Common Patterns¶
Most resources follow a common pattern for method naming:
get_*
: Methods that retrieve informationcreate_*
: Methods that create new resourcesupdate_*
: Methods that modify existing resourcesdelete_*
: Methods that remove resourcesstart_*
,stop_*
,restart_*
: Methods that control the state of resources
Models¶
The library uses Pydantic models to provide strongly typed responses. Each API call returns a structured model with appropriate type hints, making it easier to work with the data and benefit from IDE autocompletion.
For example:
Python
# Get system info
system_info = client.get_system_info()
# Access properties of the returned model
print(system_info.version) # The Unraid version
print(system_info.uptime) # Server uptime
Error Handling¶
API calls may raise various exceptions. See the Error Handling section for details on available exceptions and how to handle them effectively.