(
&self,
request: Request<GetSandboxRequest>,
)
| 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, |
nothing calls this directly
no test coverage detected