module Network.AWS.ELB.DescribeInstanceHealth
(
describeInstanceHealth
, DescribeInstanceHealth
, dihInstances
, dihLoadBalancerName
, describeInstanceHealthResponse
, DescribeInstanceHealthResponse
, dihrsInstanceStates
, dihrsStatus
) where
import Network.AWS.ELB.Types
import Network.AWS.ELB.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeInstanceHealth = DescribeInstanceHealth'
{ _dihInstances :: !(Maybe [Instance])
, _dihLoadBalancerName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeInstanceHealth
:: Text
-> DescribeInstanceHealth
describeInstanceHealth pLoadBalancerName_ =
DescribeInstanceHealth'
{ _dihInstances = Nothing
, _dihLoadBalancerName = pLoadBalancerName_
}
dihInstances :: Lens' DescribeInstanceHealth [Instance]
dihInstances = lens _dihInstances (\ s a -> s{_dihInstances = a}) . _Default . _Coerce;
dihLoadBalancerName :: Lens' DescribeInstanceHealth Text
dihLoadBalancerName = lens _dihLoadBalancerName (\ s a -> s{_dihLoadBalancerName = a});
instance AWSRequest DescribeInstanceHealth where
type Rs DescribeInstanceHealth =
DescribeInstanceHealthResponse
request = postQuery eLB
response
= receiveXMLWrapper "DescribeInstanceHealthResult"
(\ s h x ->
DescribeInstanceHealthResponse' <$>
(x .@? "InstanceStates" .!@ mempty >>=
may (parseXMLList "member"))
<*> (pure (fromEnum s)))
instance ToHeaders DescribeInstanceHealth where
toHeaders = const mempty
instance ToPath DescribeInstanceHealth where
toPath = const "/"
instance ToQuery DescribeInstanceHealth where
toQuery DescribeInstanceHealth'{..}
= mconcat
["Action" =:
("DescribeInstanceHealth" :: ByteString),
"Version" =: ("2012-06-01" :: ByteString),
"Instances" =:
toQuery (toQueryList "member" <$> _dihInstances),
"LoadBalancerName" =: _dihLoadBalancerName]
data DescribeInstanceHealthResponse = DescribeInstanceHealthResponse'
{ _dihrsInstanceStates :: !(Maybe [InstanceState])
, _dihrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeInstanceHealthResponse
:: Int
-> DescribeInstanceHealthResponse
describeInstanceHealthResponse pStatus_ =
DescribeInstanceHealthResponse'
{ _dihrsInstanceStates = Nothing
, _dihrsStatus = pStatus_
}
dihrsInstanceStates :: Lens' DescribeInstanceHealthResponse [InstanceState]
dihrsInstanceStates = lens _dihrsInstanceStates (\ s a -> s{_dihrsInstanceStates = a}) . _Default . _Coerce;
dihrsStatus :: Lens' DescribeInstanceHealthResponse Int
dihrsStatus = lens _dihrsStatus (\ s a -> s{_dihrsStatus = a});