2020"""
2121
2222import marvin
23- from utils import is_server_ssh_ready , random_gen
2423from marvin .cloudstackAPI import *
2524from marvin .codes import (FAILED , FAIL , PASS , RUNNING , STOPPED ,
2625 STARTING , DESTROYED , EXPUNGING ,
@@ -608,12 +607,6 @@ def delete(self, apiclient):
608607 cmd .id = self .id
609608 apiclient .destroyVirtualMachine (cmd )
610609
611- def expung (self , apiclient ):
612- """Expung an Instance"""
613- cmd = expungeVirtualMachine .expungeVirtualMachineCmd ()
614- cmd .id = self .id
615- apiclient .expungeVirtualMachine (cmd )
616-
617610 def migrate (self , apiclient , hostid = None ):
618611 """migrate an Instance"""
619612 cmd = migrateVirtualMachine .migrateVirtualMachineCmd ()
@@ -1490,18 +1483,6 @@ def create(cls, apiclient, services, ipaddressid=None,
14901483 cmd .vpcid = vpcid
14911484 return StaticNATRule (apiclient .createFirewallRule (cmd ).__dict__ )
14921485
1493- @classmethod
1494- def createIpForwardingRule (cls , apiclient , startport , endport , protocol , ipaddressid , openfirewall ):
1495- """Creates static ip forwarding rule"""
1496-
1497- cmd = createIpForwardingRule .createIpForwardingRuleCmd ()
1498- cmd .startport = startport
1499- cmd .endport = endport
1500- cmd .protocol = protocol
1501- cmd .openfirewall = openfirewall
1502- cmd .ipaddressid = ipaddressid
1503- return StaticNATRule (apiclient .createIpForwardingRule (cmd ).__dict__ )
1504-
15051486 def delete (self , apiclient ):
15061487 """Delete IP forwarding rule"""
15071488 cmd = deleteIpForwardingRule .deleteIpForwardingRuleCmd ()
@@ -1633,162 +1614,6 @@ def list(cls, apiclient, **kwargs):
16331614 cmd .listall = True
16341615 return (apiclient .listFirewallRules (cmd ))
16351616
1636- class Autoscale :
1637-
1638- """Manage Auto scale"""
1639-
1640- def __init__ (self , items ):
1641- self .__dict__ .update (items )
1642-
1643- @classmethod
1644- def listCounters (cls , apiclient , ** kwargs ):
1645- """Lists all available Counters."""
1646-
1647- cmd = listCounters .listCountersCmd ()
1648- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1649- return (apiclient .listCounters (cmd ))
1650-
1651- @classmethod
1652- def createCondition (cls , apiclient , counterid , relationaloperator , threshold ):
1653- """creates condition."""
1654-
1655- cmd = createCondition .createConditionCmd ()
1656- cmd .counterid = counterid
1657- cmd .relationaloperator = relationaloperator
1658- cmd .threshold = threshold
1659- return (apiclient .createCondition (cmd ))
1660-
1661- @classmethod
1662- def listConditions (cls , apiclient , ** kwargs ):
1663- """Lists all available Conditions."""
1664-
1665- cmd = listConditions .listConditionsCmd ()
1666- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1667- return (apiclient .listConditions (cmd ))
1668-
1669- @classmethod
1670- def listAutoscalePolicies (cls , apiclient , ** kwargs ):
1671- """Lists all available Autoscale Policies."""
1672-
1673- cmd = listAutoScalePolicies .listAutoScalePoliciesCmd ()
1674- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1675- return (apiclient .listAutoScalePolicies (cmd ))
1676-
1677- @classmethod
1678- def createAutoscalePolicy (cls , apiclient , action , conditionids , duration , quiettime = None ):
1679- """creates condition."""
1680-
1681- cmd = createAutoScalePolicy .createAutoScalePolicyCmd ()
1682- cmd .action = action
1683- cmd .conditionids = conditionids
1684- cmd .duration = duration
1685- if quiettime :
1686- cmd .quiettime = quiettime
1687-
1688- return (apiclient .createAutoScalePolicy (cmd ))
1689-
1690- @classmethod
1691- def updateAutoscalePolicy (cls , apiclient , id , ** kwargs ):
1692- """Updates Autoscale Policy."""
1693-
1694- cmd = updateAutoScalePolicy .updateAutoScalePolicyCmd ()
1695- cmd .id = id
1696- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1697- return (apiclient .updateAutoScalePolicy (cmd ))
1698-
1699- @classmethod
1700- def listAutoscaleVmPofiles (cls , apiclient , ** kwargs ):
1701- """Lists all available AutoscaleVM Profiles."""
1702-
1703- cmd = listAutoScaleVmProfiles .listAutoScaleVmProfilesCmd ()
1704- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1705- return (apiclient .listAutoScaleVmProfiles (cmd ))
1706-
1707- @classmethod
1708- def createAutoscaleVmProfile (cls , apiclient , serviceofferingid , zoneid , templateid ,
1709- autoscaleuserid = None , destroyvmgraceperiod = None , counterparam = None ):
1710- """creates Autoscale VM Profile."""
1711-
1712- cmd = createAutoScaleVmProfile .createAutoScaleVmProfileCmd ()
1713- cmd .serviceofferingid = serviceofferingid
1714- cmd .zoneid = zoneid
1715- cmd .templateid = templateid
1716- if autoscaleuserid :
1717- cmd .autoscaleuserid = autoscaleuserid
1718-
1719- if destroyvmgraceperiod :
1720- cmd .destroyvmgraceperiod = destroyvmgraceperiod
1721-
1722- if counterparam :
1723- for name , value in counterparam .items ():
1724- cmd .counterparam .append ({
1725- 'name' : name ,
1726- 'value' : value
1727- })
1728-
1729- return (apiclient .createAutoScaleVmProfile (cmd ))
1730-
1731- @classmethod
1732- def updateAutoscaleVMProfile (cls , apiclient , id , ** kwargs ):
1733- """Updates Autoscale Policy."""
1734-
1735- cmd = updateAutoScaleVmProfile .updateAutoScaleVmProfileCmd ()
1736- cmd .id = id
1737- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1738- return (apiclient .updateAutoScaleVmProfile (cmd ))
1739-
1740- @classmethod
1741- def createAutoscaleVmGroup (cls , apiclient , lbruleid , minmembers , maxmembers ,
1742- scaledownpolicyids , scaleuppolicyids , vmprofileid , interval = None ):
1743- """creates Autoscale VM Group."""
1744-
1745- cmd = createAutoScaleVmGroup .createAutoScaleVmGroupCmd ()
1746- cmd .lbruleid = lbruleid
1747- cmd .minmembers = minmembers
1748- cmd .maxmembers = maxmembers
1749- cmd .scaledownpolicyids = scaledownpolicyids
1750- cmd .scaleuppolicyids = scaleuppolicyids
1751- cmd .vmprofileid = vmprofileid
1752- if interval :
1753- cmd .interval = interval
1754-
1755- return (apiclient .createAutoScaleVmGroup (cmd ))
1756-
1757- @classmethod
1758- def listAutoscaleVmGroup (cls , apiclient , ** kwargs ):
1759- """Lists all available AutoscaleVM Group."""
1760-
1761- cmd = listAutoScaleVmGroups .listAutoScaleVmGroupsCmd ()
1762- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1763- return (apiclient .listAutoScaleVmGroups (cmd ))
1764-
1765- @classmethod
1766- def enableAutoscaleVmGroup (cls , apiclient , id , ** kwargs ):
1767- """Enables AutoscaleVM Group."""
1768-
1769- cmd = enableAutoScaleVmGroup .enableAutoScaleVmGroupCmd ()
1770- cmd .id = id
1771- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1772- return (apiclient .enableAutoScaleVmGroup (cmd ))
1773-
1774- @classmethod
1775- def disableAutoscaleVmGroup (cls , apiclient , id , ** kwargs ):
1776- """Disables AutoscaleVM Group."""
1777-
1778- cmd = disableAutoScaleVmGroup .disableAutoScaleVmGroupCmd ()
1779- cmd .id = id
1780- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1781- return (apiclient .disableAutoScaleVmGroup (cmd ))
1782-
1783- @classmethod
1784- def updateAutoscaleVMGroup (cls , apiclient , id , ** kwargs ):
1785- """Updates Autoscale VM Group."""
1786-
1787- cmd = updateAutoScaleVmGroup .updateAutoScaleVmGroupCmd ()
1788- cmd .id = id
1789- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
1790- return (apiclient .updateAutoScaleVmGroup (cmd ))
1791-
17921617
17931618class ServiceOffering :
17941619
@@ -2157,18 +1982,6 @@ def list(cls, apiclient, **kwargs):
21571982 cmd .listall = True
21581983 return (apiclient .listLoadBalancerRules (cmd ))
21591984
2160- @classmethod
2161- def listLoadBalancerRuleInstances (cls , apiclient , id , applied = None , ** kwargs ):
2162- """Lists load balancing rule Instances"""
2163-
2164- cmd = listLoadBalancerRuleInstances .listLoadBalancerRuleInstancesCmd ()
2165- cmd .id = id
2166- if applied :
2167- cmd .applied = applied
2168-
2169- [setattr (cmd , k , v ) for k , v in kwargs .items ()]
2170- return apiclient .listLoadBalancerRuleInstances (cmd )
2171-
21721985
21731986class Cluster :
21741987 """Manage Cluster life cycle"""
@@ -2654,7 +2467,7 @@ def __init__(self, items):
26542467
26552468 @classmethod
26562469 def create (cls , apiclient , publicipid , account = None , domainid = None ,
2657- projectid = None , networkid = None , vpcid = None , openfirewall = None ):
2470+ projectid = None , networkid = None , vpcid = None ):
26582471 """Create VPN for Public IP address"""
26592472 cmd = createRemoteAccessVpn .createRemoteAccessVpnCmd ()
26602473 cmd .publicipid = publicipid
@@ -2668,8 +2481,6 @@ def create(cls, apiclient, publicipid, account=None, domainid=None,
26682481 cmd .networkid = networkid
26692482 if vpcid :
26702483 cmd .vpcid = vpcid
2671- if openfirewall :
2672- cmd .openfirewall = openfirewall
26732484 return Vpn (apiclient .createRemoteAccessVpn (cmd ).__dict__ )
26742485
26752486 def delete (self , apiclient ):
0 commit comments