module Network.AWS.ElasticBeanstalk.DescribeInstancesHealth
(
describeInstancesHealth
, DescribeInstancesHealth
, dihNextToken
, dihEnvironmentName
, dihAttributeNames
, dihEnvironmentId
, describeInstancesHealthResponse
, DescribeInstancesHealthResponse
, dihrsInstanceHealthList
, dihrsNextToken
, dihrsRefreshedAt
, dihrsResponseStatus
) where
import Network.AWS.ElasticBeanstalk.Types
import Network.AWS.ElasticBeanstalk.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeInstancesHealth = DescribeInstancesHealth'
{ _dihNextToken :: !(Maybe Text)
, _dihEnvironmentName :: !(Maybe Text)
, _dihAttributeNames :: !(Maybe [InstancesHealthAttribute])
, _dihEnvironmentId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeInstancesHealth
:: DescribeInstancesHealth
describeInstancesHealth =
DescribeInstancesHealth'
{ _dihNextToken = Nothing
, _dihEnvironmentName = Nothing
, _dihAttributeNames = Nothing
, _dihEnvironmentId = Nothing
}
dihNextToken :: Lens' DescribeInstancesHealth (Maybe Text)
dihNextToken = lens _dihNextToken (\ s a -> s{_dihNextToken = a});
dihEnvironmentName :: Lens' DescribeInstancesHealth (Maybe Text)
dihEnvironmentName = lens _dihEnvironmentName (\ s a -> s{_dihEnvironmentName = a});
dihAttributeNames :: Lens' DescribeInstancesHealth [InstancesHealthAttribute]
dihAttributeNames = lens _dihAttributeNames (\ s a -> s{_dihAttributeNames = a}) . _Default . _Coerce;
dihEnvironmentId :: Lens' DescribeInstancesHealth (Maybe Text)
dihEnvironmentId = lens _dihEnvironmentId (\ s a -> s{_dihEnvironmentId = a});
instance AWSRequest DescribeInstancesHealth where
type Rs DescribeInstancesHealth =
DescribeInstancesHealthResponse
request = postQuery elasticBeanstalk
response
= receiveXMLWrapper "DescribeInstancesHealthResult"
(\ s h x ->
DescribeInstancesHealthResponse' <$>
(x .@? "InstanceHealthList" .!@ mempty >>=
may (parseXMLList "member"))
<*> (x .@? "NextToken")
<*> (x .@? "RefreshedAt")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeInstancesHealth where
toHeaders = const mempty
instance ToPath DescribeInstancesHealth where
toPath = const "/"
instance ToQuery DescribeInstancesHealth where
toQuery DescribeInstancesHealth'{..}
= mconcat
["Action" =:
("DescribeInstancesHealth" :: ByteString),
"Version" =: ("2010-12-01" :: ByteString),
"NextToken" =: _dihNextToken,
"EnvironmentName" =: _dihEnvironmentName,
"AttributeNames" =:
toQuery
(toQueryList "member" <$> _dihAttributeNames),
"EnvironmentId" =: _dihEnvironmentId]
data DescribeInstancesHealthResponse = DescribeInstancesHealthResponse'
{ _dihrsInstanceHealthList :: !(Maybe [SingleInstanceHealth])
, _dihrsNextToken :: !(Maybe Text)
, _dihrsRefreshedAt :: !(Maybe ISO8601)
, _dihrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeInstancesHealthResponse
:: Int
-> DescribeInstancesHealthResponse
describeInstancesHealthResponse pResponseStatus_ =
DescribeInstancesHealthResponse'
{ _dihrsInstanceHealthList = Nothing
, _dihrsNextToken = Nothing
, _dihrsRefreshedAt = Nothing
, _dihrsResponseStatus = pResponseStatus_
}
dihrsInstanceHealthList :: Lens' DescribeInstancesHealthResponse [SingleInstanceHealth]
dihrsInstanceHealthList = lens _dihrsInstanceHealthList (\ s a -> s{_dihrsInstanceHealthList = a}) . _Default . _Coerce;
dihrsNextToken :: Lens' DescribeInstancesHealthResponse (Maybe Text)
dihrsNextToken = lens _dihrsNextToken (\ s a -> s{_dihrsNextToken = a});
dihrsRefreshedAt :: Lens' DescribeInstancesHealthResponse (Maybe UTCTime)
dihrsRefreshedAt = lens _dihrsRefreshedAt (\ s a -> s{_dihrsRefreshedAt = a}) . mapping _Time;
dihrsResponseStatus :: Lens' DescribeInstancesHealthResponse Int
dihrsResponseStatus = lens _dihrsResponseStatus (\ s a -> s{_dihrsResponseStatus = a});