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 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 reconcile_operation(
&self,
operation_id: &OperationId,
) -> Result<ReconcileOutcome> {
Ok(self.execution_manager.reconcile(operation_id).await?)
}
}