pub struct NodeHandler { /* private fields */ }Expand description
Node handler for executing node commands
Implementations§
Source§impl NodeHandler
impl NodeHandler
Sourcepub fn new(client: RestClient) -> Self
pub fn new(client: RestClient) -> Self
Create a new handler bound to the given REST client.
Sourcepub async fn remove(&self, uid: u32) -> Result<()>
pub async fn remove(&self, uid: u32) -> Result<()>
Remove a node from the cluster through the documented node action.
Sourcepub async fn check(&self, uid: u32) -> Result<Value>
pub async fn check(&self, uid: u32) -> Result<Value>
Run node health checks - GET /v1/nodes/check/{uid}
Sourcepub async fn execute_action(
&self,
uid: u32,
action: &str,
) -> Result<NodeActionResponse>
pub async fn execute_action( &self, uid: u32, action: &str, ) -> Result<NodeActionResponse>
Execute a named node action (e.g. "maintenance_on", "maintenance_off").
POST /v1/nodes/{uid}/actions/{action}. The previous implementation
POSTed to /v1/nodes/{uid}/actions with the action name in the body
— that endpoint is the GET-list URL, and the action name was
effectively dropped on the wire, so this method did not work
against real clusters.
Callers that need to send a custom JSON body (e.g. action-specific
parameters) should use Self::action_execute directly.
Sourcepub async fn list_actions(&self) -> Result<Value>
pub async fn list_actions(&self) -> Result<Value>
List all available node actions (global) - GET /v1/nodes/actions
Sourcepub async fn action_detail(&self, uid: u32, action: &str) -> Result<Value>
pub async fn action_detail(&self, uid: u32, action: &str) -> Result<Value>
Get node action detail - GET /v1/nodes/{uid}/actions/{action}
Sourcepub async fn action_execute(
&self,
uid: u32,
action: &str,
body: Value,
) -> Result<Value>
pub async fn action_execute( &self, uid: u32, action: &str, body: Value, ) -> Result<Value>
Execute named node action - POST /v1/nodes/{uid}/actions/{action}
Sourcepub async fn action_delete(&self, uid: u32, action: &str) -> Result<()>
pub async fn action_delete(&self, uid: u32, action: &str) -> Result<()>
Delete node action - DELETE /v1/nodes/{uid}/actions/{action}
Sourcepub async fn snapshots(&self, uid: u32) -> Result<Value>
pub async fn snapshots(&self, uid: u32) -> Result<Value>
List snapshots for a node - GET /v1/nodes/{uid}/snapshots
Sourcepub async fn snapshot_create(&self, uid: u32, name: &str) -> Result<Value>
pub async fn snapshot_create(&self, uid: u32, name: &str) -> Result<Value>
Create a snapshot - POST /v1/nodes/{uid}/snapshots/{name}
Sourcepub async fn snapshot_delete(&self, uid: u32, name: &str) -> Result<()>
pub async fn snapshot_delete(&self, uid: u32, name: &str) -> Result<()>
Delete a snapshot - DELETE /v1/nodes/{uid}/snapshots/{name}
Sourcepub async fn status_all(&self) -> Result<Value>
pub async fn status_all(&self) -> Result<Value>
All nodes status - GET /v1/nodes/status
Sourcepub async fn wd_status_all(&self) -> Result<Value>
pub async fn wd_status_all(&self) -> Result<Value>
Watchdog status for all nodes - GET /v1/nodes/wd_status
Sourcepub async fn wd_status(&self, uid: u32) -> Result<Value>
pub async fn wd_status(&self, uid: u32) -> Result<Value>
Node watchdog status - GET /v1/nodes/{uid}/wd_status
Sourcepub async fn alerts_all(&self) -> Result<Value>
pub async fn alerts_all(&self) -> Result<Value>
All node alerts - GET /v1/nodes/alerts
Sourcepub async fn alerts_for(&self, uid: u32) -> Result<Value>
pub async fn alerts_for(&self, uid: u32) -> Result<Value>
Alerts for node - GET /v1/nodes/alerts/{uid}