246 lines
6.7 KiB
C++
246 lines
6.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/rds/model/RestoreDBClusterFromS3Request.h>
|
|
#include <aws/core/utils/StringUtils.h>
|
|
#include <aws/core/utils/memory/stl/AWSStringStream.h>
|
|
|
|
using namespace Aws::RDS::Model;
|
|
using namespace Aws::Utils;
|
|
|
|
RestoreDBClusterFromS3Request::RestoreDBClusterFromS3Request() :
|
|
m_availabilityZonesHasBeenSet(false),
|
|
m_backupRetentionPeriod(0),
|
|
m_backupRetentionPeriodHasBeenSet(false),
|
|
m_characterSetNameHasBeenSet(false),
|
|
m_databaseNameHasBeenSet(false),
|
|
m_dBClusterIdentifierHasBeenSet(false),
|
|
m_dBClusterParameterGroupNameHasBeenSet(false),
|
|
m_vpcSecurityGroupIdsHasBeenSet(false),
|
|
m_dBSubnetGroupNameHasBeenSet(false),
|
|
m_engineHasBeenSet(false),
|
|
m_engineVersionHasBeenSet(false),
|
|
m_port(0),
|
|
m_portHasBeenSet(false),
|
|
m_masterUsernameHasBeenSet(false),
|
|
m_masterUserPasswordHasBeenSet(false),
|
|
m_optionGroupNameHasBeenSet(false),
|
|
m_preferredBackupWindowHasBeenSet(false),
|
|
m_preferredMaintenanceWindowHasBeenSet(false),
|
|
m_tagsHasBeenSet(false),
|
|
m_storageEncrypted(false),
|
|
m_storageEncryptedHasBeenSet(false),
|
|
m_kmsKeyIdHasBeenSet(false),
|
|
m_enableIAMDatabaseAuthentication(false),
|
|
m_enableIAMDatabaseAuthenticationHasBeenSet(false),
|
|
m_sourceEngineHasBeenSet(false),
|
|
m_sourceEngineVersionHasBeenSet(false),
|
|
m_s3BucketNameHasBeenSet(false),
|
|
m_s3PrefixHasBeenSet(false),
|
|
m_s3IngestionRoleArnHasBeenSet(false),
|
|
m_backtrackWindow(0),
|
|
m_backtrackWindowHasBeenSet(false),
|
|
m_enableCloudwatchLogsExportsHasBeenSet(false),
|
|
m_deletionProtection(false),
|
|
m_deletionProtectionHasBeenSet(false),
|
|
m_copyTagsToSnapshot(false),
|
|
m_copyTagsToSnapshotHasBeenSet(false),
|
|
m_domainHasBeenSet(false),
|
|
m_domainIAMRoleNameHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String RestoreDBClusterFromS3Request::SerializePayload() const
|
|
{
|
|
Aws::StringStream ss;
|
|
ss << "Action=RestoreDBClusterFromS3&";
|
|
if(m_availabilityZonesHasBeenSet)
|
|
{
|
|
unsigned availabilityZonesCount = 1;
|
|
for(auto& item : m_availabilityZones)
|
|
{
|
|
ss << "AvailabilityZones.member." << availabilityZonesCount << "="
|
|
<< StringUtils::URLEncode(item.c_str()) << "&";
|
|
availabilityZonesCount++;
|
|
}
|
|
}
|
|
|
|
if(m_backupRetentionPeriodHasBeenSet)
|
|
{
|
|
ss << "BackupRetentionPeriod=" << m_backupRetentionPeriod << "&";
|
|
}
|
|
|
|
if(m_characterSetNameHasBeenSet)
|
|
{
|
|
ss << "CharacterSetName=" << StringUtils::URLEncode(m_characterSetName.c_str()) << "&";
|
|
}
|
|
|
|
if(m_databaseNameHasBeenSet)
|
|
{
|
|
ss << "DatabaseName=" << StringUtils::URLEncode(m_databaseName.c_str()) << "&";
|
|
}
|
|
|
|
if(m_dBClusterIdentifierHasBeenSet)
|
|
{
|
|
ss << "DBClusterIdentifier=" << StringUtils::URLEncode(m_dBClusterIdentifier.c_str()) << "&";
|
|
}
|
|
|
|
if(m_dBClusterParameterGroupNameHasBeenSet)
|
|
{
|
|
ss << "DBClusterParameterGroupName=" << StringUtils::URLEncode(m_dBClusterParameterGroupName.c_str()) << "&";
|
|
}
|
|
|
|
if(m_vpcSecurityGroupIdsHasBeenSet)
|
|
{
|
|
unsigned vpcSecurityGroupIdsCount = 1;
|
|
for(auto& item : m_vpcSecurityGroupIds)
|
|
{
|
|
ss << "VpcSecurityGroupIds.member." << vpcSecurityGroupIdsCount << "="
|
|
<< StringUtils::URLEncode(item.c_str()) << "&";
|
|
vpcSecurityGroupIdsCount++;
|
|
}
|
|
}
|
|
|
|
if(m_dBSubnetGroupNameHasBeenSet)
|
|
{
|
|
ss << "DBSubnetGroupName=" << StringUtils::URLEncode(m_dBSubnetGroupName.c_str()) << "&";
|
|
}
|
|
|
|
if(m_engineHasBeenSet)
|
|
{
|
|
ss << "Engine=" << StringUtils::URLEncode(m_engine.c_str()) << "&";
|
|
}
|
|
|
|
if(m_engineVersionHasBeenSet)
|
|
{
|
|
ss << "EngineVersion=" << StringUtils::URLEncode(m_engineVersion.c_str()) << "&";
|
|
}
|
|
|
|
if(m_portHasBeenSet)
|
|
{
|
|
ss << "Port=" << m_port << "&";
|
|
}
|
|
|
|
if(m_masterUsernameHasBeenSet)
|
|
{
|
|
ss << "MasterUsername=" << StringUtils::URLEncode(m_masterUsername.c_str()) << "&";
|
|
}
|
|
|
|
if(m_masterUserPasswordHasBeenSet)
|
|
{
|
|
ss << "MasterUserPassword=" << StringUtils::URLEncode(m_masterUserPassword.c_str()) << "&";
|
|
}
|
|
|
|
if(m_optionGroupNameHasBeenSet)
|
|
{
|
|
ss << "OptionGroupName=" << StringUtils::URLEncode(m_optionGroupName.c_str()) << "&";
|
|
}
|
|
|
|
if(m_preferredBackupWindowHasBeenSet)
|
|
{
|
|
ss << "PreferredBackupWindow=" << StringUtils::URLEncode(m_preferredBackupWindow.c_str()) << "&";
|
|
}
|
|
|
|
if(m_preferredMaintenanceWindowHasBeenSet)
|
|
{
|
|
ss << "PreferredMaintenanceWindow=" << StringUtils::URLEncode(m_preferredMaintenanceWindow.c_str()) << "&";
|
|
}
|
|
|
|
if(m_tagsHasBeenSet)
|
|
{
|
|
unsigned tagsCount = 1;
|
|
for(auto& item : m_tags)
|
|
{
|
|
item.OutputToStream(ss, "Tags.member.", tagsCount, "");
|
|
tagsCount++;
|
|
}
|
|
}
|
|
|
|
if(m_storageEncryptedHasBeenSet)
|
|
{
|
|
ss << "StorageEncrypted=" << std::boolalpha << m_storageEncrypted << "&";
|
|
}
|
|
|
|
if(m_kmsKeyIdHasBeenSet)
|
|
{
|
|
ss << "KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
|
|
}
|
|
|
|
if(m_enableIAMDatabaseAuthenticationHasBeenSet)
|
|
{
|
|
ss << "EnableIAMDatabaseAuthentication=" << std::boolalpha << m_enableIAMDatabaseAuthentication << "&";
|
|
}
|
|
|
|
if(m_sourceEngineHasBeenSet)
|
|
{
|
|
ss << "SourceEngine=" << StringUtils::URLEncode(m_sourceEngine.c_str()) << "&";
|
|
}
|
|
|
|
if(m_sourceEngineVersionHasBeenSet)
|
|
{
|
|
ss << "SourceEngineVersion=" << StringUtils::URLEncode(m_sourceEngineVersion.c_str()) << "&";
|
|
}
|
|
|
|
if(m_s3BucketNameHasBeenSet)
|
|
{
|
|
ss << "S3BucketName=" << StringUtils::URLEncode(m_s3BucketName.c_str()) << "&";
|
|
}
|
|
|
|
if(m_s3PrefixHasBeenSet)
|
|
{
|
|
ss << "S3Prefix=" << StringUtils::URLEncode(m_s3Prefix.c_str()) << "&";
|
|
}
|
|
|
|
if(m_s3IngestionRoleArnHasBeenSet)
|
|
{
|
|
ss << "S3IngestionRoleArn=" << StringUtils::URLEncode(m_s3IngestionRoleArn.c_str()) << "&";
|
|
}
|
|
|
|
if(m_backtrackWindowHasBeenSet)
|
|
{
|
|
ss << "BacktrackWindow=" << m_backtrackWindow << "&";
|
|
}
|
|
|
|
if(m_enableCloudwatchLogsExportsHasBeenSet)
|
|
{
|
|
unsigned enableCloudwatchLogsExportsCount = 1;
|
|
for(auto& item : m_enableCloudwatchLogsExports)
|
|
{
|
|
ss << "EnableCloudwatchLogsExports.member." << enableCloudwatchLogsExportsCount << "="
|
|
<< StringUtils::URLEncode(item.c_str()) << "&";
|
|
enableCloudwatchLogsExportsCount++;
|
|
}
|
|
}
|
|
|
|
if(m_deletionProtectionHasBeenSet)
|
|
{
|
|
ss << "DeletionProtection=" << std::boolalpha << m_deletionProtection << "&";
|
|
}
|
|
|
|
if(m_copyTagsToSnapshotHasBeenSet)
|
|
{
|
|
ss << "CopyTagsToSnapshot=" << std::boolalpha << m_copyTagsToSnapshot << "&";
|
|
}
|
|
|
|
if(m_domainHasBeenSet)
|
|
{
|
|
ss << "Domain=" << StringUtils::URLEncode(m_domain.c_str()) << "&";
|
|
}
|
|
|
|
if(m_domainIAMRoleNameHasBeenSet)
|
|
{
|
|
ss << "DomainIAMRoleName=" << StringUtils::URLEncode(m_domainIAMRoleName.c_str()) << "&";
|
|
}
|
|
|
|
ss << "Version=2014-10-31";
|
|
return ss.str();
|
|
}
|
|
|
|
|
|
void RestoreDBClusterFromS3Request::DumpBodyToUrl(Aws::Http::URI& uri ) const
|
|
{
|
|
uri.SetQueryString(SerializePayload());
|
|
}
|