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

Method get_sandbox

crates/openshell-driver-docker/src/lib.rs:1420–1441  ·  view source on GitHub ↗
(
        &self,
        request: Request<GetSandboxRequest>,
    )

Source from the content-addressed store, hash-verified

1418 }
1419
1420 async fn get_sandbox(
1421 &self,
1422 request: Request<GetSandboxRequest>,
1423 ) -> Result<Response<GetSandboxResponse>, Status> {
1424 let request = request.into_inner();
1425 require_sandbox_identifier(&request.sandbox_id, &request.sandbox_name)?;
1426
1427 let sandbox = self
1428 .get_sandbox_snapshot(&request.sandbox_id, &request.sandbox_name)
1429 .await?
1430 .ok_or_else(|| Status::not_found("sandbox not found"))?;
1431
1432 if !request.sandbox_id.is_empty() && request.sandbox_id != sandbox.id {
1433 return Err(Status::failed_precondition(
1434 "sandbox_id did not match the fetched sandbox",
1435 ));
1436 }
1437
1438 Ok(Response::new(GetSandboxResponse {
1439 sandbox: Some(sandbox),
1440 }))
1441 }
1442
1443 async fn list_sandboxes(
1444 &self,

Callers

nothing calls this directly

Calls 3

get_sandbox_snapshotMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected