module Network.AWS.Redshift.RestoreFromClusterSnapshot
(
restoreFromClusterSnapshot
, RestoreFromClusterSnapshot
, rfcsPubliclyAccessible
, rfcsSnapshotClusterIdentifier
, rfcsHSMConfigurationIdentifier
, rfcsClusterSecurityGroups
, rfcsAutomatedSnapshotRetentionPeriod
, rfcsClusterSubnetGroupName
, rfcsHSMClientCertificateIdentifier
, rfcsElasticIP
, rfcsPreferredMaintenanceWindow
, rfcsKMSKeyId
, rfcsAvailabilityZone
, rfcsVPCSecurityGroupIds
, rfcsOwnerAccount
, rfcsNodeType
, rfcsAllowVersionUpgrade
, rfcsClusterParameterGroupName
, rfcsPort
, rfcsClusterIdentifier
, rfcsSnapshotIdentifier
, restoreFromClusterSnapshotResponse
, RestoreFromClusterSnapshotResponse
, rfcsrsCluster
, rfcsrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data RestoreFromClusterSnapshot = RestoreFromClusterSnapshot'
{ _rfcsPubliclyAccessible :: !(Maybe Bool)
, _rfcsSnapshotClusterIdentifier :: !(Maybe Text)
, _rfcsHSMConfigurationIdentifier :: !(Maybe Text)
, _rfcsClusterSecurityGroups :: !(Maybe [Text])
, _rfcsAutomatedSnapshotRetentionPeriod :: !(Maybe Int)
, _rfcsClusterSubnetGroupName :: !(Maybe Text)
, _rfcsHSMClientCertificateIdentifier :: !(Maybe Text)
, _rfcsElasticIP :: !(Maybe Text)
, _rfcsPreferredMaintenanceWindow :: !(Maybe Text)
, _rfcsKMSKeyId :: !(Maybe Text)
, _rfcsAvailabilityZone :: !(Maybe Text)
, _rfcsVPCSecurityGroupIds :: !(Maybe [Text])
, _rfcsOwnerAccount :: !(Maybe Text)
, _rfcsNodeType :: !(Maybe Text)
, _rfcsAllowVersionUpgrade :: !(Maybe Bool)
, _rfcsClusterParameterGroupName :: !(Maybe Text)
, _rfcsPort :: !(Maybe Int)
, _rfcsClusterIdentifier :: !Text
, _rfcsSnapshotIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreFromClusterSnapshot
:: Text
-> Text
-> RestoreFromClusterSnapshot
restoreFromClusterSnapshot pClusterIdentifier_ pSnapshotIdentifier_ =
RestoreFromClusterSnapshot'
{ _rfcsPubliclyAccessible = Nothing
, _rfcsSnapshotClusterIdentifier = Nothing
, _rfcsHSMConfigurationIdentifier = Nothing
, _rfcsClusterSecurityGroups = Nothing
, _rfcsAutomatedSnapshotRetentionPeriod = Nothing
, _rfcsClusterSubnetGroupName = Nothing
, _rfcsHSMClientCertificateIdentifier = Nothing
, _rfcsElasticIP = Nothing
, _rfcsPreferredMaintenanceWindow = Nothing
, _rfcsKMSKeyId = Nothing
, _rfcsAvailabilityZone = Nothing
, _rfcsVPCSecurityGroupIds = Nothing
, _rfcsOwnerAccount = Nothing
, _rfcsNodeType = Nothing
, _rfcsAllowVersionUpgrade = Nothing
, _rfcsClusterParameterGroupName = Nothing
, _rfcsPort = Nothing
, _rfcsClusterIdentifier = pClusterIdentifier_
, _rfcsSnapshotIdentifier = pSnapshotIdentifier_
}
rfcsPubliclyAccessible :: Lens' RestoreFromClusterSnapshot (Maybe Bool)
rfcsPubliclyAccessible = lens _rfcsPubliclyAccessible (\ s a -> s{_rfcsPubliclyAccessible = a});
rfcsSnapshotClusterIdentifier :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsSnapshotClusterIdentifier = lens _rfcsSnapshotClusterIdentifier (\ s a -> s{_rfcsSnapshotClusterIdentifier = a});
rfcsHSMConfigurationIdentifier :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsHSMConfigurationIdentifier = lens _rfcsHSMConfigurationIdentifier (\ s a -> s{_rfcsHSMConfigurationIdentifier = a});
rfcsClusterSecurityGroups :: Lens' RestoreFromClusterSnapshot [Text]
rfcsClusterSecurityGroups = lens _rfcsClusterSecurityGroups (\ s a -> s{_rfcsClusterSecurityGroups = a}) . _Default . _Coerce;
rfcsAutomatedSnapshotRetentionPeriod :: Lens' RestoreFromClusterSnapshot (Maybe Int)
rfcsAutomatedSnapshotRetentionPeriod = lens _rfcsAutomatedSnapshotRetentionPeriod (\ s a -> s{_rfcsAutomatedSnapshotRetentionPeriod = a});
rfcsClusterSubnetGroupName :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsClusterSubnetGroupName = lens _rfcsClusterSubnetGroupName (\ s a -> s{_rfcsClusterSubnetGroupName = a});
rfcsHSMClientCertificateIdentifier :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsHSMClientCertificateIdentifier = lens _rfcsHSMClientCertificateIdentifier (\ s a -> s{_rfcsHSMClientCertificateIdentifier = a});
rfcsElasticIP :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsElasticIP = lens _rfcsElasticIP (\ s a -> s{_rfcsElasticIP = a});
rfcsPreferredMaintenanceWindow :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsPreferredMaintenanceWindow = lens _rfcsPreferredMaintenanceWindow (\ s a -> s{_rfcsPreferredMaintenanceWindow = a});
rfcsKMSKeyId :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsKMSKeyId = lens _rfcsKMSKeyId (\ s a -> s{_rfcsKMSKeyId = a});
rfcsAvailabilityZone :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsAvailabilityZone = lens _rfcsAvailabilityZone (\ s a -> s{_rfcsAvailabilityZone = a});
rfcsVPCSecurityGroupIds :: Lens' RestoreFromClusterSnapshot [Text]
rfcsVPCSecurityGroupIds = lens _rfcsVPCSecurityGroupIds (\ s a -> s{_rfcsVPCSecurityGroupIds = a}) . _Default . _Coerce;
rfcsOwnerAccount :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsOwnerAccount = lens _rfcsOwnerAccount (\ s a -> s{_rfcsOwnerAccount = a});
rfcsNodeType :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsNodeType = lens _rfcsNodeType (\ s a -> s{_rfcsNodeType = a});
rfcsAllowVersionUpgrade :: Lens' RestoreFromClusterSnapshot (Maybe Bool)
rfcsAllowVersionUpgrade = lens _rfcsAllowVersionUpgrade (\ s a -> s{_rfcsAllowVersionUpgrade = a});
rfcsClusterParameterGroupName :: Lens' RestoreFromClusterSnapshot (Maybe Text)
rfcsClusterParameterGroupName = lens _rfcsClusterParameterGroupName (\ s a -> s{_rfcsClusterParameterGroupName = a});
rfcsPort :: Lens' RestoreFromClusterSnapshot (Maybe Int)
rfcsPort = lens _rfcsPort (\ s a -> s{_rfcsPort = a});
rfcsClusterIdentifier :: Lens' RestoreFromClusterSnapshot Text
rfcsClusterIdentifier = lens _rfcsClusterIdentifier (\ s a -> s{_rfcsClusterIdentifier = a});
rfcsSnapshotIdentifier :: Lens' RestoreFromClusterSnapshot Text
rfcsSnapshotIdentifier = lens _rfcsSnapshotIdentifier (\ s a -> s{_rfcsSnapshotIdentifier = a});
instance AWSRequest RestoreFromClusterSnapshot where
type Rs RestoreFromClusterSnapshot =
RestoreFromClusterSnapshotResponse
request = postQuery redshift
response
= receiveXMLWrapper
"RestoreFromClusterSnapshotResult"
(\ s h x ->
RestoreFromClusterSnapshotResponse' <$>
(x .@? "Cluster") <*> (pure (fromEnum s)))
instance ToHeaders RestoreFromClusterSnapshot where
toHeaders = const mempty
instance ToPath RestoreFromClusterSnapshot where
toPath = const "/"
instance ToQuery RestoreFromClusterSnapshot where
toQuery RestoreFromClusterSnapshot'{..}
= mconcat
["Action" =:
("RestoreFromClusterSnapshot" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"PubliclyAccessible" =: _rfcsPubliclyAccessible,
"SnapshotClusterIdentifier" =:
_rfcsSnapshotClusterIdentifier,
"HsmConfigurationIdentifier" =:
_rfcsHSMConfigurationIdentifier,
"ClusterSecurityGroups" =:
toQuery
(toQueryList "ClusterSecurityGroupName" <$>
_rfcsClusterSecurityGroups),
"AutomatedSnapshotRetentionPeriod" =:
_rfcsAutomatedSnapshotRetentionPeriod,
"ClusterSubnetGroupName" =:
_rfcsClusterSubnetGroupName,
"HsmClientCertificateIdentifier" =:
_rfcsHSMClientCertificateIdentifier,
"ElasticIp" =: _rfcsElasticIP,
"PreferredMaintenanceWindow" =:
_rfcsPreferredMaintenanceWindow,
"KmsKeyId" =: _rfcsKMSKeyId,
"AvailabilityZone" =: _rfcsAvailabilityZone,
"VpcSecurityGroupIds" =:
toQuery
(toQueryList "VpcSecurityGroupId" <$>
_rfcsVPCSecurityGroupIds),
"OwnerAccount" =: _rfcsOwnerAccount,
"NodeType" =: _rfcsNodeType,
"AllowVersionUpgrade" =: _rfcsAllowVersionUpgrade,
"ClusterParameterGroupName" =:
_rfcsClusterParameterGroupName,
"Port" =: _rfcsPort,
"ClusterIdentifier" =: _rfcsClusterIdentifier,
"SnapshotIdentifier" =: _rfcsSnapshotIdentifier]
data RestoreFromClusterSnapshotResponse = RestoreFromClusterSnapshotResponse'
{ _rfcsrsCluster :: !(Maybe Cluster)
, _rfcsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreFromClusterSnapshotResponse
:: Int
-> RestoreFromClusterSnapshotResponse
restoreFromClusterSnapshotResponse pResponseStatus_ =
RestoreFromClusterSnapshotResponse'
{ _rfcsrsCluster = Nothing
, _rfcsrsResponseStatus = pResponseStatus_
}
rfcsrsCluster :: Lens' RestoreFromClusterSnapshotResponse (Maybe Cluster)
rfcsrsCluster = lens _rfcsrsCluster (\ s a -> s{_rfcsrsCluster = a});
rfcsrsResponseStatus :: Lens' RestoreFromClusterSnapshotResponse Int
rfcsrsResponseStatus = lens _rfcsrsResponseStatus (\ s a -> s{_rfcsrsResponseStatus = a});