pub struct ApiClient {
pub base_url: String,
pub client: Client,
}Fields§
§base_url: String§client: ClientImplementations§
Source§impl ApiClient
impl ApiClient
pub fn new(base_url: String) -> Result<Self>
Sourcepub fn register_request(
&self,
payload: &AutoRegisterRequest,
) -> Result<AutoRegisterRequestResponse>
pub fn register_request( &self, payload: &AutoRegisterRequest, ) -> Result<AutoRegisterRequestResponse>
Create a Pending Workers row. Unauthenticated on purpose — the studio rate-limits this endpoint by source IP and the operator manually approves before the worker can do anything.
Sourcepub fn poll_register_status(
&self,
request_id: &str,
registration_secret: &str,
) -> Result<Option<RegisterStatus>>
pub fn poll_register_status( &self, request_id: &str, registration_secret: &str, ) -> Result<Option<RegisterStatus>>
Poll the studio for the operator’s decision on a previously
submitted register-request. Returns Ok(None) when the
request id is unknown to the studio (likely cleaned up or
never existed) so the orchestrator can drop the stale id and
start a fresh one. Auth is the raw registration_secret
presented as a Bearer token.
Sourcepub fn complete(
&self,
worker_id: &str,
token: &str,
job_id: &str,
ext: &str,
prompt: &str,
image: Vec<u8>,
) -> Result<()>
pub fn complete( &self, worker_id: &str, token: &str, job_id: &str, ext: &str, prompt: &str, image: Vec<u8>, ) -> Result<()>
Complete a job with binary output (image / audio / video).
This is the only worker-side HTTP route that survives the WS
migration: R2 multipart doesn’t fit cleanly into WS frames.
Heartbeats, claim/accept/reject, completeJson, fail, and log
shipping all flow over the WS session owned by
ws::session::spawn_ws_session.