packages feed

amazonka-cloudwatch-logs 0.3.4 → 0.3.5

raw patch · 5 files changed

+358/−3 lines, 5 filesdep ~amazonka-corePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: amazonka-core

API changes (from Hackage documentation)

+ Network.AWS.CloudWatchLogs.FilterLogEvents: data FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: data FilterLogEventsResponse
+ Network.AWS.CloudWatchLogs.FilterLogEvents: filterLogEvents :: Text -> NonEmpty Text -> FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: filterLogEventsResponse :: FilterLogEventsResponse
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleEndTime :: Lens' FilterLogEvents (Maybe Natural)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleFilterPattern :: Lens' FilterLogEvents (Maybe Text)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleInterleaved :: Lens' FilterLogEvents (Maybe Bool)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleLimit :: Lens' FilterLogEvents (Maybe Natural)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleLogGroupName :: Lens' FilterLogEvents Text
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleLogStreamNames :: Lens' FilterLogEvents (NonEmpty Text)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleNextToken :: Lens' FilterLogEvents (Maybe Text)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: fleStartTime :: Lens' FilterLogEvents (Maybe Natural)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: flerEvents :: Lens' FilterLogEventsResponse [FilteredLogEvent]
+ Network.AWS.CloudWatchLogs.FilterLogEvents: flerNextToken :: Lens' FilterLogEventsResponse (Maybe Text)
+ Network.AWS.CloudWatchLogs.FilterLogEvents: flerSearchedLogStreams :: Lens' FilterLogEventsResponse [SearchedLogStream]
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance AWSRequest FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Eq FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Eq FilterLogEventsResponse
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance FromJSON FilterLogEventsResponse
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Ord FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Read FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Read FilterLogEventsResponse
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Show FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance Show FilterLogEventsResponse
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance ToHeaders FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance ToJSON FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance ToPath FilterLogEvents
+ Network.AWS.CloudWatchLogs.FilterLogEvents: instance ToQuery FilterLogEvents
+ Network.AWS.CloudWatchLogs.Types: data FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: data SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: filteredLogEvent :: FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: fleEventId :: Lens' FilteredLogEvent (Maybe Text)
+ Network.AWS.CloudWatchLogs.Types: fleIngestionTime :: Lens' FilteredLogEvent (Maybe Natural)
+ Network.AWS.CloudWatchLogs.Types: fleLogStreamName :: Lens' FilteredLogEvent (Maybe Text)
+ Network.AWS.CloudWatchLogs.Types: fleMessage :: Lens' FilteredLogEvent (Maybe Text)
+ Network.AWS.CloudWatchLogs.Types: fleTimestamp :: Lens' FilteredLogEvent (Maybe Natural)
+ Network.AWS.CloudWatchLogs.Types: instance Eq FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: instance Eq SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: instance FromJSON FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: instance FromJSON SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: instance Ord FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: instance Ord SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: instance Read FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: instance Read SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: instance Show FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: instance Show SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: instance ToJSON FilteredLogEvent
+ Network.AWS.CloudWatchLogs.Types: instance ToJSON SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: searchedLogStream :: SearchedLogStream
+ Network.AWS.CloudWatchLogs.Types: slsLogStreamName :: Lens' SearchedLogStream (Maybe Text)
+ Network.AWS.CloudWatchLogs.Types: slsSearchedCompletely :: Lens' SearchedLogStream (Maybe Bool)

Files

