[pdm-devel] [PATCH proxmox-api-types v3 1/6] sdn: add list/create zone endpoints
Shannon Sterz
s.sterz at proxmox.com
Wed Sep 3 11:36:59 CEST 2025
On Tue Sep 2, 2025 at 4:09 PM CEST, Stefan Hanreich wrote:
> Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
> ---
> pve-api-types/generate.pl | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl
> index 910782f..6f55fb9 100644
> --- a/pve-api-types/generate.pl
> +++ b/pve-api-types/generate.pl
> @@ -79,6 +79,8 @@ Schema2Rust::register_format('bridge-pair' => { code => 'verifiers::verify_bridg
>
> Schema2Rust::register_format('pve-task-status-type' => { regex => '^(?i:ok|error|warning|unknown)$' });
>
> +Schema2Rust::register_format('pve-sdn-zone-id' => { regex => '^[a-z][a-z0-9]*[a-z0-9]$' });
nit: can't this just be `^[a-z][a-z0-9]+$`?
> +
> Schema2Rust::register_enum_variant('PveVmCpuConfReportedModel::486' => 'I486');
> Schema2Rust::register_enum_variant('QemuConfigEfidisk0Efitype::2m' => 'Mb2');
> Schema2Rust::register_enum_variant('QemuConfigEfidisk0Efitype::4m' => 'Mb4');
> @@ -104,6 +106,10 @@ Schema2Rust::register_format('pve-iface' => { regex => '^[a-zA-Z][a-zA-Z0-9_]{1,
>
> Schema2Rust::register_format('pve-vlan-id-or-range' => { code => 'verifiers::verify_vlan_id_or_range' });
>
> +Schema2Rust::register_format('pve-sdn-bgp-rt' => { regex => '^(\d+):(\d+)$' });
> +Schema2Rust::register_format('pve-sdn-controller-id' => { regex => '^[a-z][a-z0-9_-]*[a-z0-9]$' });
> +Schema2Rust::register_format('pve-sdn-isis-net' => { regex => '^[a-fA-F0-9]{2}(\.[a-fA-F0-9]{4}){3,9}\.[a-fA-F0-9]{2}$' });
> +
> # This is used as both a task status and guest status.
> Schema2Rust::generate_enum('IsRunning', {
> type => 'string',
> @@ -324,6 +330,18 @@ Schema2Rust::derive('ListRealm' => 'Clone', 'PartialEq');
> api(POST => '/access/users/{userid}/token/{tokenid}', 'create_token', 'param-name' => 'CreateToken');
> Schema2Rust::derive('CreateToken' => 'Default');
>
> +Schema2Rust::generate_enum('SdnObjectState', {
> + type => 'string',
> + description => "The state of an SDN object.",
> + enum => ['new', 'deleted', 'changed'],
> +});
> +
> +api(GET => '/cluster/sdn/zones', 'list_zones', 'return-name' => 'SdnZone');
> +Schema2Rust::derive('SdnZone' => 'Clone', 'PartialEq');
> +Schema2Rust::derive('SdnZonePending' => 'Clone', 'PartialEq');
> +api(POST => '/cluster/sdn/zones', 'create_zone', 'param-name' => 'CreateZone');
> +Schema2Rust::derive('CreateZone' => 'Clone', 'PartialEq');
> +
> # NOW DUMP THE CODE:
> #
> # We generate one file for API types, and one for API method calls.
More information about the pdm-devel
mailing list