remove proxmox-rrd-api-types crate, s/RRDTimeFrameResolution/RRDTimeFrame/

Because the types used inside the RRD have other requirements
than the API types:

- other serialization format
- the API may not support all RRD features

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-10-13 10:24:44 +02:00
committed by Thomas Lamprecht
parent 426dda0730
commit c68fa58a59
11 changed files with 47 additions and 67 deletions

View File

@ -28,7 +28,7 @@ use pxar::EntryKind;
use pbs_api_types::{ Authid, BackupContent, Counts, CryptMode,
DataStoreListItem, GarbageCollectionStatus, GroupListItem,
SnapshotListItem, SnapshotVerifyState, PruneOptions,
DataStoreStatus, RRDMode, RRDTimeFrameResolution,
DataStoreStatus, RRDMode, RRDTimeFrame,
BACKUP_ARCHIVE_NAME_SCHEMA, BACKUP_ID_SCHEMA, BACKUP_TIME_SCHEMA,
BACKUP_TYPE_SCHEMA, DATASTORE_SCHEMA,
IGNORE_VERIFIED_BACKUPS_SCHEMA, UPID_SCHEMA,
@ -1537,7 +1537,7 @@ pub fn pxar_file_download(
schema: DATASTORE_SCHEMA,
},
timeframe: {
type: RRDTimeFrameResolution,
type: RRDTimeFrame,
},
cf: {
type: RRDMode,
@ -1551,7 +1551,7 @@ pub fn pxar_file_download(
/// Read datastore stats
pub fn get_rrd_stats(
store: String,
timeframe: RRDTimeFrameResolution,
timeframe: RRDTimeFrame,
cf: RRDMode,
_param: Value,
) -> Result<Value, Error> {

View File

@ -6,7 +6,7 @@ use proxmox_router::{Permission, Router};
use proxmox_schema::api;
use pbs_api_types::{
NODE_SCHEMA, RRDMode, RRDTimeFrameResolution, PRIV_SYS_AUDIT,
NODE_SCHEMA, RRDMode, RRDTimeFrame, PRIV_SYS_AUDIT,
};
use crate::extract_rrd_data;
@ -14,7 +14,7 @@ use crate::extract_rrd_data;
pub fn create_value_from_rrd(
basedir: &str,
list: &[&str],
timeframe: RRDTimeFrameResolution,
timeframe: RRDTimeFrame,
mode: RRDMode,
) -> Result<Value, Error> {
@ -63,7 +63,7 @@ pub fn create_value_from_rrd(
schema: NODE_SCHEMA,
},
timeframe: {
type: RRDTimeFrameResolution,
type: RRDTimeFrame,
},
cf: {
type: RRDMode,
@ -76,7 +76,7 @@ pub fn create_value_from_rrd(
)]
/// Read node stats
fn get_node_stats(
timeframe: RRDTimeFrameResolution,
timeframe: RRDTimeFrame,
cf: RRDMode,
_param: Value,
) -> Result<Value, Error> {

View File

@ -14,7 +14,7 @@ use proxmox_router::{
use proxmox_router::list_subdirs_api_method;
use pbs_api_types::{
Authid, DATASTORE_SCHEMA, RRDMode, RRDTimeFrameResolution,
Authid, DATASTORE_SCHEMA, RRDMode, RRDTimeFrame,
PRIV_DATASTORE_AUDIT, PRIV_DATASTORE_BACKUP,
};
@ -125,7 +125,7 @@ pub fn datastore_status(
let get_rrd = |what: &str| extract_rrd_data(
&rrd_dir,
what,
RRDTimeFrameResolution::Month,
RRDTimeFrame::Month,
RRDMode::Average,
);