/* * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.logs.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Creates an export task, which allows you to efficiently export data from a * log group to an Amazon S3 bucket. *
*
* This is an asynchronous call. If all the required information is provided,
* this operation initiates an export task and responds with the ID of the task.
* After the task has started, you can use DescribeExportTasks to get the
* status of the export task. Each account can only have one active (
* RUNNING
or PENDING
) export task at a time. To
* cancel an export task, use CancelExportTask.
*
* You can export logs from multiple log groups or multiple time ranges to the * same S3 bucket. To separate out log data for each export task, you can * specify a prefix to be used as the Amazon S3 key prefix for all exported * objects. *
*/ public class CreateExportTaskRequest extends AmazonWebServiceRequest implements Serializable { /** ** The name of the export task. *
*
* Constraints:
* Length: 1 - 512
*/
private String taskName;
/**
*
* The name of the log group. *
*
* Constraints:
* Length: 1 - 512
* Pattern: [\.\-_/#A-Za-z0-9]+
*/
private String logGroupName;
/**
*
* Export only log streams that match the provided prefix. If you don't * specify a value, no prefix filter is applied. *
*
* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
*/
private String logStreamNamePrefix;
/**
*
* The start time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * earlier than this time are not exported. *
*
* Constraints:
* Range: 0 -
*/
private Long from;
/**
*
* The end time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * later than this time are not exported. *
*
* Constraints:
* Range: 0 -
*/
private Long to;
/**
*
* The name of S3 bucket for the exported log data. The bucket must be in * the same AWS region. *
*
* Constraints:
* Length: 1 - 512
*/
private String destination;
/**
*
* The prefix used as the start of the key for every object exported. If you
* don't specify a value, the default is exportedlogs
.
*
* The name of the export task. *
*
* Constraints:
* Length: 1 - 512
*
* @return
* The name of the export task. *
*/ public String getTaskName() { return taskName; } /** ** The name of the export task. *
*
* Constraints:
* Length: 1 - 512
*
* @param taskName
* The name of the export task. *
*/ public void setTaskName(String taskName) { this.taskName = taskName; } /** ** The name of the export task. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 512
*
* @param taskName
* The name of the export task. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateExportTaskRequest withTaskName(String taskName) { this.taskName = taskName; return this; } /** ** The name of the log group. *
*
* Constraints:
* Length: 1 - 512
* Pattern: [\.\-_/#A-Za-z0-9]+
*
* @return
* The name of the log group. *
*/ public String getLogGroupName() { return logGroupName; } /** ** The name of the log group. *
*
* Constraints:
* Length: 1 - 512
* Pattern: [\.\-_/#A-Za-z0-9]+
*
* @param logGroupName
* The name of the log group. *
*/ public void setLogGroupName(String logGroupName) { this.logGroupName = logGroupName; } /** ** The name of the log group. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 512
* Pattern: [\.\-_/#A-Za-z0-9]+
*
* @param logGroupName
* The name of the log group. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateExportTaskRequest withLogGroupName(String logGroupName) { this.logGroupName = logGroupName; return this; } /** ** Export only log streams that match the provided prefix. If you don't * specify a value, no prefix filter is applied. *
*
* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
*
* @return
* Export only log streams that match the provided prefix. If you * don't specify a value, no prefix filter is applied. *
*/ public String getLogStreamNamePrefix() { return logStreamNamePrefix; } /** ** Export only log streams that match the provided prefix. If you don't * specify a value, no prefix filter is applied. *
*
* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
*
* @param logStreamNamePrefix
* Export only log streams that match the provided prefix. If you * don't specify a value, no prefix filter is applied. *
*/ public void setLogStreamNamePrefix(String logStreamNamePrefix) { this.logStreamNamePrefix = logStreamNamePrefix; } /** ** Export only log streams that match the provided prefix. If you don't * specify a value, no prefix filter is applied. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 512
* Pattern: [^:*]*
*
* @param logStreamNamePrefix
* Export only log streams that match the provided prefix. If you * don't specify a value, no prefix filter is applied. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateExportTaskRequest withLogStreamNamePrefix(String logStreamNamePrefix) { this.logStreamNamePrefix = logStreamNamePrefix; return this; } /** ** The start time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * earlier than this time are not exported. *
*
* Constraints:
* Range: 0 -
*
* @return
* The start time of the range for the request, expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events * with a time stamp earlier than this time are not exported. *
*/ public Long getFrom() { return from; } /** ** The start time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * earlier than this time are not exported. *
*
* Constraints:
* Range: 0 -
*
* @param from
* The start time of the range for the request, expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events * with a time stamp earlier than this time are not exported. *
*/ public void setFrom(Long from) { this.from = from; } /** ** The start time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * earlier than this time are not exported. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param from
* The start time of the range for the request, expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events * with a time stamp earlier than this time are not exported. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateExportTaskRequest withFrom(Long from) { this.from = from; return this; } /** ** The end time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * later than this time are not exported. *
*
* Constraints:
* Range: 0 -
*
* @return
* The end time of the range for the request, expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events * with a time stamp later than this time are not exported. *
*/ public Long getTo() { return to; } /** ** The end time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * later than this time are not exported. *
*
* Constraints:
* Range: 0 -
*
* @param to
* The end time of the range for the request, expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events * with a time stamp later than this time are not exported. *
*/ public void setTo(Long to) { this.to = to; } /** ** The end time of the range for the request, expressed as the number of * milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a time stamp * later than this time are not exported. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0 -
*
* @param to
* The end time of the range for the request, expressed as the * number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events * with a time stamp later than this time are not exported. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateExportTaskRequest withTo(Long to) { this.to = to; return this; } /** ** The name of S3 bucket for the exported log data. The bucket must be in * the same AWS region. *
*
* Constraints:
* Length: 1 - 512
*
* @return
* The name of S3 bucket for the exported log data. The bucket must * be in the same AWS region. *
*/ public String getDestination() { return destination; } /** ** The name of S3 bucket for the exported log data. The bucket must be in * the same AWS region. *
*
* Constraints:
* Length: 1 - 512
*
* @param destination
* The name of S3 bucket for the exported log data. The bucket * must be in the same AWS region. *
*/ public void setDestination(String destination) { this.destination = destination; } /** ** The name of S3 bucket for the exported log data. The bucket must be in * the same AWS region. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 512
*
* @param destination
* The name of S3 bucket for the exported log data. The bucket * must be in the same AWS region. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateExportTaskRequest withDestination(String destination) { this.destination = destination; return this; } /** *
* The prefix used as the start of the key for every object exported. If you
* don't specify a value, the default is exportedlogs
.
*
* The prefix used as the start of the key for every object
* exported. If you don't specify a value, the default is
* exportedlogs
.
*
* The prefix used as the start of the key for every object exported. If you
* don't specify a value, the default is exportedlogs
.
*
* The prefix used as the start of the key for every object
* exported. If you don't specify a value, the default is
* exportedlogs
.
*
* The prefix used as the start of the key for every object exported. If you
* don't specify a value, the default is exportedlogs
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param destinationPrefix
* The prefix used as the start of the key for every object
* exported. If you don't specify a value, the default is
* exportedlogs
.
*