on master help sign in
Rename Status to State
commit6cd466eacc7513b6371c6db0d48848af2b7c4e65 authorJames Parker <dev@jamesparker.me> dateWed 10 Jan 2018, 14:28 (9 years ago) parent625b445
1 file changed+7−7
src/Docker/Client/Types.hs+7−7
src/Docker/Client/Types.hs+7−7
@@ -23,7 +23,7 @@ module Docker.Client.Types (
2323 , ContainerPortInfo(..)
2424 , Container(..)
2525 , ContainerState(..)
26− , Status(..)
26+ , State(..)
2727 , Digest
2828 , Label(..)
2929 , Tag
@@ -238,7 +238,7 @@ data ContainerDetails = ContainerDetails {
238238 , processLabel :: Text
239239 , resolveConfPath :: FilePath
240240 , restartCount :: Int
241− , state :: ContainerState
241+ , containerDetailsState :: ContainerState
242242 , mounts :: [Mount]
243243 }
244244 deriving (Eq, Show, Generic)
@@ -281,7 +281,7 @@ data ContainerState = ContainerState {
281281 , restarting :: Bool
282282 , running :: Bool
283283 , startedAt :: UTCTime
284− , status :: Status
284+ , state :: State
285285 }
286286 deriving (Eq, Show, Generic)
287287
@@ -511,7 +511,7 @@ data Container = Container
511511 , containerImageId :: ImageID
512512 , containerCommand :: Text
513513 , containerCreatedAt :: Int
514− , containerState :: Status -- The naming here is confusing due to inconsitiencies in the Docker API.
514+ , containerState :: State
515515 , containerStatus :: Maybe Text
516516 , containerPorts :: [ContainerPortInfo]
517517 , containerLabels :: [Label]
@@ -539,11 +539,11 @@ instance FromJSON Container where
539539 parseNetworks _ = fail "Container NetworkSettings: Not a JSON object."
540540 parseJSON _ = fail "Container: Not a JSON object."
541541
542−-- | Represents the status of the container life cycle.
543−data Status = Created | Restarting | Running | Paused | Exited | Dead
542+-- | Represents the state of the container life cycle.
543+data State = Created | Restarting | Running | Paused | Exited | Dead
544544 deriving (Eq, Show, Generic)
545545
546−instance FromJSON Status where
546+instance FromJSON State where
547547 parseJSON (JSON.String "running") = return Running
548548 parseJSON (JSON.String "created") = return Created -- Note: Guessing on the string values of these.
549549 parseJSON (JSON.String "restarting") = return Restarting