本文整理汇总了Python中pyvcloud.vcloudair.VCA.delete_vapp方法的典型用法代码示例。如果您正苦于以下问题:Python VCA.delete_vapp方法的具体用法?Python VCA.delete_vapp怎么用?Python VCA.delete_vapp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcloudair.VCA
的用法示例。
在下文中一共展示了VCA.delete_vapp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyvcloud.vcloudair import VCA [as 别名]
# 或者: from pyvcloud.vcloudair.VCA import delete_vapp [as 别名]
#.........这里部分代码省略.........
assert the_vapp
vm_info = the_vapp.get_vms_network_info()
print vm_info
assert vm_info
assert len(vm_info) == 1
assert len(vm_info[0]) == 1
assert vm_info[0][0].get('network_name') == network
assert vm_info[0][0].get('allocation_mode') == 'DHCP'
def test_0018(self):
"""Disconnect VM from network"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
vm_name = config['vcloud']['vm']
network = config['vcloud']['network']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
nets = filter(lambda n: n.name == network, self.vca.get_networks(vdc_name))
assert len(nets) == 1
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
task = the_vapp.disconnect_vms(nets[0].name)
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
vm_info = the_vapp.get_vms_network_info()
assert vm_info
assert len(vm_info) == 1
assert len(vm_info[0]) == 0
def test_0030(self):
"""Validate vApp State is powered off (8)"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.me.get_status() == 8
def test_0031(self):
"""Power On vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
assert the_vapp.me.get_status() == 8
task = the_vapp.poweron()
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp != None
assert the_vapp.me.get_status() == 4
def test_0032(self):
"""Power Off vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
assert the_vapp.me.get_status() == 4
task = the_vapp.poweroff()
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp != None
assert the_vapp.me.get_status() == 8
def test_0099(self):
"""Delete vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
task = self.vca.delete_vapp(vdc_name, vapp_name)
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp == None
示例2: __init__
# 需要导入模块: from pyvcloud.vcloudair import VCA [as 别名]
# 或者: from pyvcloud.vcloudair.VCA import delete_vapp [as 别名]
#.........这里部分代码省略.........
return plist
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
vm_name = config['vcloud']['vm']
gateway_name = config['vcloud']['gateway']
is_enable = config['vcloud']['fw_is_enable']
description = config['vcloud']['fw_description']
policy = config['vcloud']['fw_policy']
dest_ip = config['vcloud']['fw_dest_port']
dest_port = config['vcloud']['fw_dest_ip']
protocol = config['vcloud']['fw_protocol']
source_ip = config['vcloud']['fw_source_ip']
source_port = config['vcloud']['fw_source_port']
enable_logging = config['vcloud']['fw_enable_logging']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_gateway = self.vca.get_gateway(vdc_name, gateway_name)
assert the_gateway
assert the_gateway.get_name() == gateway_name
the_gateway.delete_fw_rule(protocol, dest_port, dest_ip, source_port, source_ip)
task = the_gateway.save_services_configuration()
assert task
result = self.vca.block_until_completed(task)
assert result
the_gateway = self.vca.get_gateway(vdc_name, gateway_name)
assert the_gateway
assert the_gateway.get_name() == gateway_name
rules = the_gateway.get_fw_rules()
to_find_trait = (create_protocol_list(self._create_protocols_type(protocol)),
dest_port, dest_ip,
source_port, source_ip)
rule_found = False
for rule in rules:
current_trait = (create_protocol_list(rule.get_Protocols()),
rule.get_DestinationPortRange(),
rule.get_DestinationIp(),
rule.get_SourcePortRange(),
rule.get_SourceIp())
if current_trait == to_find_trait:
rule_found = True
break
assert rule_found == False
def test_0020(self):
"""Power On vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
assert the_vapp.me.get_status() == 8
task = the_vapp.poweron()
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp != None
assert the_vapp.me.get_status() == 4
def test_0022(self):
"""Power Off vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
assert the_vapp.me.get_status() == 4
task = the_vapp.poweroff()
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp != None
assert the_vapp.me.get_status() == 8
def test_0099(self):
"""Delete vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
vm_name = config['vcloud']['vm']
catalog = config['vcloud']['catalog']
template = config['vcloud']['template']
network = config['vcloud']['network']
mode = config['vcloud']['mode']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
task = self.vca.delete_vapp(vdc_name, vapp_name)
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp == None
示例3: __init__
# 需要导入模块: from pyvcloud.vcloudair import VCA [as 别名]
# 或者: from pyvcloud.vcloudair.VCA import delete_vapp [as 别名]
#.........这里部分代码省略.........
def test_0002(self):
"""Get VDC"""
vdc_name = config['vcloud']['vdc']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
def test_0003(self):
"""Create vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
vm_name = config['vcloud']['vm']
catalog = config['vcloud']['catalog']
template = config['vcloud']['template']
cpu = config['vcloud']['cpus_new']
memory = config['vcloud']['memory_new']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
task = self.vca.create_vapp(vdc_name, vapp_name, template, catalog,
vm_name=vm_name,
vm_cpus=cpu,
vm_memory=memory)
assert task
result = self.vca.block_until_completed(task)
assert result
the_vdc = self.vca.get_vdc(vdc_name)
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
def test_0004(self):
"""Validate vApp State is powered off (8)"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.me.get_status() == 8
def test_0031(self):
"""Power On vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
assert the_vapp.me.get_status() == 8
task = the_vapp.poweron()
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp != None
assert the_vapp.me.get_status() == 4
def test_0032(self):
"""Power Off vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp
assert the_vapp.name == vapp_name
assert the_vapp.me.get_status() == 4
task = the_vapp.poweroff()
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp != None
assert the_vapp.me.get_status() == 8
def test_0099(self):
"""Delete vApp"""
vdc_name = config['vcloud']['vdc']
vapp_name = config['vcloud']['vapp']
the_vdc = self.vca.get_vdc(vdc_name)
assert the_vdc
assert the_vdc.get_name() == vdc_name
task = self.vca.delete_vapp(vdc_name, vapp_name)
assert task
result = self.vca.block_until_completed(task)
assert result
the_vapp = self.vca.get_vapp(the_vdc, vapp_name)
assert the_vapp == None