AWS 文档 SDK 示例
将 DescribeExportTasks 和 AWS SDK 结合使用
以下代码示例演示了如何使用 DescribeExportTasks。
- .NET
-
- 适用于 .NET 的 SDK
-
注意
查看 GitHub,了解更多信息。查找完整示例,了解如何在 AWS 代码示例存储库
中进行设置和运行。 using System; using System.Threading.Tasks; using Amazon.CloudWatchLogs; using Amazon.CloudWatchLogs.Model; /// <summary> /// Shows how to retrieve a list of information about Amazon CloudWatch /// Logs export tasks. /// </summary> public class DescribeExportTasks { public static async Task Main() { // This client object will be associated with the same AWS Region // as the default user on this system. If you need to use a // different AWS Region, pass it as a parameter to the client // constructor. var client = new AmazonCloudWatchLogsClient(); var request = new DescribeExportTasksRequest { Limit = 5, }; var response = new DescribeExportTasksResponse(); do { response = await client.DescribeExportTasksAsync(request); response.ExportTasks.ForEach(t => { Console.WriteLine($"{t.TaskName} with ID: {t.TaskId} has status: {t.Status}"); }); } while (response.NextToken is not null); } }-
有关 API 详细信息,请参阅《适用于 .NET 的 AWS SDK API Reference》中的 DescribeExportTasks。
-
DeleteSubscriptionFilter
DescribeLogGroups