pub struct RunbeamClient { /* private fields */ }Expand description
HTTP client for Runbeam Cloud API
This client handles all communication with the Runbeam Cloud control plane, including gateway authorization and future component loading.
Implementations§
Source§impl RunbeamClient
impl RunbeamClient
Authorize a gateway and obtain a machine-scoped token
This method exchanges a user JWT token for a machine-scoped token that the gateway can use for autonomous API access. The machine token has a 30-day expiry (configured server-side).
§Arguments
user_token- The user’s JWT token from CLI authenticationgateway_code- The gateway instance IDmachine_public_key- Optional public key for secure communicationmetadata- Optional metadata about the gateway
§Returns
Returns Ok(AuthorizeResponse) with machine token and gateway details,
or Err(RunbeamError) if authorization fails.
§Example
use runbeam_sdk::RunbeamClient;
let client = RunbeamClient::new("http://runbeam.lndo.site");
let response = client.authorize_gateway(
"eyJhbGci...",
"gateway-123",
None,
None
).await?;
println!("Machine token: {}", response.machine_token);
println!("Expires at: {}", response.expires_at);Sourcepub async fn list_gateways(
&self,
token: impl Into<String>,
) -> Result<PaginatedResponse<Gateway>, RunbeamError>
pub async fn list_gateways( &self, token: impl Into<String>, ) -> Result<PaginatedResponse<Gateway>, RunbeamError>
List all gateways for the authenticated team
Returns a paginated list of gateways.
Sourcepub async fn get_gateway(
&self,
token: impl Into<String>,
gateway_id: impl Into<String>,
) -> Result<ResourceResponse<Gateway>, RunbeamError>
pub async fn get_gateway( &self, token: impl Into<String>, gateway_id: impl Into<String>, ) -> Result<ResourceResponse<Gateway>, RunbeamError>
Get a specific gateway by ID or code
§Arguments
token- JWT or machine token for authenticationgateway_id- The gateway ID or code
Sourcepub async fn list_services(
&self,
token: impl Into<String>,
) -> Result<PaginatedResponse<Service>, RunbeamError>
pub async fn list_services( &self, token: impl Into<String>, ) -> Result<PaginatedResponse<Service>, RunbeamError>
List all services for the authenticated team
Returns a paginated list of services across all gateways.
Sourcepub async fn get_service(
&self,
token: impl Into<String>,
service_id: impl Into<String>,
) -> Result<ResourceResponse<Service>, RunbeamError>
pub async fn get_service( &self, token: impl Into<String>, service_id: impl Into<String>, ) -> Result<ResourceResponse<Service>, RunbeamError>
Get a specific service by ID
§Arguments
token- JWT or machine token for authenticationservice_id- The service ID
Sourcepub async fn list_endpoints(
&self,
token: impl Into<String>,
) -> Result<PaginatedResponse<Endpoint>, RunbeamError>
pub async fn list_endpoints( &self, token: impl Into<String>, ) -> Result<PaginatedResponse<Endpoint>, RunbeamError>
List all endpoints for the authenticated team
Sourcepub async fn list_backends(
&self,
token: impl Into<String>,
) -> Result<PaginatedResponse<Backend>, RunbeamError>
pub async fn list_backends( &self, token: impl Into<String>, ) -> Result<PaginatedResponse<Backend>, RunbeamError>
List all backends for the authenticated team
Sourcepub async fn list_pipelines(
&self,
token: impl Into<String>,
) -> Result<PaginatedResponse<Pipeline>, RunbeamError>
pub async fn list_pipelines( &self, token: impl Into<String>, ) -> Result<PaginatedResponse<Pipeline>, RunbeamError>
List all pipelines for the authenticated team
Trait Implementations§
Source§impl Clone for RunbeamClient
impl Clone for RunbeamClient
Source§fn clone(&self) -> RunbeamClient
fn clone(&self) -> RunbeamClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more