module Network.AWS.EC2.DescribeInstanceAttribute
(
describeInstanceAttribute
, DescribeInstanceAttribute
, diaDryRun
, diaInstanceId
, diaAttribute
, describeInstanceAttributeResponse
, DescribeInstanceAttributeResponse
, drsInstanceId
, drsGroups
, drsSourceDestCheck
, drsDisableAPITermination
, drsRAMDiskId
, drsKernelId
, drsInstanceType
, drsRootDeviceName
, drsEBSOptimized
, drsUserData
, drsSRIOVNetSupport
, drsInstanceInitiatedShutdownBehavior
, drsProductCodes
, drsBlockDeviceMappings
, drsStatus
) where
import Network.AWS.EC2.Types
import Network.AWS.EC2.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeInstanceAttribute = DescribeInstanceAttribute'
{ _diaDryRun :: !(Maybe Bool)
, _diaInstanceId :: !Text
, _diaAttribute :: !InstanceAttributeName
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeInstanceAttribute
:: Text
-> InstanceAttributeName
-> DescribeInstanceAttribute
describeInstanceAttribute pInstanceId_ pAttribute_ =
DescribeInstanceAttribute'
{ _diaDryRun = Nothing
, _diaInstanceId = pInstanceId_
, _diaAttribute = pAttribute_
}
diaDryRun :: Lens' DescribeInstanceAttribute (Maybe Bool)
diaDryRun = lens _diaDryRun (\ s a -> s{_diaDryRun = a});
diaInstanceId :: Lens' DescribeInstanceAttribute Text
diaInstanceId = lens _diaInstanceId (\ s a -> s{_diaInstanceId = a});
diaAttribute :: Lens' DescribeInstanceAttribute InstanceAttributeName
diaAttribute = lens _diaAttribute (\ s a -> s{_diaAttribute = a});
instance AWSRequest DescribeInstanceAttribute where
type Rs DescribeInstanceAttribute =
DescribeInstanceAttributeResponse
request = postQuery eC2
response
= receiveXML
(\ s h x ->
DescribeInstanceAttributeResponse' <$>
(x .@? "instanceId") <*>
(x .@? "groupSet" .!@ mempty >>=
may (parseXMLList "item"))
<*> (x .@? "sourceDestCheck")
<*> (x .@? "disableApiTermination")
<*> (x .@? "ramdisk")
<*> (x .@? "kernel")
<*> (x .@? "instanceType")
<*> (x .@? "rootDeviceName")
<*> (x .@? "ebsOptimized")
<*> (x .@? "userData")
<*> (x .@? "sriovNetSupport")
<*> (x .@? "instanceInitiatedShutdownBehavior")
<*>
(x .@? "productCodes" .!@ mempty >>=
may (parseXMLList "item"))
<*>
(x .@? "blockDeviceMapping" .!@ mempty >>=
may (parseXMLList "item"))
<*> (pure (fromEnum s)))
instance ToHeaders DescribeInstanceAttribute where
toHeaders = const mempty
instance ToPath DescribeInstanceAttribute where
toPath = const "/"
instance ToQuery DescribeInstanceAttribute where
toQuery DescribeInstanceAttribute'{..}
= mconcat
["Action" =:
("DescribeInstanceAttribute" :: ByteString),
"Version" =: ("2015-04-15" :: ByteString),
"DryRun" =: _diaDryRun,
"InstanceId" =: _diaInstanceId,
"Attribute" =: _diaAttribute]
data DescribeInstanceAttributeResponse = DescribeInstanceAttributeResponse'
{ _drsInstanceId :: !(Maybe Text)
, _drsGroups :: !(Maybe [GroupIdentifier])
, _drsSourceDestCheck :: !(Maybe AttributeBooleanValue)
, _drsDisableAPITermination :: !(Maybe AttributeBooleanValue)
, _drsRAMDiskId :: !(Maybe AttributeValue)
, _drsKernelId :: !(Maybe AttributeValue)
, _drsInstanceType :: !(Maybe AttributeValue)
, _drsRootDeviceName :: !(Maybe AttributeValue)
, _drsEBSOptimized :: !(Maybe AttributeBooleanValue)
, _drsUserData :: !(Maybe AttributeValue)
, _drsSRIOVNetSupport :: !(Maybe AttributeValue)
, _drsInstanceInitiatedShutdownBehavior :: !(Maybe AttributeValue)
, _drsProductCodes :: !(Maybe [ProductCode])
, _drsBlockDeviceMappings :: !(Maybe [InstanceBlockDeviceMapping])
, _drsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeInstanceAttributeResponse
:: Int
-> DescribeInstanceAttributeResponse
describeInstanceAttributeResponse pStatus_ =
DescribeInstanceAttributeResponse'
{ _drsInstanceId = Nothing
, _drsGroups = Nothing
, _drsSourceDestCheck = Nothing
, _drsDisableAPITermination = Nothing
, _drsRAMDiskId = Nothing
, _drsKernelId = Nothing
, _drsInstanceType = Nothing
, _drsRootDeviceName = Nothing
, _drsEBSOptimized = Nothing
, _drsUserData = Nothing
, _drsSRIOVNetSupport = Nothing
, _drsInstanceInitiatedShutdownBehavior = Nothing
, _drsProductCodes = Nothing
, _drsBlockDeviceMappings = Nothing
, _drsStatus = pStatus_
}
drsInstanceId :: Lens' DescribeInstanceAttributeResponse (Maybe Text)
drsInstanceId = lens _drsInstanceId (\ s a -> s{_drsInstanceId = a});
drsGroups :: Lens' DescribeInstanceAttributeResponse [GroupIdentifier]
drsGroups = lens _drsGroups (\ s a -> s{_drsGroups = a}) . _Default . _Coerce;
drsSourceDestCheck :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeBooleanValue)
drsSourceDestCheck = lens _drsSourceDestCheck (\ s a -> s{_drsSourceDestCheck = a});
drsDisableAPITermination :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeBooleanValue)
drsDisableAPITermination = lens _drsDisableAPITermination (\ s a -> s{_drsDisableAPITermination = a});
drsRAMDiskId :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsRAMDiskId = lens _drsRAMDiskId (\ s a -> s{_drsRAMDiskId = a});
drsKernelId :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsKernelId = lens _drsKernelId (\ s a -> s{_drsKernelId = a});
drsInstanceType :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsInstanceType = lens _drsInstanceType (\ s a -> s{_drsInstanceType = a});
drsRootDeviceName :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsRootDeviceName = lens _drsRootDeviceName (\ s a -> s{_drsRootDeviceName = a});
drsEBSOptimized :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeBooleanValue)
drsEBSOptimized = lens _drsEBSOptimized (\ s a -> s{_drsEBSOptimized = a});
drsUserData :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsUserData = lens _drsUserData (\ s a -> s{_drsUserData = a});
drsSRIOVNetSupport :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsSRIOVNetSupport = lens _drsSRIOVNetSupport (\ s a -> s{_drsSRIOVNetSupport = a});
drsInstanceInitiatedShutdownBehavior :: Lens' DescribeInstanceAttributeResponse (Maybe AttributeValue)
drsInstanceInitiatedShutdownBehavior = lens _drsInstanceInitiatedShutdownBehavior (\ s a -> s{_drsInstanceInitiatedShutdownBehavior = a});
drsProductCodes :: Lens' DescribeInstanceAttributeResponse [ProductCode]
drsProductCodes = lens _drsProductCodes (\ s a -> s{_drsProductCodes = a}) . _Default . _Coerce;
drsBlockDeviceMappings :: Lens' DescribeInstanceAttributeResponse [InstanceBlockDeviceMapping]
drsBlockDeviceMappings = lens _drsBlockDeviceMappings (\ s a -> s{_drsBlockDeviceMappings = a}) . _Default . _Coerce;
drsStatus :: Lens' DescribeInstanceAttributeResponse Int
drsStatus = lens _drsStatus (\ s a -> s{_drsStatus = a});