コード例 #1
0
        internal CreateExportTaskResponse CreateExportTask(CreateExportTaskRequest request)
        {
            var marshaller   = new CreateExportTaskRequestMarshaller();
            var unmarshaller = CreateExportTaskResponseUnmarshaller.Instance;

            return(Invoke <CreateExportTaskRequest, CreateExportTaskResponse>(request, marshaller, unmarshaller));
        }
コード例 #2
0
        // snippet-start:[CloudWatchLogs.dotnetv3.CreateExportTaskExample]
        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 taskName     = "export-task-example";
            string logGroupName = "cloudwatchlogs-example-loggroup";
            string destination  = "doc-example-bucket";
            var    fromTime     = 1437584472382;
            var    toTime       = 1437584472833;

            var request = new CreateExportTaskRequest
            {
                From         = fromTime,
                To           = toTime,
                TaskName     = taskName,
                LogGroupName = logGroupName,
                Destination  = destination,
            };

            var response = await client.CreateExportTaskAsync(request);

            if (response.HttpStatusCode == System.Net.HttpStatusCode.OK)
            {
                Console.WriteLine($"The task, {taskName} with ID: {response.TaskId} has been created successfully.");
            }
        }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateExportTask operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateExportTask operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <CreateExportTaskResponse> CreateExportTaskAsync(CreateExportTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateExportTaskRequestMarshaller();
            var unmarshaller = CreateExportTaskResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateExportTaskRequest, CreateExportTaskResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }