[pve-devel] [PATCH pve-manager 2/2] sdn: Update IPAM API endpoints

Stefan Hanreich s.hanreich at proxmox.com
Mon Nov 20 17:28:33 CET 2023


The IPAM-related API endpoints were moved, reflect those changes in
the UI as well.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 www/manager6/sdn/IpamEdit.js  |  4 +++-
 www/manager6/tree/DhcpTree.js | 15 +++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/www/manager6/sdn/IpamEdit.js b/www/manager6/sdn/IpamEdit.js
index 18e22c592..73e5d2e1a 100644
--- a/www/manager6/sdn/IpamEdit.js
+++ b/www/manager6/sdn/IpamEdit.js
@@ -52,8 +52,10 @@ Ext.define('PVE.sdn.IpamEdit', {
     isCreate: false,
     mapping: {},
 
+    url: '/cluster/sdn/vnets',
+
     submitUrl: function(url, values) {
-	return `${url}/${values.zone}/${values.vnet}/${values.mac}`;
+	return `${url}/${values.vnet}/ips`;
     },
 
     initComponent: function() {
diff --git a/www/manager6/tree/DhcpTree.js b/www/manager6/tree/DhcpTree.js
index ca279c29a..b7baba606 100644
--- a/www/manager6/tree/DhcpTree.js
+++ b/www/manager6/tree/DhcpTree.js
@@ -17,7 +17,7 @@ Ext.define('PVE.sdn.DhcpTree', {
 	    let me = this;
 
 	    Proxmox.Utils.API2Request({
-		url: `/cluster/sdn/ipam`,
+		url: `/cluster/sdn/ipams/pve/status`,
 		method: 'GET',
 		success: function(response, opts) {
 		    let root = {
@@ -105,8 +105,17 @@ Ext.define('PVE.sdn.DhcpTree', {
 		        return;
 		    }
 
+		    let params = {
+			zone: data.zone,
+			mac: data.mac,
+		    };
+
+		    let encodedParams = Ext.Object.toQueryString(params);
+
+		    let url = `/cluster/sdn/vnets/${data.vnet}/ips?${encodedParams}`;
+
 		    Proxmox.Utils.API2Request({
-			url: `/cluster/sdn/ipam/${data.zone}/${data.vnet}/${data.mac}`,
+			url,
 			method: 'DELETE',
 			waitMsgTarget: view,
 			failure: function(response, opts) {
@@ -149,7 +158,6 @@ Ext.define('PVE.sdn.DhcpTree', {
 	    Ext.create('PVE.sdn.IpamEdit', {
 		autoShow: true,
 		mapping: data,
-		url: `/cluster/sdn/ipam`,
 		extraRequestParams: {
 		    vmid: data.vmid,
 		    mac: data.mac,
@@ -217,7 +225,6 @@ Ext.define('PVE.sdn.DhcpTree', {
 			Ext.create('PVE.sdn.IpamEdit', {
 			    autoShow: true,
 			    mapping: {},
-			    url: `/cluster/sdn/ipam`,
 			    isCreate: true,
 			    extraRequestParams: {
 				vnet: data.name,
-- 
2.39.2





More information about the pve-devel mailing list