canic_core/api/
component_deployment.rs1use crate::{
8 InternalError,
9 dto::{component_deployment::ProtectedComponentDeployment, error::Error},
10 ids::FleetServiceId,
11 ops::storage::{StorageOpsError, fleet_activation::FleetActivationOps},
12};
13
14pub struct ComponentDeploymentApi;
21
22impl ComponentDeploymentApi {
23 pub fn current() -> Result<ProtectedComponentDeployment, Error> {
25 FleetActivationOps::component_deployment()
26 .map_err(StorageOpsError::from)
27 .map_err(InternalError::from)
28 .map_err(Into::into)
29 }
30
31 pub fn require_service_authority(service: &FleetServiceId) -> Result<(), Error> {
33 crate::workflow::component_runtime::require_service_authority(service).map_err(Into::into)
34 }
35}