Expand description
§Tensorlake Cloud SDK
A Rust SDK for interacting with Tensorlake Cloud APIs. This SDK provides a high-level, ergonomic interface for managing applications, functions, and execution requests in the Tensorlake Cloud platform.
§Quick Start
use tensorlake::{Sdk, applications::models::ListApplicationsRequest};
async fn example() -> Result<(), Box<dyn std::error::Error>> {
// Create the SDK client
let sdk = Sdk::new("https://api.tensorlake.ai", "your-api-key")?;
// Get the applications client
let apps_client = sdk.applications();
// List applications in the default namespace
let request = ListApplicationsRequest::builder()
.namespace("default".to_string())
.build()?;
apps_client.list(&request).await?;
Ok(())
}§Authentication
The SDK uses Bearer token authentication, either a Personal Access Token (PAT) or a Project API key. Provide your token when creating the SDK:
use tensorlake::Sdk;
let sdk = Sdk::new("https://api.tensorlake.ai", "your-token").unwrap();§Available Clients
ApplicationsClient: Manage applications, functions, and requestsImagesClient: Build and manage container imagesSandboxesClient: Manage sandbox lifecycle, pools, and snapshotsSecretsClient: Manage secrets for secure configuration
§Error Handling
The SDK provides detailed error types for different scenarios:
use tensorlake::{Sdk, applications::models::ListApplicationsRequest};
async fn example() -> Result<(), Box<dyn std::error::Error>> {
let sdk = Sdk::new("https://api.tensorlake.ai", "your-api-key")?;
let apps_client = sdk.applications();
let request = ListApplicationsRequest::builder()
.namespace("default".to_string())
.build()?;
match apps_client.list(&request).await {
Ok(apps) => println!("Success: {:?}", apps.applications.len()),
Err(e) => eprintln!("Error: {}", e),
}
Ok(())
}Modules§
- applications
- Tensorlake Cloud SDK - Applications
- artifact_
storage - cron
- docker_
config - Capture Docker configuration and resolve registry credentials for one operation.
- error
- SDK Error Types
- http_
transport - HTTP trust policy for shipped SDKs and CLIs.
- image_
builds - CAS image build operations: start, get, wait and cancel a CAS image build or import as a first-class operation (ADR 0107).
- images
- Tensorlake Cloud SDK - Images
- retry
- Retry policy shared by every binding.
- sandbox_
image_ catalog - The merged sandbox-image catalog: one client-side view over the platform
sandbox-template registry (legacy
.tlsnapimages) and the CAS image registry catalog (CAS images), sodescribe,ls,rmand the SDK lookups behave identically for both families. - sandbox_
images - sandbox_
templates - sandboxes
- secrets
- Secret management through the regional Secret Service.
- sse
- Server-sent events (SSE) response bodies.
- usage
- Sandbox usage and attributed cost for an organization.
Structs§
- Client
- HTTP client that interacts with the Tensorlake Cloud API.
- Client
Builder - Builder for creating a
Clientwith a fluent API. - Read
Retry Config - Retry limits for sandbox metadata reads. All attempts, DNS lookups, body
reads and backoff share
total_timeout, further capped by request timeout. Long-running operations and response streams do not use this policy. - Sdk
- The main entry point for the Tensorlake Cloud SDK.
- Traced
- Wraps any SDK operation result with the W3C
trace_idso callers can correlate the request with its server-side spans in Datadog APM or any other OTEL-compatible backend.
Constants§
- SANDBOX_
API_ URL_ ENV - Environment variable that overrides the sandbox API (lifecycle) base URL.
Functions§
- resolve_
artifact_ storage_ url - Derive the Artifact Storage Git base URL from the API URL.
- resolve_
sandbox_ lifecycle_ url - Derive the sandbox lifecycle base URL from the API URL.
- sandbox_
api_ url_ override - The validated
TENSORLAKE_SANDBOX_API_URLoverride, if set and usable.