Rest Client API Documentation¶
clkhash
includes a module for interacting with the anonlink-entity-service.
-
exception
clkhash.rest_client.
RateLimitedClient
(msg, response)[source]¶ Bases:
clkhash.rest_client.ServiceError
Exception indicating client is asking for updates too frequently.
-
exception
clkhash.rest_client.
ServiceError
(msg, response)[source]¶ Bases:
Exception
Problem with the upstream API
-
clkhash.rest_client.
project_create
(server, schema, result_type, name, notes=None, parties=2)[source]¶
-
clkhash.rest_client.
wait_for_run
(server, project, run, apikey, timeout=None, update_period=1)[source]¶ Monitor a linkage run and return the final status updates. If a timeout is provided and the run hasn’t entered a terminal state (error or completed) when the timeout is reached a TimeoutError will be raised.
Parameters: - server – Base url of the upstream server.
- project –
- run –
- apikey –
- timeout – Stop waiting after this many seconds. The default (None) is to never give you up.
- update_period – Time in seconds between queries to the run’s status.
:raises TimeoutError
-
clkhash.rest_client.
watch_run_status
(server, project, run, apikey, timeout=None, update_period=1)[source]¶ Monitor a linkage run and yield status updates. Will immediately yield an update and then only yield further updates when the status object changes. If a timeout is provided and the run hasn’t entered a terminal state (error or completed) when the timeout is reached, updates will cease and a TimeoutError will be raised.
Parameters: - server – Base url of the upstream server.
- project –
- run –
- apikey –
- timeout – Stop waiting after this many seconds. The default (None) is to never give you up.
- update_period – Time in seconds between queries to the run’s status.
:raises TimeoutError