parent
3af7b892b2
commit
f10c7df262
10 changed files with 276 additions and 326 deletions
15
src/api.rs
15
src/api.rs
|
@ -40,6 +40,19 @@ pub struct JoinResponse {
|
|||
pub mqtt: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct ShellParam {
|
||||
pub cmd: String,
|
||||
pub cwd: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct ShellResponse {
|
||||
pub stdout: String,
|
||||
pub stderr: String,
|
||||
pub status: i32,
|
||||
}
|
||||
|
||||
/// Setup a MQTT connection for `machine_id` on `mqtt`.
|
||||
///
|
||||
/// This will connect either over `ws://` or `wss://` depending on the scheme of `mqtt`. By default it will use `wss://`.
|
||||
|
@ -175,6 +188,7 @@ impl ClientAction {
|
|||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum ClientActions {
|
||||
OSQuery(String),
|
||||
Shell(String, String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
@ -195,4 +209,5 @@ impl ServerResponse {
|
|||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum ServerResponses {
|
||||
OSQuery(String),
|
||||
Shell(ShellResponse),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue