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

Function validate_vm_sandbox

crates/openshell-driver-vm/src/driver.rs:3140–3154  ·  view source on GitHub ↗
(sandbox: &Sandbox, gpu_enabled: bool)

Source from the content-addressed store, hash-verified

3138// gRPC API surface, so boxing here would diverge from every other handler.
3139#[allow(clippy::result_large_err)]
3140fn validate_vm_sandbox(sandbox: &Sandbox, gpu_enabled: bool) -> Result<(), Status> {
3141 validate_sandbox_id(&sandbox.id)?;
3142
3143 let spec = sandbox
3144 .spec
3145 .as_ref()
3146 .ok_or_else(|| Status::invalid_argument("sandbox spec is required"))?;
3147
3148 if let Some(template) = spec.template.as_ref() {
3149 validate_vm_sandbox_template(template)?;
3150 }
3151 validate_gpu_request(sandbox, gpu_enabled)?;
3152
3153 Ok(())
3154}
3155
3156#[allow(clippy::result_large_err)]
3157fn validate_vm_sandbox_template(template: &SandboxTemplate) -> Result<(), Status> {

Calls 3

validate_sandbox_idFunction · 0.85
validate_gpu_requestFunction · 0.70