mirror of https://github.com/apache/cloudstack.git
0001-JiraId-CLOUDSTACK-6282.patch Added automated tests for Instances API calls to test_escalations.py file and added utility functions to base.py file
This commit is contained in:
parent
f57f22a79e
commit
2e95b5b707
File diff suppressed because it is too large
Load Diff
|
|
@ -463,10 +463,12 @@ class VirtualMachine:
|
|||
cmd.id = self.id
|
||||
apiclient.startVirtualMachine(cmd)
|
||||
|
||||
def stop(self, apiclient):
|
||||
def stop(self, apiclient, forced=None):
|
||||
"""Stop the instance"""
|
||||
cmd = stopVirtualMachine.stopVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
if forced:
|
||||
cmd.forced = forced
|
||||
apiclient.stopVirtualMachine(cmd)
|
||||
|
||||
def reboot(self, apiclient):
|
||||
|
|
@ -597,8 +599,15 @@ class VirtualMachine:
|
|||
def detach_iso(self, apiclient):
|
||||
"""Detach ISO to instance"""
|
||||
cmd = detachIso.detachIsoCmd()
|
||||
cmd.id = self.id
|
||||
cmd.virtualmachineid = self.id
|
||||
return apiclient.detachIso(cmd)
|
||||
|
||||
def scale_virtualmachine(self, apiclient, serviceOfferingId):
|
||||
""" Scale up of service offering for the Instance"""
|
||||
cmd = scaleVirtualMachine.scaleVirtualMachineCmd()
|
||||
cmd.id = self.id
|
||||
cmd.serviceofferingid = serviceOfferingId
|
||||
return apiclient.scaleVirtualMachine(cmd)
|
||||
|
||||
def change_service_offering(self, apiclient, serviceOfferingId):
|
||||
"""Change service offering of the instance"""
|
||||
|
|
@ -3392,6 +3401,14 @@ class SSHKeyPair:
|
|||
cmd.projectid = projectid
|
||||
return (apiclient.createSSHKeyPair(cmd))
|
||||
|
||||
@classmethod
|
||||
def register(cls, apiclient, name, publickey):
|
||||
"""Registers SSH keypair"""
|
||||
cmd = registerSSHKeyPair.registerSSHKeyPairCmd()
|
||||
cmd.name = name
|
||||
cmd.publickey = publickey
|
||||
return (apiclient.registerSSHKeyPair(cmd))
|
||||
|
||||
def delete(self, apiclient):
|
||||
"""Delete SSH key pair"""
|
||||
cmd = deleteSSHKeyPair.deleteSSHKeyPairCmd()
|
||||
|
|
|
|||
Loading…
Reference in New Issue