amazonka-cloudwatch-logs 0.3.2 → 0.3.3
raw patch · 4 files changed
+140/−11 lines, 4 filesdep ~amazonka-core
Dependency ranges changed: amazonka-core
Files
- amazonka-cloudwatch-logs.cabal +2/−2
- gen/Network/AWS/CloudWatchLogs/DescribeLogStreams.hs +31/−3
- gen/Network/AWS/CloudWatchLogs/PutLogEvents.hs +17/−6
- gen/Network/AWS/CloudWatchLogs/Types.hs +90/−0
amazonka-cloudwatch-logs.cabal view
@@ -1,5 +1,5 @@ name: amazonka-cloudwatch-logs-version: 0.3.2+version: 0.3.3 synopsis: Amazon CloudWatch Logs SDK. homepage: https://github.com/brendanhay/amazonka license: OtherLicense@@ -53,5 +53,5 @@ other-modules: build-depends:- amazonka-core == 0.3.2.*+ amazonka-core == 0.3.3.* , base >= 4.7 && < 5
gen/Network/AWS/CloudWatchLogs/DescribeLogStreams.hs view
@@ -28,7 +28,9 @@ -- By default, this operation returns up to 50 log streams. If there are more -- log streams to list, the response would contain a 'nextToken' value in the -- response body. You can also limit the number of log streams returned in the--- response by specifying the 'limit' parameter in the request.+-- response by specifying the 'limit' parameter in the request. This operation has+-- a limit of five transactions per second, after which transactions are+-- throttled. -- -- <http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogStreams.html> module Network.AWS.CloudWatchLogs.DescribeLogStreams@@ -38,10 +40,12 @@ -- ** Request constructor , describeLogStreams -- ** Request lenses+ , dls1Descending , dls1Limit , dls1LogGroupName , dls1LogStreamNamePrefix , dls1NextToken+ , dls1OrderBy -- * Response , DescribeLogStreamsResponse@@ -58,16 +62,20 @@ import qualified GHC.Exts data DescribeLogStreams = DescribeLogStreams- { _dls1Limit :: Maybe Nat+ { _dls1Descending :: Maybe Bool+ , _dls1Limit :: Maybe Nat , _dls1LogGroupName :: Text , _dls1LogStreamNamePrefix :: Maybe Text , _dls1NextToken :: Maybe Text- } deriving (Eq, Ord, Read, Show)+ , _dls1OrderBy :: Maybe OrderBy+ } deriving (Eq, Read, Show) -- | 'DescribeLogStreams' constructor. -- -- The fields accessible through corresponding lenses are: --+-- * 'dls1Descending' @::@ 'Maybe' 'Bool'+-- -- * 'dls1Limit' @::@ 'Maybe' 'Natural' -- -- * 'dls1LogGroupName' @::@ 'Text'@@ -76,15 +84,24 @@ -- -- * 'dls1NextToken' @::@ 'Maybe' 'Text' --+-- * 'dls1OrderBy' @::@ 'Maybe' 'OrderBy'+-- describeLogStreams :: Text -- ^ 'dls1LogGroupName' -> DescribeLogStreams describeLogStreams p1 = DescribeLogStreams { _dls1LogGroupName = p1 , _dls1LogStreamNamePrefix = Nothing+ , _dls1OrderBy = Nothing+ , _dls1Descending = Nothing , _dls1NextToken = Nothing , _dls1Limit = Nothing } +-- | If set to true, results are returned in descending order. If you don't+-- specify a value or set it to false, results are returned in ascending order.+dls1Descending :: Lens' DescribeLogStreams (Maybe Bool)+dls1Descending = lens _dls1Descending (\s a -> s { _dls1Descending = a })+ -- | The maximum number of items returned in the response. If you don't specify a -- value, the request would return up to 50 items. dls1Limit :: Lens' DescribeLogStreams (Maybe Natural)@@ -93,6 +110,8 @@ dls1LogGroupName :: Lens' DescribeLogStreams Text dls1LogGroupName = lens _dls1LogGroupName (\s a -> s { _dls1LogGroupName = a }) +-- | Will only return log streams that match the provided logStreamNamePrefix. If+-- you don't specify a value, no prefix filter is applied. dls1LogStreamNamePrefix :: Lens' DescribeLogStreams (Maybe Text) dls1LogStreamNamePrefix = lens _dls1LogStreamNamePrefix (\s a -> s { _dls1LogStreamNamePrefix = a })@@ -102,6 +121,13 @@ dls1NextToken :: Lens' DescribeLogStreams (Maybe Text) dls1NextToken = lens _dls1NextToken (\s a -> s { _dls1NextToken = a }) +-- | Specifies what to order the returned log streams by. Valid arguments are+-- 'LogStreamName' or 'LastEventTime'. If you don't specify a value, results are+-- ordered by LogStreamName. If 'LastEventTime' is chosen, the request cannot+-- also contain a logStreamNamePrefix.+dls1OrderBy :: Lens' DescribeLogStreams (Maybe OrderBy)+dls1OrderBy = lens _dls1OrderBy (\s a -> s { _dls1OrderBy = a })+ data DescribeLogStreamsResponse = DescribeLogStreamsResponse { _dlsrLogStreams :: List "logStreams" LogStream , _dlsrNextToken :: Maybe Text@@ -139,6 +165,8 @@ toJSON DescribeLogStreams{..} = object [ "logGroupName" .= _dls1LogGroupName , "logStreamNamePrefix" .= _dls1LogStreamNamePrefix+ , "orderBy" .= _dls1OrderBy+ , "descending" .= _dls1Descending , "nextToken" .= _dls1NextToken , "limit" .= _dls1Limit ]
gen/Network/AWS/CloudWatchLogs/PutLogEvents.hs view
@@ -29,12 +29,12 @@ -- does not require a 'sequenceToken'. -- -- The batch of events must satisfy the following constraints: The maximum--- batch size is 32,768 bytes, and this size is calculated as the sum of all+-- batch size is 1,048,576 bytes, and this size is calculated as the sum of all -- event messages in UTF-8, plus 26 bytes for each log event. None of the log -- events in the batch can be more than 2 hours in the future. None of the log -- events in the batch can be older than 14 days or the retention period of the -- log group. The log events in the batch must be in chronological ordered by--- their 'timestamp'. The maximum number of log events in a batch is 1,000.+-- their 'timestamp'. The maximum number of log events in a batch is 10,000. -- -- <http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html> module Network.AWS.CloudWatchLogs.PutLogEvents@@ -55,6 +55,7 @@ , putLogEventsResponse -- ** Response lenses , plerNextSequenceToken+ , plerRejectedLogEventsInfo ) where import Network.AWS.Prelude@@ -105,9 +106,10 @@ pleSequenceToken :: Lens' PutLogEvents (Maybe Text) pleSequenceToken = lens _pleSequenceToken (\s a -> s { _pleSequenceToken = a }) -newtype PutLogEventsResponse = PutLogEventsResponse- { _plerNextSequenceToken :: Maybe Text- } deriving (Eq, Ord, Read, Show, Monoid)+data PutLogEventsResponse = PutLogEventsResponse+ { _plerNextSequenceToken :: Maybe Text+ , _plerRejectedLogEventsInfo :: Maybe RejectedLogEventsInfo+ } deriving (Eq, Read, Show) -- | 'PutLogEventsResponse' constructor. --@@ -115,15 +117,23 @@ -- -- * 'plerNextSequenceToken' @::@ 'Maybe' 'Text' --+-- * 'plerRejectedLogEventsInfo' @::@ 'Maybe' 'RejectedLogEventsInfo'+-- putLogEventsResponse :: PutLogEventsResponse putLogEventsResponse = PutLogEventsResponse- { _plerNextSequenceToken = Nothing+ { _plerNextSequenceToken = Nothing+ , _plerRejectedLogEventsInfo = Nothing } plerNextSequenceToken :: Lens' PutLogEventsResponse (Maybe Text) plerNextSequenceToken = lens _plerNextSequenceToken (\s a -> s { _plerNextSequenceToken = a }) +plerRejectedLogEventsInfo :: Lens' PutLogEventsResponse (Maybe RejectedLogEventsInfo)+plerRejectedLogEventsInfo =+ lens _plerRejectedLogEventsInfo+ (\s a -> s { _plerRejectedLogEventsInfo = a })+ instance ToPath PutLogEvents where toPath = const "/" @@ -150,3 +160,4 @@ instance FromJSON PutLogEventsResponse where parseJSON = withObject "PutLogEventsResponse" $ \o -> PutLogEventsResponse <$> o .:? "nextSequenceToken"+ <*> o .:? "rejectedLogEventsInfo"
gen/Network/AWS/CloudWatchLogs/Types.hs view
@@ -52,6 +52,9 @@ , mtMetricNamespace , mtMetricValue + -- * OrderBy+ , OrderBy (..)+ -- * LogStream , LogStream , logStream@@ -74,6 +77,13 @@ , lgRetentionInDays , lgStoredBytes + -- * RejectedLogEventsInfo+ , RejectedLogEventsInfo+ , rejectedLogEventsInfo+ , rleiExpiredLogEventEndIndex+ , rleiTooNewLogEventStartIndex+ , rleiTooOldLogEventEndIndex+ -- * InputLogEvent , InputLogEvent , inputLogEvent@@ -286,6 +296,35 @@ , "metricValue" .= _mtMetricValue ] +data OrderBy+ = OBLastEventTime -- ^ LastEventTime+ | OBLogStreamName -- ^ LogStreamName+ deriving (Eq, Ord, Read, Show, Generic, Enum)++instance Hashable OrderBy++instance FromText OrderBy where+ parser = takeLowerText >>= \case+ "lasteventtime" -> pure OBLastEventTime+ "logstreamname" -> pure OBLogStreamName+ e -> fail $+ "Failure parsing OrderBy from " ++ show e++instance ToText OrderBy where+ toText = \case+ OBLastEventTime -> "LastEventTime"+ OBLogStreamName -> "LogStreamName"++instance ToByteString OrderBy+instance ToHeader OrderBy+instance ToQuery OrderBy++instance FromJSON OrderBy where+ parseJSON = parseJSONText "OrderBy"++instance ToJSON OrderBy where+ toJSON = toJSONText+ data LogStream = LogStream { _lsArn :: Maybe Text , _lsCreationTime :: Maybe Nat@@ -455,6 +494,57 @@ , "metricFilterCount" .= _lgMetricFilterCount , "arn" .= _lgArn , "storedBytes" .= _lgStoredBytes+ ]++data RejectedLogEventsInfo = RejectedLogEventsInfo+ { _rleiExpiredLogEventEndIndex :: Maybe Int+ , _rleiTooNewLogEventStartIndex :: Maybe Int+ , _rleiTooOldLogEventEndIndex :: Maybe Int+ } deriving (Eq, Ord, Read, Show)++-- | 'RejectedLogEventsInfo' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'rleiExpiredLogEventEndIndex' @::@ 'Maybe' 'Int'+--+-- * 'rleiTooNewLogEventStartIndex' @::@ 'Maybe' 'Int'+--+-- * 'rleiTooOldLogEventEndIndex' @::@ 'Maybe' 'Int'+--+rejectedLogEventsInfo :: RejectedLogEventsInfo+rejectedLogEventsInfo = RejectedLogEventsInfo+ { _rleiTooNewLogEventStartIndex = Nothing+ , _rleiTooOldLogEventEndIndex = Nothing+ , _rleiExpiredLogEventEndIndex = Nothing+ }++rleiExpiredLogEventEndIndex :: Lens' RejectedLogEventsInfo (Maybe Int)+rleiExpiredLogEventEndIndex =+ lens _rleiExpiredLogEventEndIndex+ (\s a -> s { _rleiExpiredLogEventEndIndex = a })++rleiTooNewLogEventStartIndex :: Lens' RejectedLogEventsInfo (Maybe Int)+rleiTooNewLogEventStartIndex =+ lens _rleiTooNewLogEventStartIndex+ (\s a -> s { _rleiTooNewLogEventStartIndex = a })++rleiTooOldLogEventEndIndex :: Lens' RejectedLogEventsInfo (Maybe Int)+rleiTooOldLogEventEndIndex =+ lens _rleiTooOldLogEventEndIndex+ (\s a -> s { _rleiTooOldLogEventEndIndex = a })++instance FromJSON RejectedLogEventsInfo where+ parseJSON = withObject "RejectedLogEventsInfo" $ \o -> RejectedLogEventsInfo+ <$> o .:? "expiredLogEventEndIndex"+ <*> o .:? "tooNewLogEventStartIndex"+ <*> o .:? "tooOldLogEventEndIndex"++instance ToJSON RejectedLogEventsInfo where+ toJSON RejectedLogEventsInfo{..} = object+ [ "tooNewLogEventStartIndex" .= _rleiTooNewLogEventStartIndex+ , "tooOldLogEventEndIndex" .= _rleiTooOldLogEventEndIndex+ , "expiredLogEventEndIndex" .= _rleiExpiredLogEventEndIndex ] data InputLogEvent = InputLogEvent