]>
git.proxmox.com Git - proxmox-backup.git/blob - src/storage/config.rs
2f04fd4226804ec415307ade3c9eb883d932749f
3 use crate::api_schema
::*;
4 use crate::section_config
::*;
6 use lazy_static
::lazy_static
;
9 static ref STORAGE_SECTION_CONFIG
: SectionConfig
= register_storage_plugins();
12 fn register_storage_plugins() -> SectionConfig
{
14 let plugin
= SectionConfigPlugin
::new(
15 "lvmthin".to_string(),
16 ObjectSchema
::new("lvmthin properties")
17 .required("thinpool", StringSchema
::new("LVM thin pool name."))
18 .required("vgname", StringSchema
::new("LVM volume group name."))
19 .optional("content", StringSchema
::new("Storage content types."))
22 let id_schema
= StringSchema
::new("Storage ID schema.")
26 let mut config
= SectionConfig
::new(id_schema
);
27 config
.register_plugin(plugin
);
32 pub fn parse_config(filename
: &str, raw
: &str) -> Result
<SectionConfigData
, Error
> {
34 STORAGE_SECTION_CONFIG
.parse(filename
, raw
)
37 pub fn write_config(filename
: &str, config
: &SectionConfigData
) -> Result
<String
, Error
> {
39 STORAGE_SECTION_CONFIG
.write(filename
, config
)