canic_core/api/
bootstrap.rs1use crate::{
2 PublicError, dto::validation::ValidationReport, workflow,
3 workflow::topology::guard::TopologyGuard,
4};
5
6pub struct RootBootstrapApi;
11
12impl RootBootstrapApi {
13 pub async fn create_canisters() -> Result<(), PublicError> {
14 let _guard = TopologyGuard::try_enter()?;
15
16 workflow::bootstrap::root::root_create_canisters()
17 .await
18 .map_err(PublicError::from)
19 }
20
21 pub async fn import_pool_from_config() -> Result<(), PublicError> {
22 workflow::bootstrap::root::root_import_pool_from_config().await;
23
24 Ok(())
25 }
26
27 pub fn rebuild_directories_from_registry() -> Result<(), PublicError> {
28 let _guard = TopologyGuard::try_enter()?;
29
30 workflow::bootstrap::root::root_rebuild_directories_from_registry()
31 .map_err(PublicError::from)
32 }
33
34 #[must_use]
35 pub fn validate_state() -> ValidationReport {
36 workflow::bootstrap::root::root_validate_state()
37 }
38}