- vultr_api/: Python library wrapping Vultr API v2 - 17 resource modules (instances, dns, firewall, vpc, etc.) - Pagination support, error handling - server/: FastAPI REST server - All API endpoints exposed via HTTP - X-API-Key header authentication - Swagger docs at /docs - Podman quadlet config for systemd deployment Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
766 B
Python
35 lines
766 B
Python
"""
|
|
OS Resource
|
|
|
|
Operating system listings
|
|
"""
|
|
|
|
from typing import Dict, List
|
|
from .base import BaseResource
|
|
|
|
|
|
class OSResource(BaseResource):
|
|
"""
|
|
Operating system listings
|
|
|
|
Usage:
|
|
# List all OS options
|
|
os_list = client.os.list()
|
|
"""
|
|
|
|
def list(self, per_page: int = 100, cursor: str = None) -> Dict:
|
|
"""
|
|
List available operating systems
|
|
|
|
Returns:
|
|
Dict with 'os' list and 'meta' pagination
|
|
"""
|
|
params = {"per_page": per_page}
|
|
if cursor:
|
|
params["cursor"] = cursor
|
|
return self.client.get("os", params=params)
|
|
|
|
def list_all(self) -> List[Dict]:
|
|
"""List all operating systems (auto-paginate)"""
|
|
return self.client.paginate("os", "os")
|