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

Function provider_profile_lint

crates/openshell-cli/src/run.rs:5187–5215  ·  view source on GitHub ↗
(
    server: &str,
    file: Option<&Path>,
    from: Option<&Path>,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

5185}
5186
5187pub async fn provider_profile_lint(
5188 server: &str,
5189 file: Option<&Path>,
5190 from: Option<&Path>,
5191 tls: &TlsOptions,
5192) -> Result<()> {
5193 let (items, mut diagnostics) = load_profile_import_items(file, from)?;
5194 if items.is_empty() && diagnostics.is_empty() {
5195 return Err(miette!("no provider profile files found"));
5196 }
5197
5198 if !items.is_empty() {
5199 let mut client = grpc_client(server, tls).await?;
5200 let response = client
5201 .lint_provider_profiles(LintProviderProfilesRequest { profiles: items })
5202 .await
5203 .into_diagnostic()?
5204 .into_inner();
5205 diagnostics.extend(response.diagnostics);
5206 }
5207
5208 if profile_diagnostics_have_errors(&diagnostics) {
5209 print_profile_diagnostics(&diagnostics);
5210 return Err(miette!("provider profile lint failed"));
5211 }
5212
5213 println!("Provider profile lint passed.");
5214 Ok(())
5215}
5216
5217pub async fn provider_profile_delete(server: &str, id: &str, tls: &TlsOptions) -> Result<()> {
5218 let mut client = grpc_client(server, tls).await?;

Calls 6

grpc_clientFunction · 0.85
is_emptyMethod · 0.45