Python client

Python client

devium-rms-api is the official Python client. Like the JavaScript SDK it ships one client per API domain, in both synchronous and asyncio flavours, built on httpx.

Two companion packages are available:

  • devium-rms-model — typed request/response models (devium.rms.models.*) you can use to build and validate payloads.
  • devium-rms-agent — a framework for building host agents (operation manager, ADB/scrcpy, stats); for agent authors rather than API consumers.

Install

pip install devium-rms-api
# optional
pip install devium-rms-model devium-rms-agent

The clients

Each client lives in its own module under devium.rms.api (the package __init__ is intentionally empty — import from the submodule). Pass the host base URL; the client appends the domain path (/api/v1/<domain>) itself.

ClientModuleCovers
AuthAPIClientdevium.rms.api.auth_api_clientLogin, token refresh
UserAPIClientdevium.rms.api.user_api_clientUsers and user data
OrganizationAPIClientdevium.rms.api.organization_api_clientOrganizations, locations, members
ResourcesAPIClientdevium.rms.api.resources_api_clientPools, resources, queues
AnalyticsAPIClientdevium.rms.api.analytics_api_clientState and utilization analytics
LCMAPIClientdevium.rms.api.lcm_api_clientLifecycle state transitions
KeepAliveAPIClientdevium.rms.api.keep_alive_api_clientResource heartbeats

The asyncio variants live under devium.rms.api.asyncio.* with the same class names and methods.

Set up a client

from devium.rms.api.auth_api_client import AuthAPIClient
from devium.rms.api.resources_api_client import ResourcesAPIClient

host = "https://app.devium.io"

auth = AuthAPIClient(base_url=host)
tokens = auth.login(username="you@example.com", password="••••••••")

resources = ResourcesAPIClient(base_url=host, access_token=tokens["access_token"])
pools = resources.get_all_pools()

Every client also has set_access_token(token) if you obtain the token elsewhere, and an optional timeout constructor argument (defaults to 30.0 seconds).

Conventions

  • Plain dicts, snake_case. Methods take and return dict payloads using the API's snake_case keys (e.g. available_from, not availableFrom). Filters are passed as keyword arguments.

  • Pagination. List methods accept page, limit, sort_by, sort_order (and per-domain filters) and return a paginated dict:

    {
        "items": [...],
        "total_count": 128,
        "page": 1,
        "limit": 20,
        "total_pages": 7,
    }
    
page = resources.get_all_pools(bookable=True, page=1, limit=20, sort_by="name", sort_order="asc")
print(page["items"], "of", page["total_count"])

Next steps