unraid-api 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unraid_api-0.1.0/PKG-INFO +35 -0
- unraid_api-0.1.0/README.md +62 -0
- unraid_api-0.1.0/pyunraid/__init__.py +34 -0
- unraid_api-0.1.0/pyunraid/async_client.py +593 -0
- unraid_api-0.1.0/pyunraid/auth.py +326 -0
- unraid_api-0.1.0/pyunraid/client.py +238 -0
- unraid_api-0.1.0/pyunraid/client_async.py +268 -0
- unraid_api-0.1.0/pyunraid/exceptions.py +59 -0
- unraid_api-0.1.0/pyunraid/models/__init__.py +12 -0
- unraid_api-0.1.0/pyunraid/models/array.py +71 -0
- unraid_api-0.1.0/pyunraid/models/config.py +258 -0
- unraid_api-0.1.0/pyunraid/models/disk.py +55 -0
- unraid_api-0.1.0/pyunraid/models/docker.py +102 -0
- unraid_api-0.1.0/pyunraid/models/info.py +104 -0
- unraid_api-0.1.0/pyunraid/models/notification.py +46 -0
- unraid_api-0.1.0/pyunraid/models/user.py +71 -0
- unraid_api-0.1.0/pyunraid/models/vm.py +93 -0
- unraid_api-0.1.0/pyunraid/resources/__init__.py +12 -0
- unraid_api-0.1.0/pyunraid/resources/array.py +643 -0
- unraid_api-0.1.0/pyunraid/resources/config.py +793 -0
- unraid_api-0.1.0/pyunraid/resources/disk.py +679 -0
- unraid_api-0.1.0/pyunraid/resources/docker.py +821 -0
- unraid_api-0.1.0/pyunraid/resources/info.py +355 -0
- unraid_api-0.1.0/pyunraid/resources/notification.py +458 -0
- unraid_api-0.1.0/pyunraid/resources/user.py +615 -0
- unraid_api-0.1.0/pyunraid/resources/vm.py +797 -0
- unraid_api-0.1.0/pyunraid/subscription.py +263 -0
- unraid_api-0.1.0/setup.cfg +4 -0
- unraid_api-0.1.0/setup.py +38 -0
- unraid_api-0.1.0/unraid_api.egg-info/PKG-INFO +35 -0
- unraid_api-0.1.0/unraid_api.egg-info/SOURCES.txt +32 -0
- unraid_api-0.1.0/unraid_api.egg-info/dependency_links.txt +1 -0
- unraid_api-0.1.0/unraid_api.egg-info/requires.txt +13 -0
- unraid_api-0.1.0/unraid_api.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: unraid-api
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python library for Unraid GraphQL API
|
|
5
|
+
Home-page: https://github.com/domalab/pyunraid
|
|
6
|
+
Author: Ruaan Deysel
|
|
7
|
+
Author-email: ruaan.deysel@gmail.com
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Requires-Dist: httpx>=0.23.0
|
|
17
|
+
Requires-Dist: pydantic>=2.0.0
|
|
18
|
+
Requires-Dist: graphql-core>=3.2.0
|
|
19
|
+
Requires-Dist: typeguard>=2.13.0
|
|
20
|
+
Requires-Dist: websockets>=10.3
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: isort>=5.10.0; extra == "dev"
|
|
27
|
+
Requires-Dist: mypy>=0.950; extra == "dev"
|
|
28
|
+
Dynamic: author
|
|
29
|
+
Dynamic: author-email
|
|
30
|
+
Dynamic: classifier
|
|
31
|
+
Dynamic: home-page
|
|
32
|
+
Dynamic: provides-extra
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# PyUnraid: Python Library for Unraid GraphQL API
|
|
2
|
+
|
|
3
|
+
A comprehensive Python library that provides a clean, intuitive interface to Unraid's GraphQL API. It enables developers to programmatically control and monitor Unraid servers with both synchronous and asynchronous support, strong typing, and intelligent error handling.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install pyunraid
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Simple Synchronous Example
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from pyunraid import UnraidClient
|
|
17
|
+
|
|
18
|
+
# Connect to Unraid server
|
|
19
|
+
client = UnraidClient("192.168.1.10")
|
|
20
|
+
client.login("username", "password")
|
|
21
|
+
|
|
22
|
+
# Get system info
|
|
23
|
+
system_info = client.get_system_info()
|
|
24
|
+
print(f"System version: {system_info.version}")
|
|
25
|
+
|
|
26
|
+
# Start the array
|
|
27
|
+
client.system.start_array()
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Async Example
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
import asyncio
|
|
34
|
+
from pyunraid.async_client import AsyncUnraidClient
|
|
35
|
+
|
|
36
|
+
async def main():
|
|
37
|
+
client = AsyncUnraidClient("192.168.1.10")
|
|
38
|
+
await client.login("username", "password")
|
|
39
|
+
|
|
40
|
+
# Get all Docker containers
|
|
41
|
+
containers = await client.docker.get_containers()
|
|
42
|
+
for container in containers:
|
|
43
|
+
print(f"Container: {container.name}, Status: {container.status}")
|
|
44
|
+
|
|
45
|
+
# Perform a parity check
|
|
46
|
+
await client.system.start_parity_check()
|
|
47
|
+
|
|
48
|
+
asyncio.run(main())
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Features
|
|
52
|
+
|
|
53
|
+
- Complete access to Unraid GraphQL API endpoints
|
|
54
|
+
- Both synchronous and asynchronous interfaces
|
|
55
|
+
- Automatic token refresh and management
|
|
56
|
+
- Strongly-typed Python classes using Pydantic
|
|
57
|
+
- Comprehensive error handling
|
|
58
|
+
- Request/response logging for debugging
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT License
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""PyUnraid: Python Library for Unraid GraphQL API."""
|
|
2
|
+
|
|
3
|
+
from .client import UnraidClient
|
|
4
|
+
from .client_async import AsyncUnraidClient
|
|
5
|
+
from .exceptions import (
|
|
6
|
+
PyUnraidError,
|
|
7
|
+
AuthenticationError,
|
|
8
|
+
TokenExpiredError,
|
|
9
|
+
ConnectionError,
|
|
10
|
+
APIError,
|
|
11
|
+
ValidationError,
|
|
12
|
+
ResourceNotFoundError,
|
|
13
|
+
OperationError,
|
|
14
|
+
GraphQLError,
|
|
15
|
+
SubscriptionError,
|
|
16
|
+
RateLimitError,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
__version__ = "0.1.0"
|
|
20
|
+
__all__ = [
|
|
21
|
+
"UnraidClient",
|
|
22
|
+
"AsyncUnraidClient",
|
|
23
|
+
"PyUnraidError",
|
|
24
|
+
"AuthenticationError",
|
|
25
|
+
"TokenExpiredError",
|
|
26
|
+
"ConnectionError",
|
|
27
|
+
"APIError",
|
|
28
|
+
"ValidationError",
|
|
29
|
+
"ResourceNotFoundError",
|
|
30
|
+
"OperationError",
|
|
31
|
+
"GraphQLError",
|
|
32
|
+
"SubscriptionError",
|
|
33
|
+
"RateLimitError",
|
|
34
|
+
]
|