Approve a network rule.
(
server: &str,
name: &str,
chunk_id: &str,
tls: &TlsOptions,
)
| 7623 | |
| 7624 | /// Approve a network rule. |
| 7625 | pub 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. |
| 7653 | pub async fn sandbox_draft_reject( |
no test coverage detected