client_rust/resources/
node.rs1use crate::api_client::ApiClient;
2
3pub struct NodeClient {
4 api_client: ApiClient,
5}
6
7impl NodeClient {
8 pub fn new(api_client: ApiClient) -> Self {
9 Self { api_client }
10 }
11
12 pub async fn get_node(&self, name: &str) -> Result<serde_json::Value, reqwest::Error> {
13 let path = format!("api/v1/nodes/{}", name);
14 self.api_client.send_request(reqwest::Method::GET, &path, None).await
15 }
16
17 pub async fn list_nodes(&self) -> Result<serde_json::Value, reqwest::Error> {
18 let path = "api/v1/nodes";
19 self.api_client.send_request(reqwest::Method::GET, path, None).await
20 }
21}