on master help sign in
Adds some more types for log endpoint

and makes sure the parameter ordering is consistent with the rest of the functions

commitb0cb71e422b3dac58bbe01165db482e6f15b04ed authorDeni Bertovic <deni@denibertovic.com> dateFri 8 Apr 2016, 15:10 (11 years ago) parent870a4f4
2 files changed+12−4
src/Docker/Internal.hs+1−1 src/Docker/Types.hs+11−3
src/Docker/Internal.hs+1−1
@@ -92,7 +92,7 @@ getEndpoint (RestartContainerEndpoint t cid) = encodeURLWithQuery ["containers",
9292 DefaultTimeout -> []
9393getEndpoint (PauseContainerEndpoint cid) = encodeURL ["containers", cid, "pause"]
9494getEndpoint (UnpauseContainerEndpoint cid) = encodeURL ["containers", cid, "unpause"]
95−getEndpoint (ContainerLogsEndpoint cid (LogOpts follow stdout stderr since timestamps tail)) =
95+getEndpoint (ContainerLogsEndpoint (LogOpts follow stdout stderr since timestamps tail) cid) =
9696 encodeURLWithQuery ["containers", cid, "logs"] query
9797 where query = [("stdout", Just (encodeQ $ show stdout)), ("stderr", Just (encodeQ $ show stderr)), ("follow", Just (encodeQ $ show follow))]
9898getEndpoint (DeleteContainerEndpoint (DeleteOpts removeVolumes force) cid) =
src/Docker/Types.hs+11−3
@@ -17,7 +17,7 @@ import qualified Data.Text as T
1717import GHC.Generics (Generic)
1818import qualified Network.HTTP.Client as HTTP
1919import Network.HTTP.Types (StdMethod)
20−import Prelude hiding (all)
20+import Prelude hiding (all, tail)
2121
2222type HttpVerb = StdMethod
2323
@@ -32,7 +32,7 @@ data Endpoint =
3232 | RestartContainerEndpoint Timeout ContainerID
3333 | PauseContainerEndpoint ContainerID
3434 | UnpauseContainerEndpoint ContainerID
35− | ContainerLogsEndpoint ContainerID LogOpts
35+ | ContainerLogsEndpoint LogOpts ContainerID
3636 | DeleteContainerEndpoint DeleteOpts ContainerID
3737
3838type URL = Text
@@ -240,11 +240,19 @@ data LogOpts = LogOpts {
240240 follow :: Bool
241241 , stdout :: Bool
242242 , stderr :: Bool
243− , since :: Timestamp
243+ , since :: Maybe Timestamp
244244 , timestamps :: Bool
245245 , tail :: TailLogOpt
246246 } deriving (Eq, Show)
247247
248+defaultLogOpts = LogOpts { follow = False
249+ , stdout = True
250+ , stderr = True
251+ , since = Nothing
252+ , timestamps = True
253+ , tail = All
254+ }
255+
248256data VolumePermission = Rw | Ro deriving (Eq, Show, Generic)
249257
250258instance ToJSON VolumePermission