]> git.proxmox.com Git - proxmox.git/commitdiff
SectionConifg: allow access to plugin properties
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 9 Feb 2021 08:09:45 +0000 (09:09 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 9 Feb 2021 08:09:45 +0000 (09:09 +0100)
proxmox/src/api/section_config.rs

index c15d8132dd2c92c1608840436f2ffce2ad7bcb95..f2c8fe37e5c61ed0ee90b9b6e14b652da6755d80 100644 (file)
@@ -51,6 +51,18 @@ impl SectionConfigPlugin {
         }
     }
 
+    pub fn type_name(&self) -> &str {
+        &self.type_name
+    }
+
+    pub fn id_property(&self) -> Option<&str> {
+        self.id_property.as_deref()
+    }
+
+    pub fn properties(&self) -> &ObjectSchema {
+        self.properties
+    }
+
     pub fn get_id_schema(&self) -> Option<&Schema> {
         match &self.id_property {
             Some(id_prop) => {
@@ -271,6 +283,11 @@ impl SectionConfig {
         self.plugins.insert(plugin.type_name.clone(), plugin);
     }
 
+    /// Access plugin config
+    pub fn plugins(&self) -> &HashMap<String, SectionConfigPlugin> {
+        &self.plugins
+    }
+
     /// Write the configuration data to a String.
     ///
     /// This verifies the whole data using the schemas defined in the