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