MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / handle_delete_provider

Function handle_delete_provider

crates/openshell-server/src/grpc/provider.rs:2261–2287  ·  view source on GitHub ↗
(
    state: &Arc<ServerState>,
    request: Request<DeleteProviderRequest>,
)

Source from the content-addressed store, hash-verified

2259}
2260
2261pub(super) async fn handle_delete_provider(
2262 state: &Arc<ServerState>,
2263 request: Request<DeleteProviderRequest>,
2264) -> Result<Response<DeleteProviderResponse>, Status> {
2265 let name = request.into_inner().name;
2266 let provider_profile = provider_profile_for_name(state.store.as_ref(), &name).await;
2267 let result = delete_provider_record(state.store.as_ref(), &name).await;
2268 match result {
2269 Ok(deleted) => {
2270 let outcome = TelemetryOutcome::from_success(deleted);
2271 emit_provider_profile_lifecycle(
2272 provider_profile.unwrap_or(TelemetryProviderProfile::Custom),
2273 LifecycleOperation::Delete,
2274 outcome,
2275 );
2276 Ok(Response::new(DeleteProviderResponse { deleted }))
2277 }
2278 Err(err) => {
2279 emit_provider_profile_lifecycle(
2280 provider_profile.unwrap_or(TelemetryProviderProfile::Custom),
2281 LifecycleOperation::Delete,
2282 TelemetryOutcome::Failure,
2283 );
2284 Err(err)
2285 }
2286 }
2287}
2288
2289fn emit_provider_lifecycle(
2290 provider_type: &str,

Callers 1

delete_providerMethod · 0.85

Calls 3

delete_provider_recordFunction · 0.85

Tested by

no test coverage detected