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

Method request_ok

crates/openshell-driver-podman/src/client.rs:379–392  ·  view source on GitHub ↗

Perform a request that returns no meaningful body.

(
        &self,
        method: hyper::Method,
        path: &str,
        body: Option<&Value>,
    )

Source from the content-addressed store, hash-verified

377
378 /// Perform a request that returns no meaningful body.
379 async fn request_ok(
380 &self,
381 method: hyper::Method,
382 path: &str,
383 body: Option<&Value>,
384 ) -> Result<(), PodmanApiError> {
385 let (status, bytes) = self.request(method, path, body, API_TIMEOUT).await?;
386 let code = status.as_u16();
387 if status.is_success() || code == 304 {
388 Ok(())
389 } else {
390 Err(error_from_response(code, &bytes))
391 }
392 }
393
394 /// POST a JSON body and ignore 409 Conflict (resource already exists).
395 async fn create_ignore_conflict(&self, path: &str, body: &Value) -> Result<(), PodmanApiError> {

Callers 3

start_containerMethod · 0.80
remove_containerMethod · 0.80
remove_volumeMethod · 0.80

Calls 2

error_from_responseFunction · 0.85
requestMethod · 0.80

Tested by

no test coverage detected