slaveResources :: BaseUrl -> EitherT ServantError IO Cluster
slaveResources host = toCluster <$> getRes [] ["mesos-slave"]
    where
        (_ :<|> getRes :<|> _) = client (Proxy :: Proxy A.API) host
        toCluster = catMaybes . fmap (toNodeRes . view A.total) . HM.elems


-- | Follow the elected Aegle master asynchronously. Returns an IO action to
-- run until a Zookeeper error occurs. Master details available via an 'AdvSTM'
-- action.
slaveResources :: BaseUrl -> EitherT ServantError IO Cluster
slaveResources host = toCluster <$> getRes [] ["mesos-slave"]
    where
        (_ :<|> getRes :<|> _) = client (Proxy :: Proxy A.API) host
        toCluster = catMaybes . fmap (toNodeRes . view A.total) . HM.elems


-- | Follow the elected Aegle master asynchronously. Returns an IO action to
-- run until a Zookeeper error occurs. Master details available via an 'AdvSTM'
-- action.
slaveResources host = toCluster <$> getRes [] ["mesos-slave"]
    where
        (_ :<|> getRes :<|> _) = client (Proxy :: Proxy A.API) host
        toCluster = catMaybes . fmap (toNodeRes . view A.total) . HM.elems


-- | Follow the elected Aegle master asynchronously. Returns an IO action to
-- run until a Zookeeper error occurs. Master details available via an 'AdvSTM'
-- action.