* [pve-devel] [PATCH manager v2] api: network: add return schema for interface listing
@ 2024-12-06 9:24 Dominik Csapak
2024-12-09 12:59 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2024-12-06 9:24 UTC (permalink / raw)
To: pve-devel
Most options come from the api call parameter list
(`json_config_properties`). The description and types for the remaining
ons are either taken from the manpages, source code or similar
documentation where available.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
changes from rfc:
* added missing fields
* fixed typos
* reordered fields to be sorted alphabetically
PVE/API2/Network.pm | 122 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 120 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm
index b9db9b27..cfccdd9e 100644
--- a/PVE/API2/Network.pm
+++ b/PVE/API2/Network.pm
@@ -38,7 +38,7 @@ my $bond_mode_enum = [
];
my $network_type_enum = ['bridge', 'bond', 'eth', 'alias', 'vlan',
- 'OVSBridge', 'OVSBond', 'OVSPort', 'OVSIntPort'];
+ 'OVSBridge', 'OVSBond', 'OVSPort', 'OVSIntPort', 'vnet'];
my $confdesc = {
type => {
@@ -223,7 +223,125 @@ __PACKAGE__->register_method({
type => "array",
items => {
type => "object",
- properties => {},
+ properties => json_config_properties({
+ iface => get_standard_option('pve-iface'),
+ active => {
+ type => 'boolean',
+ optional => 1,
+ description => "Set to true if the interface is active.",
+ },
+ 'bridge-access' => {
+ type => 'integer',
+ optional => 1,
+ description => "The bridge port access VLAN.",
+ },
+ 'bridge-learning' => {
+ type => 'boolean',
+ optional => 1,
+ description => "Bridge port learning flag.",
+ },
+ 'bridge-arp-nd-suppress' => {
+ type => 'boolean',
+ optional => 1,
+ description => "Bridge port ARP/ND suppress flag.",
+ },
+ 'bridge-unicast-flood' => {
+ type => 'boolean',
+ optional => 1,
+ description => "Bridge port unicast flood flag.",
+ },
+ 'bridge-multicast-flood' => {
+ type => 'boolean',
+ optional => 1,
+ description => "Bridge port multicast flood flag.",
+ },
+ exists => {
+ type => 'boolean',
+ optional => 1,
+ description => "Set to true if the interface physically exists.",
+ },
+ families => {
+ type => "array",
+ description => "The network families.",
+ items => {
+ type => "string",
+ description => "A network family.",
+ enum => ["inet", "inet6"],
+ },
+ optional => 1,
+ },
+ 'link-type' => {
+ type => 'string',
+ optional => 1,
+ description => "The link type.",
+ },
+ method => {
+ type => "string",
+ description => "The network configuration method for IPv4.",
+ enum => ["manual", "static", "auto"],
+ optional => 1,
+ },
+ method6 => {
+ type => "string",
+ description => "The network configuration method for IPv6.",
+ enum => ["manual", "static", "auto"],
+ optional => 1,
+ },
+ options => {
+ type => 'array',
+ optional => 1,
+ description => "A list of additional interface options for IPv4.",
+ items => {
+ type => "string",
+ description => "An interface property.",
+ },
+ },
+ options6 => {
+ type => 'array',
+ optional => 1,
+ description => "A list of additional interface options for IPv6.",
+ items => {
+ type => "string",
+ description => "An interface property.",
+ },
+ },
+ priority => {
+ type => 'integer',
+ description => "The order of the interface.",
+ optional => 1,
+ },
+ 'uplink-id' => {
+ type => 'string',
+ optional => 1,
+ description => "The uplink ID.",
+ },
+ 'vlan-protocol' => {
+ type => 'string',
+ optional => 1,
+ enum => [qw(802.1ad 802.1q)],
+ description => "The VLAN protocol.",
+ },
+ 'vxlan-id' => {
+ type => 'integer',
+ optional => 1,
+ description => "The VXLAN ID.",
+ },
+ 'vxlan-svcnodeip' => {
+ type => 'string',
+ optional => 1,
+ description => "The VXLAN SVC node IP.",
+ },
+ 'vxlan-physdev' => {
+ type => 'string',
+ optional => 1,
+ description => "The physical device for the VXLAN tunnel.",
+ },
+ 'vxlan-local-tunnelip' => {
+ type => 'string',
+ optional => 1,
+ description => "The VXLAN local tunnel IP.",
+ },
+ }),
},
links => [ { rel => 'child', href => "{iface}" } ],
},
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH manager v2] api: network: add return schema for interface listing
2024-12-06 9:24 [pve-devel] [PATCH manager v2] api: network: add return schema for interface listing Dominik Csapak
@ 2024-12-09 12:59 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-12-09 12:59 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominik Csapak
Am 06.12.24 um 10:24 schrieb Dominik Csapak:
> Most options come from the api call parameter list
> (`json_config_properties`). The description and types for the remaining
> ons are either taken from the manpages, source code or similar
> documentation where available.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> changes from rfc:
> * added missing fields
> * fixed typos
> * reordered fields to be sorted alphabetically
>
> PVE/API2/Network.pm | 122 +++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 120 insertions(+), 2 deletions(-)
>
>
applied, thanks!
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-09 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-06 9:24 [pve-devel] [PATCH manager v2] api: network: add return schema for interface listing Dominik Csapak
2024-12-09 12:59 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox