MODULE REFERENCE
client
anomx.integrations.platform.clientAuthenticated JSON transport without dataset, run, or workspace operations.
PlatformClient
PlatformClient(url: str, token: str, timeout: float = 30.0, health_path: str = '/system/health')An authenticated API connection, independent of any resource class.
A site origin such as https://host becomes https://host/api. Explicit API prefixes (including /api/v1 and reverse-proxy paths) are preserved. Paths passed to HTTP methods are relative to that API prefix, starting with /. Responses are decoded JSON; empty responses are None.
Credentials come only from arguments or from_env(). Requests have a bounded timeout, are never retried, and do not follow redirects.
| Parameter | Type | Default |
|---|---|---|
url | str | required |
token | str | required |
timeout | float | 30.0 |
health_path | str | '/system/health' |
Members
urlattribute
url: strtokenattribute
token: str = field(repr=False)timeoutattribute
timeout: float = 30.0health_pathattribute
health_path: str = '/system/health'from_envclassmethod
from_env() -> PlatformClientRead ANOMX_URL and ANOMX_TOKEN for a standalone connection.
Returns PlatformClient
requestmethod
request(path: str, payload: JSONValue = None, *, method: str = 'POST', params: QueryParams | None = None) -> JSONValueSend a JSON request and decode JSON of any shape, or an empty response.
params URL-encodes query values and repeats keys for list values. HTTP errors expose status_code, method, and url. Error messages omit query values, credentials, and response bodies.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
payload | JSONValue | None |
methodkeyword only | str | 'POST' |
paramskeyword only | QueryParams | None | None |
Returns JSONValue
getmethod
get(path: str, *, params: QueryParams | None = None) -> JSONValueRead a resource, optionally passing query parameters.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
paramskeyword only | QueryParams | None | None |
Returns JSONValue
postmethod
post(path: str, payload: JSONValue = None, *, params: QueryParams | None = None) -> JSONValueSubmit JSON to a resource.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
payload | JSONValue | None |
paramskeyword only | QueryParams | None | None |
Returns JSONValue
putmethod
put(path: str, payload: JSONValue = None, *, params: QueryParams | None = None) -> JSONValueReplace a resource with JSON.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
payload | JSONValue | None |
paramskeyword only | QueryParams | None | None |
Returns JSONValue
patchmethod
patch(path: str, payload: JSONValue = None, *, params: QueryParams | None = None) -> JSONValuePartially update a resource with JSON.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
payload | JSONValue | None |
paramskeyword only | QueryParams | None | None |
Returns JSONValue
deletemethod
delete(path: str, *, params: QueryParams | None = None) -> JSONValueDelete a resource; an empty success response returns None.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
paramskeyword only | QueryParams | None | None |
Returns JSONValue
headmethod
head(path: str, *, params: QueryParams | None = None) -> NoneCheck a resource's HTTP status without decoding a body.
| Parameter | Type | Default |
|---|---|---|
path | str | required |
paramskeyword only | QueryParams | None | None |
Returns None
is_alivemethod
is_alive() -> boolCheck the configured health resource for status: ok.
Return False for HTTP, connection, timeout, or invalid-response errors. This checks API liveness, not access to a particular dataset or resource.
Returns bool
PlatformError
PlatformError(message: str, *, status_code: int | None = None, method: str | None = None, url: str | None = None)Bases: RuntimeError
A failed API request, with HTTP status and request location when available.
| Parameter | Type | Default |
|---|---|---|
message | str | required |
status_codekeyword only | int | None | None |
methodkeyword only | str | None | None |
urlkeyword only | str | None | None |
PlatformTimeoutError
PlatformTimeoutError(message: str, *, status_code: int | None = None, method: str | None = None, url: str | None = None)Bases: PlatformError
The request exceeded the configured socket timeout.
| Parameter | Type | Default |
|---|---|---|
message | str | required |
status_codekeyword only | int | None | None |
methodkeyword only | str | None | None |
urlkeyword only | str | None | None |