]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/api2/status.rs
move RRD code into proxmox-rrd crate
[proxmox-backup.git] / src / api2 / status.rs
index 3aff91e7770f1455ac43625e5bbb5a8607ec9c5a..995e12cc7537f1bd8f819cbdf10df4726beb172f 100644 (file)
@@ -14,21 +14,16 @@ use proxmox::api::{
     SubdirMap,
 };
 
-use crate::api2::types::{
-    DATASTORE_SCHEMA,
-    RRDMode,
-    RRDTimeFrameResolution,
-    Authid,
+use pbs_api_types::{
+    Authid, DATASTORE_SCHEMA, PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_BACKUP,
 };
+use proxmox_rrd::{RRDMode, RRDTimeFrameResolution};
+
+use pbs_datastore::DataStore;
+use pbs_config::CachedUserInfo;
 
-use crate::backup::DataStore;
-use crate::config::datastore;
 use crate::tools::statistics::{linear_regression};
-use crate::config::cached_user_info::CachedUserInfo;
-use crate::config::acl::{
-    PRIV_DATASTORE_AUDIT,
-    PRIV_DATASTORE_BACKUP,
-};
+use crate::RRD_CACHE;
 
 #[api(
     returns: {
@@ -89,7 +84,7 @@ pub fn datastore_status(
     rpcenv: &mut dyn RpcEnvironment,
     ) -> Result<Value, Error> {
 
-    let (config, _digest) = datastore::config()?;
+    let (config, _digest) = pbs_config::datastore::config()?;
 
     let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?;
     let user_info = CachedUserInfo::new()?;
@@ -129,7 +124,7 @@ pub fn datastore_status(
         let rrd_dir = format!("datastore/{}", store);
         let now = proxmox::tools::time::epoch_f64();
 
-        let get_rrd = |what: &str| crate::rrd::extract_cached_data(
+        let get_rrd = |what: &str| RRD_CACHE.extract_cached_data(
             &rrd_dir,
             what,
             now,