Skip to content

Commit d30bf51

Browse files
committed
add template_id to required params for backward compatability
1 parent ee4d301 commit d30bf51

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

cloudstack/VirtualMachineService.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type VirtualMachineServiceIface interface {
3737
CleanVMReservations(p *CleanVMReservationsParams) (*CleanVMReservationsResponse, error)
3838
NewCleanVMReservationsParams() *CleanVMReservationsParams
3939
DeployVirtualMachine(p *DeployVirtualMachineParams) (*DeployVirtualMachineResponse, error)
40-
NewDeployVirtualMachineParams(serviceofferingid string, zoneid string) *DeployVirtualMachineParams
40+
NewDeployVirtualMachineParams(serviceofferingid string, templateid string, zoneid string) *DeployVirtualMachineParams
4141
DestroyVirtualMachine(p *DestroyVirtualMachineParams) (*DestroyVirtualMachineResponse, error)
4242
NewDestroyVirtualMachineParams(id string) *DestroyVirtualMachineParams
4343
ExpungeVirtualMachine(p *ExpungeVirtualMachineParams) (*ExpungeVirtualMachineResponse, error)
@@ -2784,10 +2784,11 @@ func (p *DeployVirtualMachineParams) GetZoneid() (string, bool) {
27842784

27852785
// You should always use this function to get a new DeployVirtualMachineParams instance,
27862786
// as then you are sure you have configured all required params
2787-
func (s *VirtualMachineService) NewDeployVirtualMachineParams(serviceofferingid string, zoneid string) *DeployVirtualMachineParams {
2787+
func (s *VirtualMachineService) NewDeployVirtualMachineParams(serviceofferingid string, templateid string, zoneid string) *DeployVirtualMachineParams {
27882788
p := &DeployVirtualMachineParams{}
27892789
p.p = make(map[string]interface{})
27902790
p.p["serviceofferingid"] = serviceofferingid
2791+
p.p["templateid"] = templateid
27912792
p.p["zoneid"] = zoneid
27922793
return p
27932794
}

cloudstack/VirtualMachineService_mock.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate/requiredParams.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ var requiredParams = map[string][]string{
5555
"createVPCOffering": {
5656
"displaytext",
5757
},
58+
"deployVirtualMachine": {
59+
"templateid",
60+
},
5861
"disassociateIpAddress": {
5962
"id",
6063
},

test/VirtualMachineService_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestVirtualMachineService(t *testing.T) {
9696
if _, ok := response["deployVirtualMachine"]; !ok {
9797
t.Skipf("Skipping as no json response is provided in testdata")
9898
}
99-
p := client.VirtualMachine.NewDeployVirtualMachineParams("serviceofferingid", "zoneid")
99+
p := client.VirtualMachine.NewDeployVirtualMachineParams("serviceofferingid", "templateid", "zoneid")
100100
r, err := client.VirtualMachine.DeployVirtualMachine(p)
101101
if err != nil {
102102
t.Errorf(err.Error())

0 commit comments

Comments
 (0)