This is an automated email from the ASF dual-hosted git repository.

weizhou pushed a commit to branch fix-datadisksdetails
in repository https://gitbox.apache.org/repos/asf/cloudstack-go.git

commit 0d1a4d5d553d2d6daeffc3eaf41b7c9591b9ef03
Author: Wei Zhou <[email protected]>
AuthorDate: Sat Mar 14 21:06:11 2026 +0100

    Fix datadisksdetails
---
 cloudstack/BackupService.go                  | 3 +--
 cloudstack/VirtualMachineService.go          | 3 +--
 cloudstack/VirtualNetworkFunctionsService.go | 3 +--
 generate/generate.go                         | 2 ++
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/cloudstack/BackupService.go b/cloudstack/BackupService.go
index 92033d8..f2c9266 100644
--- a/cloudstack/BackupService.go
+++ b/cloudstack/BackupService.go
@@ -749,8 +749,7 @@ func (p *CreateVMFromBackupParams) toURLValues() url.Values 
{
        if v, found := p.p["datadisksdetails"]; found {
                m := v.(map[string]string)
                for i, k := range getSortedKeysFromMap(m) {
-                       u.Set(fmt.Sprintf("datadisksdetails[%d].key", i), k)
-                       u.Set(fmt.Sprintf("datadisksdetails[%d].value", i), 
m[k])
+                       u.Set(fmt.Sprintf("datadisksdetails[%d].%s", i, k), 
m[k])
                }
        }
        if v, found := p.p["deploymentplanner"]; found {
diff --git a/cloudstack/VirtualMachineService.go 
b/cloudstack/VirtualMachineService.go
index 675b5c8..11cbdab 100644
--- a/cloudstack/VirtualMachineService.go
+++ b/cloudstack/VirtualMachineService.go
@@ -1337,8 +1337,7 @@ func (p *DeployVirtualMachineParams) toURLValues() 
url.Values {
        if v, found := p.p["datadisksdetails"]; found {
                m := v.(map[string]string)
                for i, k := range getSortedKeysFromMap(m) {
-                       u.Set(fmt.Sprintf("datadisksdetails[%d].key", i), k)
-                       u.Set(fmt.Sprintf("datadisksdetails[%d].value", i), 
m[k])
+                       u.Set(fmt.Sprintf("datadisksdetails[%d].%s", i, k), 
m[k])
                }
        }
        if v, found := p.p["deploymentplanner"]; found {
diff --git a/cloudstack/VirtualNetworkFunctionsService.go 
b/cloudstack/VirtualNetworkFunctionsService.go
index 90f7dee..f202cec 100644
--- a/cloudstack/VirtualNetworkFunctionsService.go
+++ b/cloudstack/VirtualNetworkFunctionsService.go
@@ -251,8 +251,7 @@ func (p *DeployVnfApplianceParams) toURLValues() url.Values 
{
        if v, found := p.p["datadisksdetails"]; found {
                m := v.(map[string]string)
                for i, k := range getSortedKeysFromMap(m) {
-                       u.Set(fmt.Sprintf("datadisksdetails[%d].key", i), k)
-                       u.Set(fmt.Sprintf("datadisksdetails[%d].value", i), 
m[k])
+                       u.Set(fmt.Sprintf("datadisksdetails[%d].%s", i, k), 
m[k])
                }
        }
        if v, found := p.p["deploymentplanner"]; found {
diff --git a/generate/generate.go b/generate/generate.go
index 448b614..11428f5 100644
--- a/generate/generate.go
+++ b/generate/generate.go
@@ -1405,6 +1405,8 @@ func (s *service) generateConvertCode(cmd, name, typ 
string) {
                        }
                case "userdatadetails":
                        pn("    u.Set(fmt.Sprintf(\"%s[%%d].%%s\", i, k), 
m[k])", name)
+               case "datadisksdetails": 
+                       pn("    u.Set(fmt.Sprintf(\"%s[%%d].%%s\", i, k), 
m[k])", name)
                case "serviceproviderlist":
                        pn("    u.Set(fmt.Sprintf(\"%s[%%d].service\", i), k)", 
name)
                        pn("    u.Set(fmt.Sprintf(\"%s[%%d].provider\", i), 
m[k])", name)

Reply via email to