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

Function gateway_settings_get

crates/openshell-cli/src/run.rs:6402–6433  ·  view source on GitHub ↗
(server: &str, json: bool, tls: &TlsOptions)

Source from the content-addressed store, hash-verified

6400}
6401
6402pub async fn gateway_settings_get(server: &str, json: bool, tls: &TlsOptions) -> Result<()> {
6403 let mut client = grpc_client(server, tls).await?;
6404 let response = client
6405 .get_gateway_config(GetGatewayConfigRequest {})
6406 .await
6407 .into_diagnostic()?
6408 .into_inner();
6409
6410 if json {
6411 let obj = settings_to_json_global(&response);
6412 println!("{}", serde_json::to_string_pretty(&obj).into_diagnostic()?);
6413 return Ok(());
6414 }
6415
6416 println!("Scope: global");
6417 println!("Settings Rev: {}", response.settings_revision);
6418
6419 if response.settings.is_empty() {
6420 println!("Settings: No settings available.");
6421 return Ok(());
6422 }
6423
6424 println!("Settings:");
6425 let mut keys: Vec<_> = response.settings.keys().cloned().collect();
6426 keys.sort();
6427 for key in keys {
6428 if let Some(setting) = response.settings.get(&key) {
6429 println!(" {} = {}", key, format_setting_value(Some(setting)));
6430 }
6431 }
6432 Ok(())
6433}
6434
6435fn settings_to_json_sandbox(
6436 name: &str,

Callers 1

mainFunction · 0.85

Calls 5

grpc_clientFunction · 0.85
settings_to_json_globalFunction · 0.85
get_gateway_configMethod · 0.45
is_emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected