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

Function provider_profile_export_text

crates/openshell-cli/src/run.rs:5078–5103  ·  view source on GitHub ↗
(
    server: &str,
    id: &str,
    output: &str,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

5076}
5077
5078pub async fn provider_profile_export_text(
5079 server: &str,
5080 id: &str,
5081 output: &str,
5082 tls: &TlsOptions,
5083) -> Result<String> {
5084 let mut client = grpc_client(server, tls).await?;
5085 let response = client
5086 .get_provider_profile(GetProviderProfileRequest { id: id.to_string() })
5087 .await
5088 .into_diagnostic()?;
5089 let profile = response
5090 .into_inner()
5091 .profile
5092 .ok_or_else(|| miette!("provider profile '{id}' not found"))?;
5093 let profile = ProviderTypeProfile::from_proto(&profile);
5094
5095 match output {
5096 "json" => profile_to_json(&profile).into_diagnostic(),
5097 "yaml" => profile_to_yaml(&profile).into_diagnostic(),
5098 "table" => Err(miette!(
5099 "profile export supports '-o yaml' and '-o json'; table output is not supported"
5100 )),
5101 _ => Err(miette!("unsupported output format: {output}")),
5102 }
5103}
5104
5105pub async fn provider_profile_import(
5106 server: &str,

Calls 5

grpc_clientFunction · 0.85
from_protoFunction · 0.85
profile_to_jsonFunction · 0.85
profile_to_yamlFunction · 0.85
get_provider_profileMethod · 0.45