MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / sandbox_to_json

Function sandbox_to_json

crates/openshell-cli/src/run.rs:3427–3439  ·  view source on GitHub ↗
(sandbox: &Sandbox)

Source from the content-addressed store, hash-verified

3425}
3426
3427fn sandbox_to_json(sandbox: &Sandbox) -> serde_json::Value {
3428 let meta = sandbox.metadata.as_ref();
3429 let labels = meta.map_or_else(|| serde_json::json!({}), |m| serde_json::json!(m.labels));
3430 serde_json::json!({
3431 "id": sandbox.object_id(),
3432 "name": sandbox.object_name(),
3433 "labels": labels,
3434 "resource_version": meta.map_or(0, |m| m.resource_version),
3435 "created_at": format_epoch_ms(meta.map_or(0, |m| m.created_at_ms)),
3436 "phase": phase_name(sandbox.phase()),
3437 "current_policy_version": sandbox.current_policy_version(),
3438 })
3439}
3440
3441pub async fn sandbox_provider_list(server: &str, name: &str, tls: &TlsOptions) -> Result<()> {
3442 let mut client = grpc_client(server, tls).await?;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected