pub struct DiagClient { /* private fields */ }
Expand description
The diagnostics client.
Implementations§
Source§impl DiagClient
impl DiagClient
Sourcepub fn from_hybrid_vsock(
driver: impl Driver + Spawn + Clone,
path: &Path,
) -> Self
pub fn from_hybrid_vsock( driver: impl Driver + Spawn + Clone, path: &Path, ) -> Self
Creates a client from a hybrid vsock Unix socket path.
Sourcepub fn from_dialer(driver: impl Driver + Spawn, conn: impl Dial) -> Self
pub fn from_dialer(driver: impl Driver + Spawn, conn: impl Dial) -> Self
Creates a client from a dialer.
This client won’t be usable with operations that require additional connections.
Sourcepub async fn wait_for_server(&self) -> Result<()>
pub async fn wait_for_server(&self) -> Result<()>
Waits for the paravisor to be ready for RPCs.
Sourcepub fn exec(&self, command: impl AsRef<str>) -> ExecBuilder<'_>
pub fn exec(&self, command: impl AsRef<str>) -> ExecBuilder<'_>
Creates a builder for execing a command.
Sourcepub async fn connect_data(&self) -> Result<(u64, PolledSocket<Socket>)>
pub async fn connect_data(&self) -> Result<(u64, PolledSocket<Socket>)>
Creates a new data connection socket.
This can be used with DiagClient::custom_call
.
Sourcepub async fn inspect(
&self,
path: impl Into<String>,
depth: Option<usize>,
timeout: Option<Duration>,
) -> Result<Node>
pub async fn inspect( &self, path: impl Into<String>, depth: Option<usize>, timeout: Option<Duration>, ) -> Result<Node>
Sends an inspection request to the server.
Sourcepub async fn update(
&self,
path: impl Into<String>,
value: impl Into<String>,
) -> Result<Value>
pub async fn update( &self, path: impl Into<String>, value: impl Into<String>, ) -> Result<Value>
Updates an inspectable value.
Sourcepub async fn start(
&self,
env: impl IntoIterator<Item = (String, Option<String>)>,
args: impl IntoIterator<Item = String>,
) -> Result<()>
pub async fn start( &self, env: impl IntoIterator<Item = (String, Option<String>)>, args: impl IntoIterator<Item = String>, ) -> Result<()>
Starts the VM.
Sourcepub async fn kmsg(&self, follow: bool) -> Result<KmsgStream>
pub async fn kmsg(&self, follow: bool) -> Result<KmsgStream>
Gets the contents of /dev/kmsg
Sourcepub async fn read_file(
&self,
follow: bool,
file_path: String,
) -> Result<PolledSocket<Socket>>
pub async fn read_file( &self, follow: bool, file_path: String, ) -> Result<PolledSocket<Socket>>
Gets the contents of the file
Sourcepub fn custom_call(&self) -> CallBuilder<'_>
pub fn custom_call(&self) -> CallBuilder<'_>
Issues a call to the server using a custom RPC.
This can be used to support extension RPCs that are not part of the main diagnostics service.
Sourcepub async fn packet_capture(
&self,
op: PacketCaptureOperation,
num_streams: u32,
snaplen: u16,
) -> Result<(Vec<PolledSocket<Socket>>, u32)>
pub async fn packet_capture( &self, op: PacketCaptureOperation, num_streams: u32, snaplen: u16, ) -> Result<(Vec<PolledSocket<Socket>>, u32)>
Sets up network packet capture trace.
Sourcepub async fn core_dump(
&self,
pid: i32,
writer: impl AsyncWrite + Unpin,
stderr: impl AsyncWrite + Unpin,
verbose: bool,
) -> Result<()>
pub async fn core_dump( &self, pid: i32, writer: impl AsyncWrite + Unpin, stderr: impl AsyncWrite + Unpin, verbose: bool, ) -> Result<()>
Saves a core dump file being streamed from Underhill
Sourcepub async fn dump_saved_state(&self) -> Result<Vec<u8>>
pub async fn dump_saved_state(&self) -> Result<Vec<u8>>
Dumps the VM’s VTL2 saved state.