@@ -249,8 +249,8 @@ data Mount = Mount {
249 mountName :: Maybe Text -- this is optional
249 mountName :: Maybe Text -- this is optional
250 , mountSource :: FilePath
250 , mountSource :: FilePath
251 , mountDestination :: FilePath
251 , mountDestination :: FilePath
252− , mountDriver :: Text
252+ , mountDriver :: Maybe Text
253− , mountMode :: Maybe VolumePermission -- apparently this can be null
253+ -- , mountMode :: Maybe VolumePermission -- apparently this can be null
254 , mountRW :: Bool
254 , mountRW :: Bool
255 , mountPropogation :: Text
255 , mountPropogation :: Text
@@ -258,14 +258,14 @@ data Mount = Mount {
259instance FromJSON Mount where
259instance FromJSON Mount where
260 parseJSON (JSON.Object o) = do
260 parseJSON (JSON.Object o) = do
261− name <- o .: "Name"
261+ name <- o .:? "Name"
262 src <- o .: "Source"
262 src <- o .: "Source"
263 dest <- o .: "Destination"
263 dest <- o .: "Destination"
264− driver <- o .: "Driver"
264+ driver <- o .:? "Driver"
265− mode <- o .: "Mode"
265+ -- mode <- o .: "Mode"
266 rw <- o .: "RW"
266 rw <- o .: "RW"
267 prop <- o .: "Propagation"
267 prop <- o .: "Propagation"
268− return $ Mount name src dest driver mode rw prop
268+ return $ Mount name src dest driver rw prop
269 parseJSON _ = fail "Mount is not an object"
269 parseJSON _ = fail "Mount is not an object"
271-- | Data type used for parsing the container state from a list of
271-- | Data type used for parsing the container state from a list of
@@ -523,8 +523,8 @@ instance FromJSON Container where
523 Container <$> parseJSON o
523 Container <$> parseJSON o
524 <*> (v .: "Names")
524 <*> (v .: "Names")
525 <*> (v .: "Image")
525 <*> (v .: "Image")
526− <*> (v .: "ImageID")
526+ <*> (v .: "ImageID") -- Doesn't exist anymore
527− <*> (v .: "Command")
527+ <*> (v .: "Command") -- Doesn't exist anymore
528 <*> (v .: "Created")
528 <*> (v .: "Created")
529 <*> (v .: "State")
529 <*> (v .: "State")
530 <*> (v .: "Ports")
530 <*> (v .: "Ports")
@@ -535,11 +535,10 @@ instance FromJSON Container where
535 parseNetworks (JSON.Object v) =
535 parseNetworks (JSON.Object v) =
536 (v .: "Networks") >>= parseJSON
536 (v .: "Networks") >>= parseJSON
537 parseNetworks _ = fail "Container NetworkSettings: Not a JSON object."
537 parseNetworks _ = fail "Container NetworkSettings: Not a JSON object."
539 parseJSON _ = fail "Container: Not a JSON object."
538 parseJSON _ = fail "Container: Not a JSON object."
541-- | Represents the status of the container life cycle.
540-- | Represents the status of the container life cycle.
542−data Status = Created | Restarting | Running | Paused | Exited | Dead
541+data Status = ContainerStatus T.Text
543 deriving (Eq, Show, Generic)
542 deriving (Eq, Show, Generic)
545instance FromJSON Status where
544instance FromJSON Status where
@@ -789,6 +788,8 @@ instance ToJSON VolumePermission where
789instance FromJSON VolumePermission where
788instance FromJSON VolumePermission where
790 parseJSON "rw" = return ReadWrite
789 parseJSON "rw" = return ReadWrite
791 parseJSON "ro" = return ReadOnly
790 parseJSON "ro" = return ReadOnly
791+ parseJSON "RW" = return ReadWrite
792+ parseJSON "RO" = return ReadOnly
792 parseJSON _ = fail "Failed to parse VolumePermission"
793 parseJSON _ = fail "Failed to parse VolumePermission"
794-- | Used for marking a directory in the container as "exposed" hence
795-- | Used for marking a directory in the container as "exposed" hence