跳转到正文

http API ​

完整接口目录 · HTTP 客户端用法 · 工具包下载

模块说明 ​

text
Bounded, non-retrying HTTP client for the external runtime API.

TransportError ​

python
class TransportError(Exception)

SDK 说明:

text
Transport failed; a submitted action may already have been accepted.

另继承外部类型 Exception;其通用方法不在本 SDK 目录中重复展开。

ProtocolError ​

python
class ProtocolError(Exception)

SDK 说明:

text
The peer response did not satisfy the HTTP API contract.

另继承外部类型 Exception;其通用方法不在本 SDK 目录中重复展开。

APIError ​

python
class APIError(Exception)

SDK 说明:

text
Structured API rejection; untrusted response messages are not retained.

APIError.__init__ ​

python
def __init__(self, status, code, request_id)

另继承外部类型 Exception;其通用方法不在本 SDK 目录中重复展开。

APIError.status ​

python
self.status

公开实例属性,在 __init__ 中设置。

APIError.code ​

python
self.code

公开实例属性,在 __init__ 中设置。

APIError.request_id ​

python
self.request_id

公开实例属性,在 __init__ 中设置。

Client ​

python
class Client

SDK 说明:

text
External API client. One connection per request; never retries actions.

base_url is a bare HTTP loopback origin. localhost is pinned to 127.0.0.1.
timeout is the socket I/O timeout; wait also limits each poll to its remaining
time budget. It cannot interrupt arbitrary blocking OS operations.

Client.__init__ ​

python
def __init__(self, base_url, token, timeout=5, max_response_bytes=1 << 20)

Client.capabilities ​

python
def capabilities(self)

Client.state ​

python
def state(self)

SDK 说明:

text
Read this identity's state and current session without side effects.

Client.commit_state ​

python
def commit_state(
    self,
    *,
    commit_id,
    expected_state_revision,
    mutations,
    actions,
    session = None,
)

SDK 说明:

text
Submit one exact atomic transaction; never rebase or retry it.

Client.commit_event ​

python
def commit_event(
    self,
    subscription_id,
    *,
    delivery_token,
    event_id,
    commit_id,
    expected_state_revision,
    mutations,
    actions,
    session = None,
)

SDK 说明:

text
Atomically commit state, this delivery acknowledgment and action intents.

Client.create_subscription ​

python
def create_subscription(self, subscription_id, *, filter_version, kinds)

Client.subscription ​

python
def subscription(self, subscription_id)

Client.acknowledge ​

python
def acknowledge(self, subscription_id, *, delivery_token, commit_id)

Client.events ​

python
def events(self, subscription_id, *, cursor=None)

SDK 说明:

text
Read one SSE connection; callers explicitly acknowledge and reconnect.

Use as a context manager to close the socket when breaking iteration.
A reconnect cursor proves ownership; it does not skip unacknowledged data.

Client.submit ​

python
def submit(self, operation, arguments, *, idempotency_key, deadline)

Client.get ​

python
def get(self, operation_id)

Client.cancel ​

python
def cancel(self, operation_id)

Client.wait ​

python
def wait(self, operation_id, *, timeout=30, poll_interval=0.1)

Neomega · 使用、开发与参考文档