amazonka-cloudwatch-logs.cabal view
@@ -1,5 +1,5 @@ name:                  amazonka-cloudwatch-logs-version:               0.3.4+version:               0.3.5 synopsis:              Amazon CloudWatch Logs SDK. homepage:              https://github.com/brendanhay/amazonka license:               OtherLicense@@ -43,6 +43,7 @@         , Network.AWS.CloudWatchLogs.DescribeLogGroups         , Network.AWS.CloudWatchLogs.DescribeLogStreams         , Network.AWS.CloudWatchLogs.DescribeMetricFilters+        , Network.AWS.CloudWatchLogs.FilterLogEvents         , Network.AWS.CloudWatchLogs.GetLogEvents         , Network.AWS.CloudWatchLogs.PutLogEvents         , Network.AWS.CloudWatchLogs.PutMetricFilter@@ -53,5 +54,5 @@     other-modules:      build-depends:-          amazonka-core == 0.3.4.*+          amazonka-core == 0.3.5.*         , base          >= 4.7     && < 5
gen/Network/AWS/CloudWatchLogs.hs view
@@ -22,6 +22,7 @@     , module Network.AWS.CloudWatchLogs.DescribeLogGroups     , module Network.AWS.CloudWatchLogs.DescribeLogStreams     , module Network.AWS.CloudWatchLogs.DescribeMetricFilters+    , module Network.AWS.CloudWatchLogs.FilterLogEvents     , module Network.AWS.CloudWatchLogs.GetLogEvents     , module Network.AWS.CloudWatchLogs.PutLogEvents     , module Network.AWS.CloudWatchLogs.PutMetricFilter@@ -39,6 +40,7 @@ import Network.AWS.CloudWatchLogs.DescribeLogGroups import Network.AWS.CloudWatchLogs.DescribeLogStreams import Network.AWS.CloudWatchLogs.DescribeMetricFilters+import Network.AWS.CloudWatchLogs.FilterLogEvents import Network.AWS.CloudWatchLogs.GetLogEvents import Network.AWS.CloudWatchLogs.PutLogEvents import Network.AWS.CloudWatchLogs.PutMetricFilter
+ gen/Network/AWS/CloudWatchLogs/FilterLogEvents.hs view
@@ -0,0 +1,232 @@+{-# LANGUAGE DataKinds                   #-}+{-# LANGUAGE DeriveGeneric               #-}+{-# LANGUAGE FlexibleInstances           #-}+{-# LANGUAGE GeneralizedNewtypeDeriving  #-}+{-# LANGUAGE LambdaCase                  #-}+{-# LANGUAGE NoImplicitPrelude           #-}+{-# LANGUAGE OverloadedStrings           #-}+{-# LANGUAGE RecordWildCards             #-}+{-# LANGUAGE TypeFamilies                #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-}++-- Module      : Network.AWS.CloudWatchLogs.FilterLogEvents+-- Copyright   : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>+-- License     : This Source Code Form is subject to the terms of+--               the Mozilla Public License, v. 2.0.+--               A copy of the MPL can be found in the LICENSE file or+--               you can obtain it at http://mozilla.org/MPL/2.0/.+-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>+-- Stability   : experimental+-- Portability : non-portable (GHC extensions)+--+-- Derived from AWS service descriptions, licensed under Apache 2.0.++-- | Retrieves log events, optionally filtered by a filter pattern from the+-- specified log group. You can provide an optional time range to filter the+-- results on the event 'timestamp'. You can limit the streams searched to an+-- explicit list of 'logStreamNames'.+--+-- By default, this operation returns as much matching log events as can fit+-- in a response size of 1MB, up to 10,000 log events, or all the events found+-- within a time-bounded scan window. If the response includes a 'nextToken', then+-- there is more data to search, and the search can be resumed with a new+-- request providing the nextToken. The response will contain a list of 'searchedLogStreams' that contains information about which streams were searched in the request+-- and whether they have been searched completely or require further pagination.+-- The 'limit' parameter in the request. can be used to specify the maximum number+-- of events to return in a page.+--+-- <http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_FilterLogEvents.html>+module Network.AWS.CloudWatchLogs.FilterLogEvents+    (+    -- * Request+      FilterLogEvents+    -- ** Request constructor+    , filterLogEvents+    -- ** Request lenses+    , fleEndTime+    , fleFilterPattern+    , fleInterleaved+    , fleLimit+    , fleLogGroupName+    , fleLogStreamNames+    , fleNextToken+    , fleStartTime++    -- * Response+    , FilterLogEventsResponse+    -- ** Response constructor+    , filterLogEventsResponse+    -- ** Response lenses+    , flerEvents+    , flerNextToken+    , flerSearchedLogStreams+    ) where++import Network.AWS.Data (Object)+import Network.AWS.Prelude+import Network.AWS.Request.JSON+import Network.AWS.CloudWatchLogs.Types+import qualified GHC.Exts++data FilterLogEvents = FilterLogEvents+    { _fleEndTime        :: Maybe Nat+    , _fleFilterPattern  :: Maybe Text+    , _fleInterleaved    :: Maybe Bool+    , _fleLimit          :: Maybe Nat+    , _fleLogGroupName   :: Text+    , _fleLogStreamNames :: List1 "logStreamNames" Text+    , _fleNextToken      :: Maybe Text+    , _fleStartTime      :: Maybe Nat+    } deriving (Eq, Ord, Read, Show)++-- | 'FilterLogEvents' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'fleEndTime' @::@ 'Maybe' 'Natural'+--+-- * 'fleFilterPattern' @::@ 'Maybe' 'Text'+--+-- * 'fleInterleaved' @::@ 'Maybe' 'Bool'+--+-- * 'fleLimit' @::@ 'Maybe' 'Natural'+--+-- * 'fleLogGroupName' @::@ 'Text'+--+-- * 'fleLogStreamNames' @::@ 'NonEmpty' 'Text'+--+-- * 'fleNextToken' @::@ 'Maybe' 'Text'+--+-- * 'fleStartTime' @::@ 'Maybe' 'Natural'+--+filterLogEvents :: Text -- ^ 'fleLogGroupName'+                -> NonEmpty Text -- ^ 'fleLogStreamNames'+                -> FilterLogEvents+filterLogEvents p1 p2 = FilterLogEvents+    { _fleLogGroupName   = p1+    , _fleLogStreamNames = withIso _List1 (const id) p2+    , _fleStartTime      = Nothing+    , _fleEndTime        = Nothing+    , _fleFilterPattern  = Nothing+    , _fleNextToken      = Nothing+    , _fleLimit          = Nothing+    , _fleInterleaved    = Nothing+    }++-- | A unix timestamp indicating the end time of the range for the request. If+-- provided, events with a timestamp later than this time will not be returned.+fleEndTime :: Lens' FilterLogEvents (Maybe Natural)+fleEndTime = lens _fleEndTime (\s a -> s { _fleEndTime = a }) . mapping _Nat++-- | A valid CloudWatch Logs filter pattern to use for filtering the response. If+-- not provided, all the events are matched.+fleFilterPattern :: Lens' FilterLogEvents (Maybe Text)+fleFilterPattern = lens _fleFilterPattern (\s a -> s { _fleFilterPattern = a })++-- | If provided, the API will make a best effort to provide responses that+-- contain events from multiple log streams within the log group interleaved in+-- a single response. If not provided, all the matched log events in the first+-- log stream will be searched first, then those in the next log stream, etc.+fleInterleaved :: Lens' FilterLogEvents (Maybe Bool)+fleInterleaved = lens _fleInterleaved (\s a -> s { _fleInterleaved = a })++-- | The maximum number of events to return in a page of results. Default is+-- 10,000 events.+fleLimit :: Lens' FilterLogEvents (Maybe Natural)+fleLimit = lens _fleLimit (\s a -> s { _fleLimit = a }) . mapping _Nat++-- | The name of the log group to query+fleLogGroupName :: Lens' FilterLogEvents Text+fleLogGroupName = lens _fleLogGroupName (\s a -> s { _fleLogGroupName = a })++-- | Optional list of log stream names within the specified log group to search.+-- Defaults to all the log streams in the log group.+fleLogStreamNames :: Lens' FilterLogEvents (NonEmpty Text)+fleLogStreamNames =+    lens _fleLogStreamNames (\s a -> s { _fleLogStreamNames = a })+        . _List1++-- | A pagination token obtained from a 'FilterLogEvents' response to continue+-- paginating the FilterLogEvents results.+fleNextToken :: Lens' FilterLogEvents (Maybe Text)+fleNextToken = lens _fleNextToken (\s a -> s { _fleNextToken = a })++-- | A unix timestamp indicating the start time of the range for the request. If+-- provided, events with a timestamp prior to this time will not be returned.+fleStartTime :: Lens' FilterLogEvents (Maybe Natural)+fleStartTime = lens _fleStartTime (\s a -> s { _fleStartTime = a }) . mapping _Nat++data FilterLogEventsResponse = FilterLogEventsResponse+    { _flerEvents             :: List "events" FilteredLogEvent+    , _flerNextToken          :: Maybe Text+    , _flerSearchedLogStreams :: List "searchedLogStreams" SearchedLogStream+    } deriving (Eq, Read, Show)++-- | 'FilterLogEventsResponse' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'flerEvents' @::@ ['FilteredLogEvent']+--+-- * 'flerNextToken' @::@ 'Maybe' 'Text'+--+-- * 'flerSearchedLogStreams' @::@ ['SearchedLogStream']+--+filterLogEventsResponse :: FilterLogEventsResponse+filterLogEventsResponse = FilterLogEventsResponse+    { _flerEvents             = mempty+    , _flerSearchedLogStreams = mempty+    , _flerNextToken          = Nothing+    }++-- | A list of 'FilteredLogEvent' objects representing the matched events from the+-- request.+flerEvents :: Lens' FilterLogEventsResponse [FilteredLogEvent]+flerEvents = lens _flerEvents (\s a -> s { _flerEvents = a }) . _List++-- | A pagination token obtained from a 'FilterLogEvents' response to continue+-- paginating the FilterLogEvents results.+flerNextToken :: Lens' FilterLogEventsResponse (Maybe Text)+flerNextToken = lens _flerNextToken (\s a -> s { _flerNextToken = a })++-- | A list of 'SearchedLogStream' objects indicating which log streams have been+-- searched in this request and whether each has been searched completely or+-- still has more to be paginated.+flerSearchedLogStreams :: Lens' FilterLogEventsResponse [SearchedLogStream]+flerSearchedLogStreams =+    lens _flerSearchedLogStreams (\s a -> s { _flerSearchedLogStreams = a })+        . _List++instance ToPath FilterLogEvents where+    toPath = const "/"++instance ToQuery FilterLogEvents where+    toQuery = const mempty++instance ToHeaders FilterLogEvents++instance ToJSON FilterLogEvents where+    toJSON FilterLogEvents{..} = object+        [ "logGroupName"   .= _fleLogGroupName+        , "logStreamNames" .= _fleLogStreamNames+        , "startTime"      .= _fleStartTime+        , "endTime"        .= _fleEndTime+        , "filterPattern"  .= _fleFilterPattern+        , "nextToken"      .= _fleNextToken+        , "limit"          .= _fleLimit+        , "interleaved"    .= _fleInterleaved+        ]++instance AWSRequest FilterLogEvents where+    type Sv FilterLogEvents = CloudWatchLogs+    type Rs FilterLogEvents = FilterLogEventsResponse++    request  = post "FilterLogEvents"+    response = jsonResponse++instance FromJSON FilterLogEventsResponse where+    parseJSON = withObject "FilterLogEventsResponse" $ \o -> FilterLogEventsResponse+        <$> o .:? "events" .!= mempty+        <*> o .:? "nextToken"+        <*> o .:? "searchedLogStreams" .!= mempty
gen/Network/AWS/CloudWatchLogs/GetLogEvents.hs view
@@ -110,7 +110,7 @@ gleEndTime = lens _gleEndTime (\s a -> s { _gleEndTime = a }) . mapping _Nat  -- | The maximum number of log events returned in the response. If you don't--- specify a value, the request would return as much log events as can fit in a+-- specify a value, the request would return as many log events as can fit in a -- response size of 1MB, up to 10,000 log events. gleLimit :: Lens' GetLogEvents (Maybe Natural) gleLimit = lens _gleLimit (\s a -> s { _gleLimit = a }) . mapping _Nat
gen/Network/AWS/CloudWatchLogs/Types.hs view
@@ -38,6 +38,12 @@     , mfFilterPattern     , mfMetricTransformations +    -- * SearchedLogStream+    , SearchedLogStream+    , searchedLogStream+    , slsLogStreamName+    , slsSearchedCompletely+     -- * MetricFilterMatchRecord     , MetricFilterMatchRecord     , metricFilterMatchRecord@@ -90,6 +96,15 @@     , ileMessage     , ileTimestamp +    -- * FilteredLogEvent+    , FilteredLogEvent+    , filteredLogEvent+    , fleEventId+    , fleIngestionTime+    , fleLogStreamName+    , fleMessage+    , fleTimestamp+     -- * OutputLogEvent     , OutputLogEvent     , outputLogEvent@@ -200,6 +215,46 @@         , "creationTime"          .= _mfCreationTime         ] +data SearchedLogStream = SearchedLogStream+    { _slsLogStreamName      :: Maybe Text+    , _slsSearchedCompletely :: Maybe Bool+    } deriving (Eq, Ord, Read, Show)++-- | 'SearchedLogStream' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'slsLogStreamName' @::@ 'Maybe' 'Text'+--+-- * 'slsSearchedCompletely' @::@ 'Maybe' 'Bool'+--+searchedLogStream :: SearchedLogStream+searchedLogStream = SearchedLogStream+    { _slsLogStreamName      = Nothing+    , _slsSearchedCompletely = Nothing+    }++-- | The name of the log stream.+slsLogStreamName :: Lens' SearchedLogStream (Maybe Text)+slsLogStreamName = lens _slsLogStreamName (\s a -> s { _slsLogStreamName = a })++-- | Indicates whether all the events in this log stream were searched or more+-- data exists to search by paginating further.+slsSearchedCompletely :: Lens' SearchedLogStream (Maybe Bool)+slsSearchedCompletely =+    lens _slsSearchedCompletely (\s a -> s { _slsSearchedCompletely = a })++instance FromJSON SearchedLogStream where+    parseJSON = withObject "SearchedLogStream" $ \o -> SearchedLogStream+        <$> o .:? "logStreamName"+        <*> o .:? "searchedCompletely"++instance ToJSON SearchedLogStream where+    toJSON SearchedLogStream{..} = object+        [ "logStreamName"      .= _slsLogStreamName+        , "searchedCompletely" .= _slsSearchedCompletely+        ]+ data MetricFilterMatchRecord = MetricFilterMatchRecord     { _mfmrEventMessage    :: Maybe Text     , _mfmrEventNumber     :: Maybe Integer@@ -583,6 +638,71 @@     toJSON InputLogEvent{..} = object         [ "timestamp" .= _ileTimestamp         , "message"   .= _ileMessage+        ]++data FilteredLogEvent = FilteredLogEvent+    { _fleEventId       :: Maybe Text+    , _fleIngestionTime :: Maybe Nat+    , _fleLogStreamName :: Maybe Text+    , _fleMessage       :: Maybe Text+    , _fleTimestamp     :: Maybe Nat+    } deriving (Eq, Ord, Read, Show)++-- | 'FilteredLogEvent' constructor.+--+-- The fields accessible through corresponding lenses are:+--+-- * 'fleEventId' @::@ 'Maybe' 'Text'+--+-- * 'fleIngestionTime' @::@ 'Maybe' 'Natural'+--+-- * 'fleLogStreamName' @::@ 'Maybe' 'Text'+--+-- * 'fleMessage' @::@ 'Maybe' 'Text'+--+-- * 'fleTimestamp' @::@ 'Maybe' 'Natural'+--+filteredLogEvent :: FilteredLogEvent+filteredLogEvent = FilteredLogEvent+    { _fleLogStreamName = Nothing+    , _fleTimestamp     = Nothing+    , _fleMessage       = Nothing+    , _fleIngestionTime = Nothing+    , _fleEventId       = Nothing+    }++-- | A unique identifier for this event.+fleEventId :: Lens' FilteredLogEvent (Maybe Text)+fleEventId = lens _fleEventId (\s a -> s { _fleEventId = a })++fleIngestionTime :: Lens' FilteredLogEvent (Maybe Natural)+fleIngestionTime = lens _fleIngestionTime (\s a -> s { _fleIngestionTime = a }) . mapping _Nat++-- | The name of the log stream this event belongs to.+fleLogStreamName :: Lens' FilteredLogEvent (Maybe Text)+fleLogStreamName = lens _fleLogStreamName (\s a -> s { _fleLogStreamName = a })++fleMessage :: Lens' FilteredLogEvent (Maybe Text)+fleMessage = lens _fleMessage (\s a -> s { _fleMessage = a })++fleTimestamp :: Lens' FilteredLogEvent (Maybe Natural)+fleTimestamp = lens _fleTimestamp (\s a -> s { _fleTimestamp = a }) . mapping _Nat++instance FromJSON FilteredLogEvent where+    parseJSON = withObject "FilteredLogEvent" $ \o -> FilteredLogEvent+        <$> o .:? "eventId"+        <*> o .:? "ingestionTime"+        <*> o .:? "logStreamName"+        <*> o .:? "message"+        <*> o .:? "timestamp"++instance ToJSON FilteredLogEvent where+    toJSON FilteredLogEvent{..} = object+        [ "logStreamName" .= _fleLogStreamName+        , "timestamp"     .= _fleTimestamp+        , "message"       .= _fleMessage+        , "ingestionTime" .= _fleIngestionTime+        , "eventId"       .= _fleEventId         ]  data OutputLogEvent = OutputLogEvent