本文整理汇总了Python中pyvcloud.vcloudair.VCA.get_status方法的典型用法代码示例。如果您正苦于以下问题:Python VCA.get_status方法的具体用法?Python VCA.get_status怎么用?Python VCA.get_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvcloud.vcloudair.VCA
的用法示例。
在下文中一共展示了VCA.get_status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyvcloud.vcloudair import VCA [as 别名]
# 或者: from pyvcloud.vcloudair.VCA import get_status [as 别名]
#.........这里部分代码省略.........
table.append(['gateway', gateway.get_name()])
sorted_table = sorted(table, key=operator.itemgetter(0), reverse=False)
return sorted_table
def vdc_resources_to_table(self, vdc):
table = []
computeCapacity = vdc.get_ComputeCapacity()
cpu = computeCapacity.get_Cpu()
memory = computeCapacity.get_Memory()
# storageCapacity = vca.vdc.get_StorageCapacity()
table.append(
['CPU (%s)' % cpu.get_Units(),
cpu.get_Allocated(), cpu.get_Limit(),
cpu.get_Reserved(), cpu.get_Used(),
cpu.get_Overhead()])
table.append(['Memory (%s)' % memory.get_Units(),
memory.get_Allocated(),
memory.get_Limit(), memory.get_Reserved(),
memory.get_Used(), memory.get_Overhead()])
sorted_table = sorted(table, key=operator.itemgetter(0), reverse=False)
return sorted_table
def vapps_to_table(self, vdc):
table = []
if vdc is not None:
for entity in vdc.get_ResourceEntities().ResourceEntity:
if entity.type_ == 'application/vnd.vmware.vcloud.vApp+xml':
the_vapp = self.vca.get_vapp(vdc, entity.name)
vms = []
if the_vapp and the_vapp.me.Children:
for vm in the_vapp.me.Children.Vm:
vms.append(vm.name)
table.append([entity.name, utils.beautified(vms),
self.vca.get_status(the_vapp.me.get_status()
),
'yes' if the_vapp.me.deployed
else 'no', the_vapp.me.Description])
sorted_table = sorted(table, key=operator.itemgetter(0),
reverse=False)
return sorted_table
def catalogs_to_table(self, catalogs):
table = []
for catalog in catalogs:
if catalog.CatalogItems and catalog.CatalogItems.CatalogItem:
for item in catalog.CatalogItems.CatalogItem:
table.append([catalog.name, item.name])
else:
table.append([catalog.name, ''])
sorted_table = sorted(table, key=operator.itemgetter(0),
reverse=False)
return sorted_table
def vdc_template_to_table(self, templates):
table = []
if templates is None:
return []
for template in templates.get_VdcTemplate():
table.append([template.get_name()])
sorted_table = sorted(table, key=operator.itemgetter(0),
reverse=False)
return sorted_table
def vapp_details_to_table(self, vapp):
table = []
vms = []