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

Method get_sandbox

crates/openshell-server/src/test_support.rs:210–234  ·  view source on GitHub ↗
(
        &self,
        request: Request<GetSandboxRequest>,
    )

Source from the content-addressed store, hash-verified

208 }
209
210 async fn get_sandbox(
211 &self,
212 request: Request<GetSandboxRequest>,
213 ) -> Result<Response<GetSandboxResponse>, Status> {
214 let request = request.into_inner();
215 let sandbox = self.with_state(|state| {
216 state.calls.push(FakeComputeDriverCall::GetSandbox {
217 sandbox_id: request.sandbox_id.clone(),
218 sandbox_name: request.sandbox_name.clone(),
219 });
220 state
221 .sandboxes
222 .values()
223 .find(|sandbox| {
224 (!request.sandbox_id.is_empty() && sandbox.id == request.sandbox_id)
225 || (!request.sandbox_name.is_empty()
226 && sandbox.name == request.sandbox_name)
227 })
228 .cloned()
229 });
230 let sandbox = sandbox.ok_or_else(|| Status::not_found("sandbox not found"))?;
231 Ok(Response::new(GetSandboxResponse {
232 sandbox: Some(sandbox),
233 }))
234 }
235
236 async fn list_sandboxes(
237 &self,

Callers

nothing calls this directly

Calls 3

with_stateMethod · 0.80
pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected