cloudstack-go
cloudstack-go copied to clipboard
Fix userdatadetails
Fixes https://github.com/apache/cloudstack-go/issues/104
Details
This pull request updates the way userdatadetails are serialized to URL parameters across several CloudStack API parameter structs. Instead of using fixed .key and .value fields, the code now dynamically uses the map key as the parameter name, improving flexibility and aligning with expected API conventions. The code generator is also updated to reflect this change, ensuring future code generation remains consistent.
Parameter serialization changes:
- Updated all usages of
userdatadetailsintoURLValues()methods to serialize each key-value pair asuserdatadetails[i].<key>=<value>instead ofuserdatadetails[i].key=<key>anduserdatadetails[i].value=<value>. This affects:DeployVirtualMachineParams(cloudstack/VirtualMachineService.go)UpdateVirtualMachineParams(cloudstack/VirtualMachineService.go)ResetUserDataForVirtualMachineParams(cloudstack/VirtualMachineService.go)DeployVnfApplianceParams(cloudstack/VirtualNetworkFunctionsService.go)CreateAutoScaleVmProfileParams(cloudstack/AutoScaleService.go)UpdateAutoScaleVmProfileParams(cloudstack/AutoScaleService.go)
Code generation update:
- Modified the code generator (
generate/generate.go) to emit the new serialization logic foruserdatadetails, ensuring future generated code uses the correct format.