【发布时间】:2019-08-05 03:20:49
【问题描述】:
在我的 Azure Batch 帐户中,我同时运行许多作业。如何获得所有作业的所有任务?
【问题讨论】:
标签: c# azure azure-batch
在我的 Azure Batch 帐户中,我同时运行许多作业。如何获得所有作业的所有任务?
【问题讨论】:
标签: c# azure azure-batch
使用BatchClient.JobOperations的ListJobs()和ListTasks():
using Microsoft.Azure.Batch;
using Microsoft.Azure.Batch.Auth;
/*...*/
var BatchClient = BatchClient.Open(new BatchSharedKeyCredentials(
"<your-batch-endpoint>",
"<your-batch-account-name>",
"<your-shared-key>"));
var jobs = BatchClient.JobOperations.ListJobs();
var tasks = jobs.SelectMany(job => BatchClient.JobOperations.ListTasks(job.Id));
【讨论】: