canic-core 0.110.23

Canic — a canister orchestration and management toolkit for the Internet Computer
Documentation
pub mod error {
    pub use crate::domain::provisioning_failure::{
        MAX_PROVISIONING_BACKOFF_SECONDS, ProvisioningFailureStage, ProvisioningRetryCategory,
        retry_delay_seconds,
    };
    pub use crate::error::InternalError;
    pub use crate::view::provisioning_failure::ProvisioningFailureView;
}

pub mod config {
    pub mod schema {
        pub use crate::config::schema::ComponentChildKind;
    }

    pub use crate::config::{
        ComponentDeploymentConfiguration, ComponentDeploymentPurpose, ComponentGroupDeploymentSpec,
        ComponentGroupPlacementPolicy, ComponentLimits, ComponentProvisioningGrant,
        ComponentSpawnGrant, ComponentSpec, ComponentTopology, ConfigModel,
        FlattenedComponentGroupDeploymentMember, FleetServiceMemberPurpose,
        FleetServicePlacementPolicy, FleetServiceTopology,
    };
}

pub mod format {
    pub use crate::shared_support::format::byte_size;
}

pub mod model {
    pub mod fleet_funding_policy {
        pub use crate::model::fleet_funding_policy::{
            FleetFundingPolicyValidationError, validate_coordinator_root_funding_policy,
            validate_fleet_root_funding_capacity, validate_fleet_subnet_root_funding_authority,
        };
    }

    pub mod replay {
        pub use crate::model::replay::{CommandKind, ReplayCostGuardSettlement};
    }
}

pub mod policy {
    pub mod cycles_funding {
        pub use crate::domain::policy::pure::cycles_funding::{
            FundingDecision, FundingPolicyViolation, cooldown_retry_after_secs, evaluate,
            remaining_child_budget,
        };
        pub use crate::model::cycles_funding::{FundingLedgerSnapshot, FundingLimits};
    }

    pub mod component_allocation {
        pub use crate::domain::policy::pure::component_allocation::{
            ComponentAllocationPolicyError, PeerComponentProvisioningInput,
            PeerComponentProvisioningReadiness, TopLevelComponentAllocationDecision,
            TopLevelComponentAllocationInput, authorize_peer_component_provisioning,
            reserve_top_level_component,
        };
    }

    pub mod component_child_allocation {
        pub use crate::domain::policy::pure::component_child_allocation::{
            ComponentChildAllocationDecision, ComponentChildAllocationInput,
            ComponentChildAllocationMode, ComponentChildAllocationPolicyError,
            ComponentChildAllocationReadiness, ComponentRegistryVersionEvidence,
            reserve_component_child,
        };
    }

    pub mod deployment {
        pub use crate::domain::policy::pure::deployment::MINIMUM_DEPLOYMENT_RESERVE_CYCLES;
    }

    pub mod fleet_funding {
        pub use crate::domain::policy::pure::fleet_funding::{
            FleetFundingAutomaticUsageSnapshot, FleetFundingWindowSnapshot,
            FleetRootGrantAuthorityMatch, FleetRootGrantAvailability, FleetRootGrantDecision,
            FleetRootGrantDecisionInput, FleetRootGrantNoGrantReason, decide_fleet_root_grant,
            funding_window_remaining,
        };
    }
}

pub mod ops {
    pub mod async_job_recovery {
        pub use crate::ops::storage::async_job_recovery::{
            AsyncJobAttempt, AsyncJobClaim, AsyncJobCompletion, AsyncJobOwner, AsyncJobRecoveryOps,
        };
    }

    pub mod config {
        pub use crate::ops::config::RootConfigOps as ConfigOps;
    }

    pub mod component_runtime {
        pub use crate::ops::component_runtime::ComponentRuntimeOps;
    }

    pub mod component_provisioning_plan {
        pub use crate::ops::component_provisioning_plan::{
            ComponentProvisioningPlacementAuthority, ComponentProvisioningPlanOps,
            ComponentProvisioningScaleOutAuthority, MAX_FLEET_COMPONENT_PROVISIONING_PLAN_BATCHES,
            MAX_FLEET_COMPONENT_PROVISIONING_PLAN_CANONICAL_BYTES,
            MAX_FLEET_COMPONENT_PROVISIONING_PLAN_CONFIRMATION_ROOTS,
            MAX_FLEET_COMPONENT_PROVISIONING_PLAN_ENTRIES,
            MAX_FLEET_COMPONENT_PROVISIONING_PLAN_PLACEMENTS,
            MAX_FLEET_SUBNET_ROOT_PROVISIONING_ACCEPTANCE_PAYLOAD_BYTES,
            MAX_FLEET_SUBNET_ROOT_PROVISIONING_BATCH_CANONICAL_BYTES,
            RootComponentProvisioningBatchValidation,
        };
    }

    pub mod component_provisioning_receipt {
        pub use crate::ops::component_provisioning_receipt::{
            RootComponentProvisioningAcceptanceReceiptAuthority,
            RootComponentProvisioningProvisionedReceiptAuthority,
            RootComponentProvisioningPublishedReceiptAuthority,
            RootComponentProvisioningReceiptOps,
            RootComponentProvisioningRuntimesActiveReceiptAuthority,
        };
    }

    pub mod cost_guard {
        pub use crate::ops::cost_guard::{
            CostGuardPermit, CostGuardRequest, CostGuardReserveError,
        };
    }

    pub mod fleet_registry {
        pub use crate::ops::fleet_registry::{
            FleetRegistryOps, MAX_FLEET_REGISTRY_CANONICAL_BYTES,
        };
    }

    pub mod fleet_service_binding {
        pub use crate::ops::fleet_service_binding::FleetServiceBindingOps;
    }

    pub mod root_draining_reservation {
        pub use crate::ops::root_draining_reservation::FleetSubnetRootDrainingReservationOps;
    }

    pub mod ic {
        pub use crate::ops::ic::IcOps;

        pub mod call {
            pub use crate::ops::ic::call::CallOps;
        }

        pub mod cycles_ledger {
            pub use crate::{
                infra::ic::cycles_ledger::{
                    CyclesLedgerCreateCanisterError, CyclesLedgerCreateCanisterSuccess,
                    CyclesLedgerTransferError,
                },
                ops::ic::cycles_ledger::CyclesLedgerOps,
            };
        }

        pub mod mgmt {
            pub use crate::ops::ic::mgmt::{
                CanisterSettings, CanisterStatus, CanisterStatusObservation, CanisterStatusType,
                MgmtOps, UpdateSettingsArgs,
            };
        }

        pub mod icp_refill {
            pub use crate::ops::ic::icp_refill::{IcpRefillOps, Icrc1Account};
        }

        pub mod nns {
            pub use crate::ops::ic::nns::registry::NnsRegistryOps;
        }

        pub mod build_network {
            pub use crate::ops::ic::build_network::BuildNetworkOps;
        }
    }

    pub mod icp_refill {
        pub use crate::ops::storage::icp_refill::IcpRefillStoreOps;
    }

    pub mod runtime {
        pub mod bootstrap {
            pub use crate::ops::runtime::bootstrap::{BootstrapPhaseLabel, BootstrapStatusOps};
        }

        pub mod env {
            pub use crate::ops::runtime::env::EnvOps;
        }

        pub mod ready {
            pub use crate::ops::runtime::ready::ReadyOps;
        }

        pub mod install_source {
            pub use crate::ops::runtime::install_source::ApprovedModuleSource;

            /// Resolve one Store-backed chunk source for control-plane installation.
            pub async fn resolve_approved_module_source(
                role: &crate::ids::CanisterRole,
            ) -> Result<ApprovedModuleSource, crate::error::InternalError> {
                crate::ops::runtime::install_source::ModuleSourceRuntimeApi::approved_module_source(
                    role,
                )
                .await
            }
        }

        pub mod init_payload {
            pub use crate::ops::runtime::init_payload::wasm_store_init_args;
        }
    }
}

pub mod view {
    pub mod state_cascade {
        pub use crate::view::state_cascade::{StateCascadeEndpoint, StateCascadeTarget};
    }
    pub mod fleet_activation {
        pub use crate::view::fleet_activation::{
            FleetActivationTransition, FleetActivationWasmStoreView,
        };
    }
}

pub mod workflow {
    pub mod fleet_admission_projection {
        pub use crate::workflow::fleet_admission_projection::compile_fleet_admission_projection;
    }

    pub mod cost_guard {
        pub use crate::workflow::cost_guard::{CostGuardWorkflow, map_cost_guard_reserve_error};
    }

    pub mod runtime {
        pub mod fleet_activation {
            pub use crate::workflow::runtime::fleet_activation::FleetActivationWorkflow;
        }

        pub mod install {
            pub use crate::workflow::runtime::install::ModuleInstallWorkflow;
        }
    }

    pub mod ic {
        pub use crate::workflow::ic::IcWorkflow;
    }

    pub mod rpc {
        pub use crate::workflow::rpc::{
            RootCapabilityAuthority, RootCapabilityCallerAuthority,
            RootCapabilityLifecycleExecutor, RootCapabilityMemberAuthority,
            RootCapabilityMemberLifecycle, RootCapabilityParentAuthority,
            RootComponentChildProvisionRequest, RootComponentChildRecycleOutcome,
            RootComponentChildRecycleRequest,
        };
    }

    pub mod topology {
        pub mod guard {
            pub use crate::workflow::topology::guard::TopologyGuard;
        }
    }

    pub mod state {
        /// Apply one root Fleet-state command to an exact caller-supplied child inventory.
        pub async fn execute_fleet_command_to(
            cmd: crate::dto::state::FleetCommand,
            root_children: &[crate::view::state_cascade::StateCascadeTarget],
            reconcile_funding: bool,
        ) -> Result<crate::dto::state::FleetCommandExecutionResponse, crate::error::InternalError>
        {
            crate::workflow::state::FleetStateWorkflow::execute_command_to(
                cmd,
                root_children,
                reconcile_funding,
            )
            .await
        }
    }
}