MCPcopy Create free account
hub / github.com/dfinity/orbit / deploy_station

Method deploy_station

core/control-panel/impl/src/controllers/station.rs:131–155  ·  view source on GitHub ↗
(&self, input: DeployStationInput)

Source from the content-addressed store, hash-verified

129 /// Deploys a new station for the user and returns its id.
130 #[with_middleware(tail = use_canister_call_metric("deploy_station", &result))]
131 async fn deploy_station(&self, input: DeployStationInput) -> ApiResult<DeployStationResponse> {
132 let ctx = CallContext::get();
133 let config = canister_config().ok_or(DeployError::Failed {
134 reason: "Canister config not initialized.".to_string(),
135 })?;
136 let max_concurrency = config
137 .global_rate_limiter
138 .remaining_quota()
139 .ok_or(UserError::DeployStationQuotaExceeded)?;
140 let _lock = STATE
141 .with(|state| {
142 CallerGuard::new(
143 state.clone(),
144 ctx.caller(),
145 CallerGuardParams::default().with_max_concurrency(max_concurrency),
146 )
147 })
148 .ok_or(UserError::ConcurrentStationDeployment)?;
149
150 let deployed_station_id = self.deploy_service.deploy_station(input, &ctx).await?;
151
152 Ok(DeployStationResponse {
153 canister_id: deployed_station_id,
154 })
155 }
156
157 /// Checks if the user can deploy a new station.
158 async fn can_deploy_station(&self) -> ApiResult<CanDeployStationResponse> {

Callers 1

deploy_stationFunction · 0.45

Calls 4

canister_configFunction · 0.85
remaining_quotaMethod · 0.80
with_max_concurrencyMethod · 0.80
callerMethod · 0.45

Tested by

no test coverage detected