unifly_api/session/
networkconf.rs1use serde_json::Value;
7use tracing::debug;
8
9use super::SessionClient;
10use crate::error::Error;
11
12impl SessionClient {
13 pub async fn list_network_conf(&self) -> Result<Vec<Value>, Error> {
15 let url = self.site_url("rest/networkconf");
16 debug!("listing networkconf records");
17 self.get(url).await
18 }
19
20 pub async fn create_network_conf(&self, body: &Value) -> Result<Vec<Value>, Error> {
22 let url = self.site_url("rest/networkconf");
23 debug!("creating networkconf record");
24 self.post(url, body).await
25 }
26
27 pub async fn update_network_conf(
29 &self,
30 record_id: &str,
31 body: &Value,
32 ) -> Result<Vec<Value>, Error> {
33 let url = self.site_url(&format!("rest/networkconf/{record_id}"));
34 debug!(record_id, "updating networkconf record");
35 self.put(url, body).await
36 }
37
38 pub async fn delete_network_conf(&self, record_id: &str) -> Result<Vec<Value>, Error> {
40 let url = self.site_url(&format!("rest/networkconf/{record_id}"));
41 debug!(record_id, "deleting networkconf record");
42 self.delete(url).await
43 }
44}