more api type cleanups: avoid re-exports

This commit is contained in:
Dietmar Maurer
2021-09-10 12:25:32 +02:00
parent e384f16a19
commit 6227654ad8
45 changed files with 245 additions and 290 deletions

View File

@ -14,8 +14,8 @@ use pbs_datastore::DataBlob;
use pbs_datastore::backup_info::{BackupDir, BackupInfo};
use pbs_datastore::dynamic_index::DynamicIndexWriter;
use pbs_datastore::fixed_index::FixedIndexWriter;
use pbs_api_types::Authid;
use crate::api2::types::Authid;
use crate::backup::{verify_backup_dir_with_lock, DataStore};
use crate::server::WorkerTask;
use crate::server::formatter::*;

View File

@ -15,7 +15,7 @@ use proxmox::api::schema::*;
use pbs_api_types::{
Authid, VerifyState, SnapshotVerifyState,
BACKUP_ID_SCHEMA, BACKUP_TIME_SCHEMA, BACKUP_TYPE_SCHEMA, DATASTORE_SCHEMA,
CHUNK_DIGEST_SCHEMA, PRIV_DATASTORE_BACKUP,
CHUNK_DIGEST_SCHEMA, PRIV_DATASTORE_BACKUP, BACKUP_ARCHIVE_NAME_SCHEMA,
};
use pbs_tools::fs::lock_dir_noblock_shared;
use pbs_tools::json::{required_array_param, required_integer_param, required_string_param};
@ -340,7 +340,7 @@ pub const API_METHOD_CREATE_DYNAMIC_INDEX: ApiMethod = ApiMethod::new(
&ObjectSchema::new(
"Create dynamic chunk index file.",
&sorted!([
("archive-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA),
("archive-name", false, &BACKUP_ARCHIVE_NAME_SCHEMA),
]),
)
);
@ -377,7 +377,7 @@ pub const API_METHOD_CREATE_FIXED_INDEX: ApiMethod = ApiMethod::new(
&ObjectSchema::new(
"Create fixed chunk index file.",
&sorted!([
("archive-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA),
("archive-name", false, &BACKUP_ARCHIVE_NAME_SCHEMA),
("size", false, &IntegerSchema::new("File size.")
.minimum(1)
.schema()
@ -735,7 +735,7 @@ pub const API_METHOD_DOWNLOAD_PREVIOUS: ApiMethod = ApiMethod::new(
&ObjectSchema::new(
"Download archive from previous backup.",
&sorted!([
("archive-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA)
("archive-name", false, &BACKUP_ARCHIVE_NAME_SCHEMA)
]),
)
);

View File

@ -15,8 +15,8 @@ use proxmox::api::schema::*;
use pbs_datastore::DataBlob;
use pbs_datastore::file_formats::{DataBlobHeader, EncryptedDataBlobHeader};
use pbs_tools::json::{required_integer_param, required_string_param};
use pbs_api_types::{CHUNK_DIGEST_SCHEMA, BACKUP_ARCHIVE_NAME_SCHEMA};
use crate::api2::types::*;
use crate::backup::DataStore;
use super::environment::*;
@ -247,7 +247,7 @@ pub const API_METHOD_UPLOAD_BLOB: ApiMethod = ApiMethod::new(
&ObjectSchema::new(
"Upload binary blob file.",
&sorted!([
("file-name", false, &crate::api2::types::BACKUP_ARCHIVE_NAME_SCHEMA),
("file-name", false, &BACKUP_ARCHIVE_NAME_SCHEMA),
("encoded-size", false, &IntegerSchema::new("Encoded blob size.")
.minimum(std::mem::size_of::<DataBlobHeader>() as isize)
.maximum(1024*1024*16+(std::mem::size_of::<EncryptedDataBlobHeader>() as isize))