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

Function sandbox_draft_approve

crates/openshell-cli/src/run.rs:7625–7650  ·  view source on GitHub ↗

Approve a network rule.

(
    server: &str,
    name: &str,
    chunk_id: &str,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

7623
7624/// Approve a network rule.
7625pub async fn sandbox_draft_approve(
7626 server: &str,
7627 name: &str,
7628 chunk_id: &str,
7629 tls: &TlsOptions,
7630) -> Result<()> {
7631 let mut client = grpc_client(server, tls).await?;
7632
7633 let response = client
7634 .approve_draft_chunk(ApproveDraftChunkRequest {
7635 name: name.to_string(),
7636 chunk_id: chunk_id.to_string(),
7637 })
7638 .await
7639 .into_diagnostic()?;
7640
7641 let inner = response.into_inner();
7642 println!(
7643 "{} Chunk approved. Policy version: {}, hash: {}",
7644 "OK".green().bold(),
7645 inner.policy_version,
7646 &inner.policy_hash[..12.min(inner.policy_hash.len())]
7647 );
7648
7649 Ok(())
7650}
7651
7652/// Reject a network rule.
7653pub async fn sandbox_draft_reject(

Callers 1

mainFunction · 0.85

Calls 2

grpc_clientFunction · 0.85
approve_draft_chunkMethod · 0.45

Tested by

no test coverage detected