本文整理汇总了Python中marvin.lib.base.StaticNATRule.disable方法的典型用法代码示例。如果您正苦于以下问题:Python StaticNATRule.disable方法的具体用法?Python StaticNATRule.disable怎么用?Python StaticNATRule.disable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marvin.lib.base.StaticNATRule
的用法示例。
在下文中一共展示了StaticNATRule.disable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete_StaticNatRule_For_VM
# 需要导入模块: from marvin.lib.base import StaticNATRule [as 别名]
# 或者: from marvin.lib.base.StaticNATRule import disable [as 别名]
def delete_StaticNatRule_For_VM(self, vm, public_ip):
self.debug("Disabling static NAT for public IP - %s" % public_ip.ipaddress.ipaddress)
StaticNATRule.disable(self.api_client,
ipaddressid=public_ip.ipaddress.id,
virtualmachineid=vm.id
)
self.debug("Static NAT disabled for public IP - %s" % public_ip.ipaddress.ipaddress)
示例2: delete_StaticNatRule_For_VM
# 需要导入模块: from marvin.lib.base import StaticNATRule [as 别名]
# 或者: from marvin.lib.base.StaticNATRule import disable [as 别名]
def delete_StaticNatRule_For_VM(self, public_ip):
self.debug("Disabling Static NAT rule on public IP - %s" %
public_ip.ipaddress.ipaddress)
StaticNATRule.disable(self.api_client,
ipaddressid=public_ip.ipaddress.id
)
self.debug("Static NAT rule disabled on public IP - %s" %
public_ip.ipaddress.ipaddress)
示例3: delete_StaticNatRule_For_VM
# 需要导入模块: from marvin.lib.base import StaticNATRule [as 别名]
# 或者: from marvin.lib.base.StaticNATRule import disable [as 别名]
def delete_StaticNatRule_For_VM(self, vm, public_ip):
self.debug("Disabling static NAT for IP: %s" %
public_ip.ipaddress.ipaddress)
try:
StaticNATRule.disable(
self.apiclient,
ipaddressid=public_ip.ipaddress.id,
virtualmachineid=vm.id,
)
self.debug("Static NAT disabled for IP: %s" %
public_ip.ipaddress.ipaddress)
except Exception as e:
self.fail("Failed to disabled static NAT on IP: %s - %s" % (
public_ip.ipaddress.ipaddress, e))
示例4: removeNetworkRules
# 需要导入模块: from marvin.lib.base import StaticNATRule [as 别名]
# 或者: from marvin.lib.base.StaticNATRule import disable [as 别名]
def removeNetworkRules(self, rule, ipaddressobj):
""" Remove specified rule on acquired public IP and
default network of virtual machine
"""
self.fw_rule.delete(self.apiclient)
if rule == STATIC_NAT_RULE:
StaticNATRule.disable(
self.apiclient,
ipaddressobj.ipaddress.id)
elif rule == LB_RULE:
self.lb_rule.delete(self.apiclient)
else:
self.nat_rule.delete(self.apiclient)
return
示例5: removeNetworkRules
# 需要导入模块: from marvin.lib.base import StaticNATRule [as 别名]
# 或者: from marvin.lib.base.StaticNATRule import disable [as 别名]
def removeNetworkRules(self, rule):
""" Remove specified rule on acquired public IP and
default network of virtual machine
"""
self.fw_rule.delete(self.apiclient)
if rule == STATIC_NAT_RULE:
StaticNATRule.disable(
self.apiclient,
self.ipaddress.ipaddress.id)
elif rule == LB_RULE:
self.lb_rule.delete(self.apiclient)
else:
self.nat_rule.delete(self.apiclient)
logger.debug("Releasing IP %s from account %s" % (self.ipaddress.ipaddress.ipaddress, self.account.name))
self.ipaddress.delete(self.apiclient)
return