Incus Python SDK Documentation¶
Welcome to the Incus Python SDK documentation. This SDK provides a Python interface to the Incus REST API, allowing you to manage Incus containers, virtual machines, networks, storage pools, and more.
Contents¶
Overview¶
The Incus Python SDK is a comprehensive client library for the Incus API. It provides:
- Asynchronous API support using Python's asyncio
- Object-oriented models for Incus resources
- Comprehensive error handling
- Support for Unix socket and HTTPS connections
- Project-based resource management
Available API Clients¶
The SDK includes the following API clients:
InstancesAPI
- Manage containers and virtual machinesImagesAPI
- Manage imagesNetworksAPI
- Manage networksProfilesAPI
- Manage profilesStoragePoolsAPI
- Manage storage pools and volumesCertificatesAPI
- Manage certificatesClusterAPI
- Manage clusters and cluster membersOperationsAPI
- Manage operationsProjectsAPI
- Manage projects
Quick Example¶
import asyncio
from incus_sdk import Client
async def main():
# Connect to the Incus API
async with Client() as client:
# List all instances
instances = await client.instances.list()
print(f"Found {len(instances)} instances:")
for instance in instances:
print(f" {instance.name} ({instance.type}): {instance.status}")
if __name__ == "__main__":
asyncio.run(main())
License¶
This project is licensed under the MIT License - see the LICENSE file for details.