| 5230 | } |
| 5231 | |
| 5232 | pub async fn provider_refresh_status( |
| 5233 | server: &str, |
| 5234 | name: &str, |
| 5235 | credential_key: Option<&str>, |
| 5236 | tls: &TlsOptions, |
| 5237 | ) -> Result<()> { |
| 5238 | let mut client = grpc_client(server, tls).await?; |
| 5239 | let response = client |
| 5240 | .get_provider_refresh_status(GetProviderRefreshStatusRequest { |
| 5241 | provider: name.to_string(), |
| 5242 | credential_key: credential_key.unwrap_or_default().to_string(), |
| 5243 | }) |
| 5244 | .await |
| 5245 | .into_diagnostic()? |
| 5246 | .into_inner(); |
| 5247 | |
| 5248 | if response.credentials.is_empty() { |
| 5249 | if let Some(credential_key) = credential_key { |
| 5250 | println!( |
| 5251 | "No refresh configuration found for provider '{name}' credential '{credential_key}'." |
| 5252 | ); |
| 5253 | } else { |
| 5254 | println!("No refresh configurations found for provider '{name}'."); |
| 5255 | } |
| 5256 | return Ok(()); |
| 5257 | } |
| 5258 | |
| 5259 | println!("{}", refresh_status_header()); |
| 5260 | for status in response.credentials { |
| 5261 | print_refresh_status_row(&status); |
| 5262 | } |
| 5263 | Ok(()) |
| 5264 | } |
| 5265 | |
| 5266 | fn refresh_status_header() -> String { |
| 5267 | format!( |