pub struct FlowFabricAdminClient { /* private fields */ }Expand description
Client for the ff-server admin REST surface.
Construct via FlowFabricAdminClient::new (no auth) or
FlowFabricAdminClient::with_token (Bearer auth). Both
return a ready-to-use client backed by a single pooled
reqwest::Client — reuse the instance across calls instead of
building one per request.
Implementations§
Source§impl FlowFabricAdminClient
impl FlowFabricAdminClient
Sourcepub fn new(base_url: impl Into<String>) -> Result<Self, SdkError>
pub fn new(base_url: impl Into<String>) -> Result<Self, SdkError>
Build a client without auth. Suitable for a dev ff-server
whose api_token is unconfigured. Production deployments
should use with_token.
Sourcepub fn with_token(
base_url: impl Into<String>,
token: impl AsRef<str>,
) -> Result<Self, SdkError>
pub fn with_token( base_url: impl Into<String>, token: impl AsRef<str>, ) -> Result<Self, SdkError>
Build a client that sends Authorization: Bearer <token> on
every request. The token is passed by value so the caller
retains ownership policy (e.g. zeroize on drop at the
caller side); the SDK only reads it.
§Empty-token guard
An empty or all-whitespace token returns
SdkError::Config instead of silently constructing
Authorization: Bearer (which the server rejects with
401, leaving the operator chasing a “why is auth broken”
ghost). Common source: FF_ADMIN_TOKEN="" in a shell
where the var was meant to be set; the unset-expansion is
the empty string. Prefer an obvious error at construction
over a silent 401 at first request.
If the caller genuinely wants an unauthenticated client
(dev ff-server without api_token configured), use
FlowFabricAdminClient::new instead.
Sourcepub async fn claim_for_worker(
&self,
req: ClaimForWorkerRequest,
) -> Result<Option<ClaimForWorkerResponse>, SdkError>
pub async fn claim_for_worker( &self, req: ClaimForWorkerRequest, ) -> Result<Option<ClaimForWorkerResponse>, SdkError>
POST /v1/workers/{worker_id}/claim — scheduler-routed claim.
Batch C item 2 PR-B. Swaps the SDK’s direct-Valkey claim for a
server-side one: the request carries lane + identity +
capabilities + grant TTL; the server runs budget, quota, and
capability admission via ff_scheduler::Scheduler::claim_for_worker
and returns a ClaimGrant on success.
Returns Ok(None) when the server responds 204 No Content
(no eligible execution on the lane). Callers that want to keep
polling should back off per their claim cadence.
Sourcepub async fn rotate_waitpoint_secret(
&self,
req: RotateWaitpointSecretRequest,
) -> Result<RotateWaitpointSecretResponse, SdkError>
pub async fn rotate_waitpoint_secret( &self, req: RotateWaitpointSecretRequest, ) -> Result<RotateWaitpointSecretResponse, SdkError>
Rotate the waitpoint HMAC secret on the server.
Promotes the currently-installed kid to previous_kid
(accepted for the server’s configured
FF_WAITPOINT_HMAC_GRACE_MS window) and installs
new_secret_hex under new_kid as the new current. Fans
out across every execution partition. Idempotent: re-running
with the same (new_kid, new_secret_hex) converges.
The server returns 200 if at least one partition rotated OR
at least one partition was already rotating under a
concurrent request. See RotateWaitpointSecretResponse
fields for the breakdown.
§Errors
SdkError::AdminApi— non-2xx response (400 invalid input, 401 missing/bad bearer, 429 concurrent rotate, 500 all partitions failed, 504 server-side timeout).SdkError::Http— transport error (connect, body decode, client-side timeout).
§Retry semantics
Rotation is idempotent on the same (new_kid, new_secret_hex) so retries are SAFE even on 504s or
partial failures.
Trait Implementations§
Source§impl Clone for FlowFabricAdminClient
impl Clone for FlowFabricAdminClient
Source§fn clone(&self) -> FlowFabricAdminClient
fn clone(&self) -> FlowFabricAdminClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FlowFabricAdminClient
impl !RefUnwindSafe for FlowFabricAdminClient
impl Send for FlowFabricAdminClient
impl Sync for FlowFabricAdminClient
impl Unpin for FlowFabricAdminClient
impl UnsafeUnpin for FlowFabricAdminClient
impl !UnwindSafe for FlowFabricAdminClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more