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

Method get_sandbox

crates/openshell-driver-vm/src/driver.rs:1115–1136  ·  view source on GitHub ↗
(
        &self,
        sandbox_id: &str,
        sandbox_name: &str,
    )

Source from the content-addressed store, hash-verified

1113 }
1114
1115 pub async fn get_sandbox(
1116 &self,
1117 sandbox_id: &str,
1118 sandbox_name: &str,
1119 ) -> Result<Option<Sandbox>, Status> {
1120 if !sandbox_id.is_empty() {
1121 validate_sandbox_id(sandbox_id)?;
1122 }
1123
1124 let registry = self.registry.lock().await;
1125 let sandbox = if sandbox_id.is_empty() {
1126 registry
1127 .values()
1128 .find(|record| record.snapshot.name == sandbox_name)
1129 .map(|record| record.snapshot.clone())
1130 } else {
1131 registry
1132 .get(sandbox_id)
1133 .map(|record| record.snapshot.clone())
1134 };
1135 Ok(sandbox)
1136 }
1137
1138 pub async fn current_snapshots(&self) -> Vec<Sandbox> {
1139 let registry = self.registry.lock().await;

Callers 4

fetch_sandbox_detailFunction · 0.45
handle_shell_connectFunction · 0.45
handle_exec_commandFunction · 0.45
spawn_create_sandboxFunction · 0.45

Calls 3

validate_sandbox_idFunction · 0.85
is_emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected