src/api2/node/network.rs: pass bridge_ports and slaves a property strings

To make it compatible with pve.
This commit is contained in:
Dietmar Maurer
2020-05-08 08:49:17 +02:00
parent bab5d18c3d
commit 3aedb73816
3 changed files with 35 additions and 12 deletions

View File

@ -600,10 +600,15 @@ pub const NETWORK_INTERFACE_NAME_SCHEMA: Schema = StringSchema::new("Network int
.max_length(libc::IFNAMSIZ-1)
.schema();
pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = ArraySchema::new(
pub const NETWORK_INTERFACE_ARRAY_SCHEMA: Schema = ArraySchema::new(
"Network interface list.", &NETWORK_INTERFACE_NAME_SCHEMA)
.schema();
pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = StringSchema::new(
"A list of network devices, comma separated.")
.format(&ApiStringFormat::PropertyString(&NETWORK_INTERFACE_ARRAY_SCHEMA))
.schema();
#[api(
properties: {
name: {
@ -663,11 +668,11 @@ pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = ArraySchema::new(
optional: true,
},
bridge_ports: {
schema: NETWORK_INTERFACE_LIST_SCHEMA,
schema: NETWORK_INTERFACE_ARRAY_SCHEMA,
optional: true,
},
slaves: {
schema: NETWORK_INTERFACE_LIST_SCHEMA,
schema: NETWORK_INTERFACE_ARRAY_SCHEMA,
optional: true,
},
bond_mode: {