3

您好我正在使用针对 vSphere 6.0 的 pyvmomi 来查询任务,但 TaskManager 托管对象 (ManagedObjectReference:TaskManager) 仅列出最近的任务,是否可以返回并获取特定日期或特定时间范围内的所有任务的列表过去 24 小时?我正在使用此代码来获取信息。

 si = 

    connect.SmartConnect(host='xxx.abc.yyy.com',port=xxx,user='domain\user',pwd=xxxx)
    content=si.RetrieveContent()
    task = content.taskManager
    for tasks in task.recentTask:
        tasks.info.entityName + ' ' + tasks.info.state + '    '   + str(tasks.info.completeTime) --ONLY SHOWS for the last few minutes or so.

我需要能够在过去 24 小时内通过时间范围并获得该时间范围内的任务。谢谢

4

0 回答 0