Python SDK
Roadmap / In Active Development
The Okustera Python SDK (okustera / okustera-sdk-python) is currently in active design and development. The code snippets and installation steps below describe the target interface for upcoming releases.
To automate Okustera infrastructure today, please use:
- The official HashiCorp Terraform Provider
- The OpenStack Unified CLI
- The Go SDK (
gitlab.com/Haroyan/okustera-terraform-provider/client) - Direct calls to the Okustera REST API
The Okustera Python SDK provides a modern, typed interface for automating Okustera Cloud infrastructure from Python scripts, automated pipelines, and backend microservices.
Planned Installation
# Target PyPI package (Coming Soon)
pip install okustera
Quickstart Example
from okustera import Client
# Initialize client
client = Client(
api_token="YOUR_OKUSTERA_API_TOKEN",
tenant_id="tenant-production",
endpoint="https://portal.okustera.com/api/v1"
)
# 1. List Managed PostgreSQL Databases
databases = client.databases.list_postgresql()
for db in databases:
print(f"Database: {db.name} | Status: {db.status} | Instances: {db.instances}")
# 2. Deploy a New Serverless Function
function = client.serverless.create_function(
name="order-processor",
runtime="python3",
image="registry.okustera.com/production/order-processor:latest",
min_replicas=1,
max_replicas=10,
environment={"QUEUE_NAME": "orders"}
)
print("Function deployed at:", function.url)
Async Client (asyncio)
import asyncio
from okustera.aio import AsyncClient
async def main():
async with AsyncClient(api_token="...") as client:
clusters = await client.kubernetes.list_clusters()
for cluster in clusters:
print("Cluster:", cluster.name, cluster.status)
asyncio.run(main())