本文整理匯總了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