Ping the Podman API to verify connectivity.
(&self)
| 605 | |
| 606 | /// Ping the Podman API to verify connectivity. |
| 607 | pub async fn ping(&self) -> Result<(), PodmanApiError> { |
| 608 | // _ping is outside the versioned API path. |
| 609 | let req = Self::build_request(hyper::Method::GET, "/_ping", Full::new(Bytes::new()), None); |
| 610 | let (status, _) = self.send_request(req, API_TIMEOUT).await?; |
| 611 | if status.is_success() { |
| 612 | Ok(()) |
| 613 | } else { |
| 614 | Err(PodmanApiError::Api { |
| 615 | status: status.as_u16(), |
| 616 | message: "ping failed".to_string(), |
| 617 | }) |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | /// Get system info. |
| 622 | pub async fn system_info(&self) -> Result<SystemInfo, PodmanApiError> { |