exportRDSDatabaseRecommendations method
Export optimization recommendations for your Amazon Aurora and Amazon Relational Database Service (Amazon RDS) databases.
Recommendations are exported in a comma-separated values (CSV) file, and its metadata in a JavaScript Object Notation (JSON) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see Exporting Recommendations in the Compute Optimizer User Guide.
You can have only one Amazon Aurora or RDS export job in progress per Amazon Web Services Region.
May throw AccessDeniedException.
May throw InternalServerException.
May throw InvalidParameterValueException.
May throw LimitExceededException.
May throw MissingAuthenticationToken.
May throw OptInRequiredException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
Parameter accountIds :
The Amazon Web Services account IDs for the export Amazon Aurora and RDS
database recommendations.
If your account is the management account or the delegated administrator of an organization, use this parameter to specify the member account you want to export recommendations to.
This parameter can't be specified together with the include member accounts parameter. The parameters are mutually exclusive.
If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts aren't included in the export.
You can specify multiple account IDs per request.
Parameter fieldsToExport :
The recommendations data to include in the export file. For more
information about the fields that can be exported, see Exported
files in the Compute Optimizer User Guide.
Parameter fileFormat :
The format of the export file.
The CSV file is the only export file format currently supported.
Parameter filters :
An array of objects to specify a filter that exports a more specific set
of Amazon Aurora and RDS recommendations.
Parameter includeMemberAccounts :
If your account is the management account or the delegated administrator
of an organization, this parameter indicates whether to include
recommendations for resources in all member accounts of the organization.
The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
If this parameter is omitted, recommendations for member accounts of the organization aren't included in the export file.
If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't included in the export.
Implementation
Future<ExportRDSDatabaseRecommendationsResponse>
exportRDSDatabaseRecommendations({
required S3DestinationConfig s3DestinationConfig,
List<String>? accountIds,
List<ExportableRDSDBField>? fieldsToExport,
FileFormat? fileFormat,
List<RDSDBRecommendationFilter>? filters,
bool? includeMemberAccounts,
RecommendationPreferences? recommendationPreferences,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'ComputeOptimizerService.ExportRDSDatabaseRecommendations'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
's3DestinationConfig': s3DestinationConfig,
if (accountIds != null) 'accountIds': accountIds,
if (fieldsToExport != null)
'fieldsToExport': fieldsToExport.map((e) => e.value).toList(),
if (fileFormat != null) 'fileFormat': fileFormat.value,
if (filters != null) 'filters': filters,
if (includeMemberAccounts != null)
'includeMemberAccounts': includeMemberAccounts,
if (recommendationPreferences != null)
'recommendationPreferences': recommendationPreferences,
},
);
return ExportRDSDatabaseRecommendationsResponse.fromJson(jsonResponse.body);
}