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

Function provider_list

crates/openshell-cli/src/run.rs:4946–5012  ·  view source on GitHub ↗
(
    server: &str,
    limit: u32,
    offset: u32,
    names_only: bool,
    output: &str,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

4944}
4945
4946pub async fn provider_list(
4947 server: &str,
4948 limit: u32,
4949 offset: u32,
4950 names_only: bool,
4951 output: &str,
4952 tls: &TlsOptions,
4953) -> Result<()> {
4954 let mut client = grpc_client(server, tls).await?;
4955 let response = client
4956 .list_providers(ListProvidersRequest { limit, offset })
4957 .await
4958 .into_diagnostic()?;
4959 let providers = response.into_inner().providers;
4960
4961 // Handle structured output formats (json, yaml)
4962 if crate::output::print_output_collection(output, &providers, provider_to_json)? {
4963 return Ok(());
4964 }
4965
4966 if providers.is_empty() {
4967 if !names_only {
4968 println!("No providers found.");
4969 }
4970 return Ok(());
4971 }
4972
4973 if names_only {
4974 for provider in providers {
4975 println!("{}", provider.object_name());
4976 }
4977 return Ok(());
4978 }
4979
4980 let name_width = providers
4981 .iter()
4982 .map(|provider| provider.object_name().len())
4983 .max()
4984 .unwrap_or(4)
4985 .max(4);
4986 let type_width = providers
4987 .iter()
4988 .map(|provider| provider.r#type.len())
4989 .max()
4990 .unwrap_or(4)
4991 .max(4);
4992
4993 println!(
4994 "{:<name_width$} {:<type_width$} {:<16} {}",
4995 "NAME".bold(),
4996 "TYPE".bold(),
4997 "CREDENTIAL_KEYS".bold(),
4998 "CONFIG_KEYS".bold(),
4999 );
5000
5001 for provider in providers {
5002 println!(
5003 "{:<name_width$} {:<type_width$} {:<16} {}",

Callers 5

mainFunction · 0.85
provider_list_json_emptyFunction · 0.85

Calls 6

grpc_clientFunction · 0.85
print_output_collectionFunction · 0.85
lenMethod · 0.80
object_nameMethod · 0.80
list_providersMethod · 0.45
is_emptyMethod · 0.45