api2/network: add bond-primary parameter

needed for 'active-backup' bond mode

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2020-09-16 14:12:29 +02:00
committed by Dietmar Maurer
parent 36700a0a87
commit 85959a99ea
5 changed files with 55 additions and 4 deletions

View File

@ -812,7 +812,11 @@ pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = StringSchema::new(
bond_mode: {
type: LinuxBondMode,
optional: true,
}
},
"bond-primary": {
schema: NETWORK_INTERFACE_NAME_SCHEMA,
optional: true,
},
}
)]
#[derive(Debug, Serialize, Deserialize)]
@ -869,6 +873,9 @@ pub struct Interface {
pub slaves: Option<Vec<String>>,
#[serde(skip_serializing_if="Option::is_none")]
pub bond_mode: Option<LinuxBondMode>,
#[serde(skip_serializing_if="Option::is_none")]
#[serde(rename = "bond-primary")]
pub bond_primary: Option<String>,
}
// Regression tests