mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
Summary: Add in testing definitions for add/remove nic in marvin base.py
Submitted-by: Ryan Dietrich <ryan@betterservers.com> Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1359583956 -0700
This commit is contained in:
parent
e8fcdcbfe5
commit
e430b7aedd
@ -389,6 +389,27 @@ class VirtualMachine:
|
||||
cmd.id = volume.id
|
||||
return apiclient.detachVolume(cmd)
|
||||
|
||||
def add_nic(self, apiclient, networkId):
|
||||
"""Add a NIC to a VM"""
|
||||
cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd();
|
||||
cmd.virtualmachineid = self.id
|
||||
cmd.networkid = networkId
|
||||
return apiclient.addNicToVirtualMachine(cmd)
|
||||
|
||||
def remove_nic(self, apiclient, nicId):
|
||||
"""Remove a NIC to a VM"""
|
||||
cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
|
||||
cmd.nicid = nicId
|
||||
cmd.virtualmachineid = self.id
|
||||
return apiclient.removeNicFromVirtualMachine(cmd)
|
||||
|
||||
def update_default_nic(self, apiclient, nicId):
|
||||
"""Set a NIC to be the default network adapter for a VM"""
|
||||
cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
|
||||
cmd.nicid = nicId
|
||||
cmd.virtualmachineid = self.id
|
||||
return apiclient.updateDefaultNicForVirtualMachine(cmd)
|
||||
|
||||
@classmethod
|
||||
def list(cls, apiclient, **kwargs):
|
||||
"""List all VMs matching criteria"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user