all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-network 1/2] api: sdn: ipam: add optional vmid to POST endpoint
Date: Wed, 19 Aug 2026 14:44:06 +0200	[thread overview]
Message-ID: <20260819124407.856577-2-h.laimer@proxmox.com> (raw)
In-Reply-To: <20260819124407.856577-1-h.laimer@proxmox.com>

The update PUT endpoint allows an optional vmid, this alligns the POST
one. And allows creating new assignments with a vmid associated.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/PVE/API2/Network/SDN/Ips.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/PVE/API2/Network/SDN/Ips.pm b/src/PVE/API2/Network/SDN/Ips.pm
index 5ff05e7..d0902f5 100644
--- a/src/PVE/API2/Network/SDN/Ips.pm
+++ b/src/PVE/API2/Network/SDN/Ips.pm
@@ -64,6 +64,9 @@ __PACKAGE__->register_method({
         properties => {
             zone => get_standard_option('pve-sdn-zone-id'),
             vnet => get_standard_option('pve-sdn-vnet-id'),
+            vmid => get_standard_option('pve-vmid', {
+                    optional => 1,
+            }),
             mac => get_standard_option('mac-addr'),
             ip => {
                 type => 'string',
@@ -78,9 +81,10 @@ __PACKAGE__->register_method({
 
         my $vnet = extract_param($param, 'vnet');
         my $mac = extract_param($param, 'mac');
+        my $vmid = extract_param($param, 'vmid');
         my $ip = extract_param($param, 'ip');
 
-        PVE::Network::SDN::Vnets::add_ip($vnet, $ip, '', $mac, undef);
+        PVE::Network::SDN::Vnets::add_ip($vnet, $ip, '', $mac, $vmid);
 
         return undef;
     },
-- 
2.47.3





  reply	other threads:[~2026-08-19 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 12:44 [PATCH manager/network 0/2] sdn: add guest/nic selectors to IPAM create window Hannes Laimer
2026-08-19 12:44 ` Hannes Laimer [this message]
2026-08-19 12:44 ` [PATCH pve-manager 2/2] ui: sdn: ipam: allow picking the nic instead of typing its MAC Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260819124407.856577-2-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal