@@ -49,6 +49,8 @@ _dockerPostQuery endpoint clientOpts postObject = post (fullUrl clientOpts endpo
49emptyPost = "" :: String
49emptyPost = "" :: String
50_dockerEmptyPostQuery endpoint clientOpts = post (fullUrl clientOpts endpoint) (toJSON emptyPost)
50_dockerEmptyPostQuery endpoint clientOpts = post (fullUrl clientOpts endpoint) (toJSON emptyPost)
52+_dockerEmptyDeleteQuery endpoint clientOpts = delete (fullUrl clientOpts endpoint)
52getDockerVersion :: DockerClientOpts -> IO (Maybe DockerVersion)
54getDockerVersion :: DockerClientOpts -> IO (Maybe DockerVersion)
53getDockerVersion = decodeResponse . _dockerGetQuery "/version"
55getDockerVersion = decodeResponse . _dockerGetQuery "/version"
@@ -79,6 +81,13 @@ pauseContainer clientOpts containerId = (^. responseStatus) <$> _dockerEmptyPos
79unpauseContainer :: DockerClientOpts -> String -> IO (Status)
81unpauseContainer :: DockerClientOpts -> String -> IO (Status)
80unpauseContainer clientOpts containerId = (^. responseStatus) <$> _dockerEmptyPostQuery (printf "/containers/%s/unpause" containerId) clientOpts
82unpauseContainer clientOpts containerId = (^. responseStatus) <$> _dockerEmptyPostQuery (printf "/containers/%s/unpause" containerId) clientOpts
84+deleteContainer :: DockerClientOpts -> String -> IO (Status)
85+deleteContainer = deleteContainerWithOpts defaultDeleteOpts
87+deleteContainerWithOpts :: DeleteOpts -> DockerClientOpts -> String -> IO (Status)
88+deleteContainerWithOpts (DeleteOpts removeVolumes force) clientOpts containerId = (^. responseStatus) <$> _dockerEmptyDeleteQuery req clientOpts
89+ where req = printf "/containers/%s?v=%s;force=%s" containerId (show removeVolumes) (show force)
82getContainerLogsStream :: DockerClientOpts -> String -> IO ()
91getContainerLogsStream :: DockerClientOpts -> String -> IO ()
83getContainerLogsStream clientOpts containerId = do
92getContainerLogsStream clientOpts containerId = do
84 req <- PH.parseUrl (fullUrl clientOpts url)
93 req <- PH.parseUrl (fullUrl clientOpts url)