Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.
DescribeExportTasks
Úselo con un AWS SDK
En el siguiente ejemplo de código, se muestra cómo utilizar DescribeExportTasks
.
- .NET
-
- SDK para .NET
-
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);
}
}
Para obtener una lista completa de guías para desarrolladores del AWS SDK y ejemplos de código, consulteUso CloudWatch de registros con un AWS SDK. En este tema también se incluye información sobre cómo comenzar a utilizar el SDK y detalles sobre sus versiones anteriores.