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

Method ensure_network

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

Create a bridge network with DNS enabled. Idempotent.

(&self, name: &str)

Source from the content-addressed store, hash-verified

522
523 /// Create a bridge network with DNS enabled. Idempotent.
524 pub async fn ensure_network(&self, name: &str) -> Result<(), PodmanApiError> {
525 validate_name(name)?;
526 self.create_ignore_conflict(
527 "/libpod/networks/create",
528 &serde_json::json!({
529 "name": name,
530 "driver": "bridge",
531 "dns_enabled": true,
532 }),
533 )
534 .await
535 }
536
537 /// Inspect a network and return the gateway IP of its first subnet.
538 ///

Callers 1

newMethod · 0.80

Calls 2

validate_nameFunction · 0.85

Tested by

no test coverage detected