def VM_getInfo_Call(api, args): """ The VM object has no getInfo method. We use the method from 'Global' and pass arguments to get verbose information for only this one VM. """ vmId = api._UUID return API.Global().getVMList(True, [vmId], False)
def Host_getVMList_Call(api, args): """ This call is only interested in returning the VM UUIDs so pass False for the first argument in order to suppress verbose results. """ vmList = args.get('vmList', []) onlyUUID = args.get('onlyUUID', True) return API.Global().getVMList(False, vmList, onlyUUID)
def testAllVmStats(self): with fake.VM(_VM_PARAMS) as testvm: with MonkeyPatchScope([(clientIF, 'getInstance', lambda _: testvm.cif)]): api = API.Global() # here is where clientIF will be used. response = api.getAllVmStats() self.assertEqual(response['status']['code'], 0) for stat in response['statsList']: self.assertVmStatsSchemaCompliancy('RunningVmStats', stat)
def Host_getVMFullList_Call(api, args): """ This call is interested in returning full status. """ vmList = args.get('vmList', []) return API.Global().getVMList(True, vmList, False)