cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tall...@apache.org
Subject [1/3] 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
Date Thu, 24 Apr 2014 07:04:41 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master f57f22a79 -> 2e95b5b70


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e95b5b7/tools/marvin/marvin/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py
index b7cc2cc..1ac5737 100755
--- a/tools/marvin/marvin/lib/base.py
+++ b/tools/marvin/marvin/lib/base.py
@@ -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()


Mime
View raw message