Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzare CancelExportTask
con un SDK AWS
Il seguente esempio di codice mostra come utilizzareCancelExportTask
.
- .NET
-
- SDK per .NET
-
using System;
using System.Threading.Tasks;
using Amazon.CloudWatchLogs;
using Amazon.CloudWatchLogs.Model;
/// <summary>
/// Shows how to cancel an Amazon CloudWatch Logs export task.
/// </summary>
public class CancelExportTask
{
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();
string taskId = "exampleTaskId";
var request = new CancelExportTaskRequest
{
TaskId = taskId,
};
var response = await client.CancelExportTaskAsync(request);
if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
{
Console.WriteLine($"{taskId} successfully canceled.");
}
else
{
Console.WriteLine($"{taskId} could not be canceled.");
}
}
}
Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, consultaUtilizzo dei CloudWatch log con un SDK AWS. Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell'SDK.