src/api2/types.rs: define CHUNK_DIGEST_SCHEMA
This commit is contained in:
parent
b595cb9d2c
commit
6762db70d6
@ -16,6 +16,7 @@ use crate::api_schema::router::*;
|
||||
use crate::api_schema::*;
|
||||
use crate::server::WorkerTask;
|
||||
use crate::backup::*;
|
||||
use crate::api2::types::*;
|
||||
|
||||
mod environment;
|
||||
use environment::*;
|
||||
@ -291,8 +292,7 @@ pub fn api_method_dynamic_append() -> ApiMethod {
|
||||
.maximum(256)
|
||||
)
|
||||
.required("digest-list", ArraySchema::new(
|
||||
"Chunk digest list.",
|
||||
StringSchema::new("Chunk digest.").into())
|
||||
"Chunk digest list.", CHUNK_DIGEST_SCHEMA.clone())
|
||||
)
|
||||
.required("offset-list", ArraySchema::new(
|
||||
"Chunk offset list.",
|
||||
@ -344,8 +344,7 @@ pub fn api_method_fixed_append() -> ApiMethod {
|
||||
.maximum(256)
|
||||
)
|
||||
.required("digest-list", ArraySchema::new(
|
||||
"Chunk digest list.",
|
||||
StringSchema::new("Chunk digest.").into())
|
||||
"Chunk digest list.", CHUNK_DIGEST_SCHEMA.clone())
|
||||
)
|
||||
.required("offset-list", ArraySchema::new(
|
||||
"Chunk offset list.",
|
||||
|
@ -27,6 +27,13 @@ lazy_static!{
|
||||
StringSchema::new("Prevent changes if current configuration file has different SHA256 digest. This can be used to prevent concurrent modifications.")
|
||||
.format(PVE_CONFIG_DIGEST_FORMAT.clone()).into();
|
||||
|
||||
pub static ref CHUNK_DIGEST_FORMAT: Arc<ApiStringFormat> =
|
||||
ApiStringFormat::Pattern(&common_regex::SHA256_HEX_REGEX).into();
|
||||
|
||||
pub static ref CHUNK_DIGEST_SCHEMA: Arc<Schema> =
|
||||
StringSchema::new("Chunk digest (SHA256).")
|
||||
.format(CHUNK_DIGEST_FORMAT.clone()).into();
|
||||
|
||||
pub static ref NODE_SCHEMA: Arc<Schema> = Arc::new(
|
||||
StringSchema::new("Node name (or 'localhost')")
|
||||
.format(
|
||||
|
Loading…
Reference in New Issue
Block a user