impl A3sBoxClient {
pub async fn create_box(
&self,
request: CreateExecutionRequest,
operation_id: &OperationId,
) -> Result<ExecutionReservation> {
Ok(self.execution_manager.create(request, operation_id).await?)
}
pub async fn start_box(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
) -> Result<ExecutionLease> {
Ok(self
.execution_manager
.start(execution_id, generation)
.await?)
}
pub async fn run_box(
&self,
request: CreateExecutionRequest,
operation_id: &OperationId,
) -> Result<ExecutionLease> {
Ok(self
.execution_manager
.create_and_start(request, operation_id)
.await?)
}
pub async fn inspect_execution(&self, execution_id: &ExecutionId) -> Result<ExecutionStatus> {
Ok(self.execution_manager.inspect(execution_id).await?)
}
pub async fn create_execution_snapshot(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
snapshot_id: &ExecutionSnapshotId,
) -> Result<ExecutionSnapshot> {
Ok(self
.execution_manager
.create_filesystem_snapshot(execution_id, generation, snapshot_id)
.await?)
}
pub async fn execution_snapshot_size(
&self,
snapshot_id: &ExecutionSnapshotId,
) -> Result<Option<u64>> {
Ok(self
.execution_manager
.filesystem_snapshot_size(snapshot_id)
.await?)
}
pub async fn delete_execution_snapshot(
&self,
snapshot_id: &ExecutionSnapshotId,
) -> Result<bool> {
Ok(self
.execution_manager
.delete_filesystem_snapshot(snapshot_id)
.await?)
}
pub async fn read_execution_logs(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
) -> Result<Vec<a3s_box_core::log::LogEntry>> {
Ok(self
.execution_manager
.read_logs(execution_id, generation)
.await?)
}
pub async fn pause_execution(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
keep_memory: bool,
) -> Result<ExecutionLease> {
Ok(self
.execution_manager
.pause(execution_id, generation, keep_memory)
.await?)
}
pub async fn resume_execution(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
) -> Result<ExecutionLease> {
Ok(self
.execution_manager
.resume(execution_id, generation)
.await?)
}
pub async fn restart_execution(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
operation_id: &OperationId,
options: RestartExecutionOptions,
) -> Result<ExecutionLease> {
Ok(self
.execution_manager
.restart_with_options(execution_id, generation, operation_id, options)
.await?)
}
pub async fn kill_execution(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
) -> Result<KillOutcome> {
Ok(self
.execution_manager
.kill(execution_id, generation)
.await?)
}
pub async fn remove_execution(
&self,
execution_id: &ExecutionId,
generation: ExecutionGeneration,
) -> Result<bool> {
Ok(self
.execution_manager
.remove(execution_id, generation)
.await?)
}
pub async fn reconcile_operation(
&self,
operation_id: &OperationId,
) -> Result<ReconcileOutcome> {
Ok(self.execution_manager.reconcile(operation_id).await?)
}
}