@@ -246,11 +246,11 @@ data ContainerDetails = ContainerDetails {
246246-- | Data type used for parsing the mount information from a container
247247-- list.
248248data Mount = Mount {
249− mountName :: Text
249+ mountName :: Maybe Text
250250 , mountSource :: FilePath
251251 , mountDestination :: FilePath
252− , mountDriver :: Text
253− , mountMode :: Maybe VolumePermission -- apparently this can be null
252+ , mountDriver :: Maybe Text
253+ -- , mountMode :: Maybe VolumePermission -- apparently this can be null
254254 , mountRW :: Bool
255255 , mountPropogation :: Text
256256 }
@@ -258,14 +258,14 @@ data Mount = Mount {
258258
259259instance FromJSON Mount where
260260 parseJSON (JSON.Object o) = do
261− name <- o .: "Name"
261+ name <- o .:? "Name"
262262 src <- o .: "Source"
263263 dest <- o .: "Destination"
264− driver <- o .: "Driver"
265− mode <- o .: "Mode"
264+ driver <- o .:? "Driver"
265+ -- mode <- o .: "Mode"
266266 rw <- o .: "RW"
267267 prop <- o .: "Propagation"
268− return $ Mount name src dest driver mode rw prop
268+ return $ Mount name src dest driver rw prop
269269 parseJSON _ = fail "Mount is not an object"
270270
271271-- | Data type used for parsing the container state from a list of
@@ -520,11 +520,11 @@ data Container = Container
520520
521521instance FromJSON Container where
522522 parseJSON o@(JSON.Object v) =
523− Container <$> (parseJSON o)
523+ Container <$> parseJSON o
524524 <*> (v .: "Names")
525525 <*> (v .: "Image")
526− <*> (v .: "ImageID")
527− <*> (v .: "Command")
526+ <*> (v .: "ImageID") -- Doesn't exist anymore
527+ <*> (v .: "Command") -- Doesn't exist anymore
528528 <*> (v .: "Created")
529529 <*> (v .: "Status")
530530 <*> (v .: "Ports")
@@ -538,17 +538,17 @@ instance FromJSON Container where
538538 parseJSON _ = fail "Container: Not a JSON object."
539539
540540-- | Represents the status of the container life cycle.
541−data Status = Created | Restarting | Running | Paused | Exited | Dead
541+data Status = ContainerStatus T.Text
542542 deriving (Eq, Show, Generic)
543543
544544instance FromJSON Status where
545− parseJSON (JSON.String "running") = return Running
546− parseJSON (JSON.String "created") = return Created -- Note: Guessing on the string values of these.
547− parseJSON (JSON.String "restarting") = return Restarting
548− parseJSON (JSON.String "paused") = return Paused
549− parseJSON (JSON.String "exited") = return Exited
550− parseJSON (JSON.String "dead") = return Dead
551− parseJSON _ = fail "Unknown Status"
545+ parseJSON (JSON.String s) = return $ ContainerStatus s
546+ -- parseJSON (JSON.String "Created") = return Created
547+ -- parseJSON (JSON.String "Restarting") = return Restarting
548+ -- parseJSON (JSON.String "Paused") = return Paused
549+ -- parseJSON (JSON.String "Exited") = parseExited s
550+ -- parseJSON (JSON.String "Dead") = return Dead
551+ parseJSON _ = fail "Failed to parse Status. Unknown Status."
552552
553553-- | Alias for representing a RepoDigest. We could newtype this and add
554554-- some validation.
@@ -788,6 +788,8 @@ instance ToJSON VolumePermission where
788788instance FromJSON VolumePermission where
789789 parseJSON "rw" = return ReadWrite
790790 parseJSON "ro" = return ReadOnly
791+ parseJSON "RW" = return ReadWrite
792+ parseJSON "RO" = return ReadOnly
791793 parseJSON _ = fail "Failed to parse VolumePermission"
792794
793795-- | Used for marking a directory in the container as "exposed" hence