update to first proxmox crate split

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2021-10-08 11:19:37 +02:00
parent e3f3359c86
commit 6ef1b649d9
265 changed files with 880 additions and 1036 deletions

View File

@ -4,16 +4,9 @@ use std::sync::{Mutex, Arc};
use anyhow::{bail, format_err, Error};
use serde_json::Value;
use proxmox::{
try_block,
api::{
api,
RpcEnvironment,
RpcEnvironmentType,
Router,
Permission,
},
};
use proxmox_lang::try_block;
use proxmox_router::{Permission, Router, RpcEnvironment, RpcEnvironmentType};
use proxmox_schema::api;
use pbs_api_types::{
Authid, Userid, TapeBackupJobConfig, TapeBackupJobSetup, TapeBackupJobStatus, MediaPoolConfig,
@ -119,7 +112,7 @@ pub fn list_tape_backup_jobs(
let mut list = Vec::new();
let status_path = Path::new(TAPE_STATUS_DIR);
let current_time = proxmox::tools::time::epoch_i64();
let current_time = proxmox_time::epoch_i64();
for job in job_list_iter {
let privs = user_info.lookup_privs(&auth_id, &["tape", "job", &job.id]);

View File

@ -4,8 +4,8 @@ use std::path::Path;
use anyhow::Error;
use serde_json::Value;
use proxmox::api::{api, Router, SubdirMap, RpcEnvironment, Permission};
use proxmox::list_subdirs_api_method;
use proxmox_schema::api;
use proxmox_router::{list_subdirs_api_method, Permission, Router, RpcEnvironment, SubdirMap};
use pbs_api_types::{
Authid, ChangerListEntry, LtoTapeDrive, MtxEntryKind, MtxStatusEntry, ScsiTapeChanger,

View File

@ -6,21 +6,13 @@ use std::collections::HashMap;
use anyhow::{bail, format_err, Error};
use serde_json::Value;
use proxmox::{
sortable,
identity,
list_subdirs_api_method,
tools::Uuid,
api::{
api,
section_config::SectionConfigData,
RpcEnvironment,
RpcEnvironmentType,
Permission,
Router,
SubdirMap,
},
use proxmox::{sortable, identity};
use proxmox_router::{
list_subdirs_api_method, Permission, Router, RpcEnvironment, RpcEnvironmentType, SubdirMap,
};
use proxmox_schema::api;
use proxmox_section_config::SectionConfigData;
use proxmox_uuid::Uuid;
use pbs_api_types::{
UPID_SCHEMA, CHANGER_NAME_SCHEMA, DRIVE_NAME_SCHEMA, MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA,
@ -521,7 +513,7 @@ pub fn label_media(
}
}
let ctime = proxmox::tools::time::epoch_i64();
let ctime = proxmox_time::epoch_i64();
let label = MediaLabel {
label_text: label_text.to_string(),
uuid: Uuid::generate(),
@ -1084,7 +1076,7 @@ fn barcode_label_media_worker(
}
}
let ctime = proxmox::tools::time::epoch_i64();
let ctime = proxmox_time::epoch_i64();
let label = MediaLabel {
label_text: label_text.to_string(),
uuid: Uuid::generate(),

View File

@ -3,11 +3,9 @@ use std::collections::HashSet;
use anyhow::{bail, format_err, Error};
use proxmox::{
api::{api, Router, SubdirMap, RpcEnvironment, Permission},
list_subdirs_api_method,
tools::Uuid,
};
use proxmox_router::{list_subdirs_api_method, Router, SubdirMap, RpcEnvironment, Permission};
use proxmox_schema::api;
use proxmox_uuid::Uuid;
use pbs_datastore::backup_info::BackupDir;
use pbs_api_types::{
@ -177,7 +175,7 @@ pub async fn list_media(
let changer_name = None; // assume standalone drive
let mut pool = MediaPool::with_config(status_path, &config, changer_name, true)?;
let current_time = proxmox::tools::time::epoch_i64();
let current_time = proxmox_time::epoch_i64();
// Call start_write_session, so that we show the same status a
// backup job would see.

View File

@ -3,14 +3,8 @@
use anyhow::Error;
use serde_json::Value;
use proxmox::{
api::{
api,
router::SubdirMap,
Router,
},
list_subdirs_api_method,
};
use proxmox_schema::api;
use proxmox_router::{list_subdirs_api_method, Router, SubdirMap};
use pbs_api_types::TapeDeviceInfo;
use pbs_tape::linux_list_drives::{lto_tape_device_list, linux_tape_changer_list};

View File

@ -8,25 +8,12 @@ use std::sync::Arc;
use anyhow::{bail, format_err, Error};
use serde_json::Value;
use proxmox::{
api::{
api,
RpcEnvironment,
RpcEnvironmentType,
Router,
Permission,
schema::parse_property_string,
section_config::SectionConfigData,
},
tools::{
Uuid,
io::ReadExt,
fs::{
replace_file,
CreateOptions,
},
},
};
use proxmox::tools::fs::{replace_file, CreateOptions};
use proxmox_io::ReadExt;
use proxmox_router::{Permission, Router, RpcEnvironment, RpcEnvironmentType};
use proxmox_schema::{api, parse_property_string};
use proxmox_section_config::SectionConfigData;
use proxmox_uuid::Uuid;
use pbs_api_types::{
Authid, Userid, CryptMode,
@ -441,7 +428,7 @@ fn restore_list_worker(
let mut snapshot_file_hash: BTreeMap<Uuid, Vec<u64>> = BTreeMap::new();
let mut snapshot_locks = HashMap::new();
let res = proxmox::try_block!({
let res = proxmox_lang::try_block!({
// assemble snapshot files/locks
for store_snapshot in snapshots.iter() {
let mut split = store_snapshot.splitn(2, ':');
@ -593,7 +580,7 @@ fn restore_list_worker(
"Phase 3: copy snapshots from temp dir to datastores"
);
for (store_snapshot, _lock) in snapshot_locks.into_iter() {
proxmox::try_block!({
proxmox_lang::try_block!({
let mut split = store_snapshot.splitn(2, ':');
let source_datastore = split
.next()