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

Function handle_get_service

crates/openshell-server/src/grpc/service.rs:127–140  ·  view source on GitHub ↗
(
    state: &Arc<ServerState>,
    request: Request<GetServiceRequest>,
)

Source from the content-addressed store, hash-verified

125}
126
127pub(super) async fn handle_get_service(
128 state: &Arc<ServerState>,
129 request: Request<GetServiceRequest>,
130) -> Result<Response<ServiceEndpointResponse>, Status> {
131 let req = request.into_inner();
132 validate_endpoint_name("sandbox", &req.sandbox, MAX_SANDBOX_NAME_LEN)?;
133 validate_optional_endpoint_name("service", &req.service, MAX_SERVICE_NAME_LEN)?;
134
135 let endpoint = get_service_endpoint(state, &req.sandbox, &req.service)
136 .await?
137 .ok_or_else(|| Status::not_found("service endpoint not found"))?;
138
139 Ok(Response::new(service_endpoint_response(state, endpoint)))
140}
141
142pub(super) async fn handle_list_services(
143 state: &Arc<ServerState>,

Callers 3

get_serviceMethod · 0.85

Calls 4

validate_endpoint_nameFunction · 0.85
get_service_endpointFunction · 0.85

Tested by

no test coverage detected