CostOptimizationHub / Client / list_recommendations

list_recommendations#

CostOptimizationHub.Client.list_recommendations(**kwargs)#

Returns a list of recommendations.

See also: AWS API Documentation

Request Syntax

response = client.list_recommendations(
    filter={
        'restartNeeded': True|False,
        'rollbackPossible': True|False,
        'implementationEfforts': [
            'VeryLow'|'Low'|'Medium'|'High'|'VeryHigh',
        ],
        'accountIds': [
            'string',
        ],
        'regions': [
            'string',
        ],
        'resourceTypes': [
            'Ec2Instance'|'LambdaFunction'|'EbsVolume'|'EcsService'|'Ec2AutoScalingGroup'|'Ec2InstanceSavingsPlans'|'ComputeSavingsPlans'|'SageMakerSavingsPlans'|'Ec2ReservedInstances'|'RdsReservedInstances'|'OpenSearchReservedInstances'|'RedshiftReservedInstances'|'ElastiCacheReservedInstances'|'RdsDbInstanceStorage'|'RdsDbInstance',
        ],
        'actionTypes': [
            'Rightsize'|'Stop'|'Upgrade'|'PurchaseSavingsPlans'|'PurchaseReservedInstances'|'MigrateToGraviton',
        ],
        'tags': [
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        'resourceIds': [
            'string',
        ],
        'resourceArns': [
            'string',
        ],
        'recommendationIds': [
            'string',
        ]
    },
    orderBy={
        'dimension': 'string',
        'order': 'Asc'|'Desc'
    },
    includeAllRecommendations=True|False,
    maxResults=123,
    nextToken='string'
)
Parameters:
  • filter (dict) –

    The constraints that you want all returned recommendations to match.

    • restartNeeded (boolean) –

      Whether or not implementing the recommendation requires a restart.

    • rollbackPossible (boolean) –

      Whether or not implementing the recommendation can be rolled back.

    • implementationEfforts (list) –

      The effort required to implement the recommendation.

      • (string) –

    • accountIds (list) –

      The account that the recommendation is for.

      • (string) –

    • regions (list) –

      The Amazon Web Services Region of the resource.

      • (string) –

    • resourceTypes (list) –

      The resource type of the recommendation.

      • (string) –

    • actionTypes (list) –

      The type of action you can take by adopting the recommendation.

      • (string) –

    • tags (list) –

      A list of tags assigned to the recommendation.

      • (dict) –

        The tag structure that contains a tag key and value.

        • key (string) –

          The key that’s associated with the tag.

        • value (string) –

          The value that’s associated with the tag.

    • resourceIds (list) –

      The resource ID of the recommendation.

      • (string) –

    • resourceArns (list) –

      The Amazon Resource Name (ARN) of the recommendation.

      • (string) –

    • recommendationIds (list) –

      The IDs for the recommendations.

      • (string) –

  • orderBy (dict) –

    The ordering of recommendations by a dimension.

    • dimension (string) –

      Sorts by dimension values.

    • order (string) –

      The order that’s used to sort the data.

  • includeAllRecommendations (boolean) – List of all recommendations for a resource, or a single recommendation if de-duped by resourceId.

  • maxResults (integer) – The maximum number of recommendations that are returned for the request.

  • nextToken (string) – The token to retrieve the next set of results.

Return type:

dict

Returns:

Response Syntax

{
    'items': [
        {
            'recommendationId': 'string',
            'accountId': 'string',
            'region': 'string',
            'resourceId': 'string',
            'resourceArn': 'string',
            'currentResourceType': 'string',
            'recommendedResourceType': 'string',
            'estimatedMonthlySavings': 123.0,
            'estimatedSavingsPercentage': 123.0,
            'estimatedMonthlyCost': 123.0,
            'currencyCode': 'string',
            'implementationEffort': 'string',
            'restartNeeded': True|False,
            'actionType': 'string',
            'rollbackPossible': True|False,
            'currentResourceSummary': 'string',
            'recommendedResourceSummary': 'string',
            'lastRefreshTimestamp': datetime(2015, 1, 1),
            'recommendationLookbackPeriodInDays': 123,
            'source': 'ComputeOptimizer'|'CostExplorer',
            'tags': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ]
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • items (list) –

      List of all savings recommendations.

      • (dict) –

        Describes a recommendation.

        • recommendationId (string) –

          The ID for the recommendation.

        • accountId (string) –

          The account that the recommendation is for.

        • region (string) –

          The Amazon Web Services Region of the resource.

        • resourceId (string) –

          The resource ID for the recommendation.

        • resourceArn (string) –

          The Amazon Resource Name (ARN) for the recommendation.

        • currentResourceType (string) –

          The current resource type.

        • recommendedResourceType (string) –

          The recommended resource type.

        • estimatedMonthlySavings (float) –

          The estimated monthly savings amount for the recommendation.

        • estimatedSavingsPercentage (float) –

          The estimated savings percentage relative to the total cost over the cost calculation lookback period.

        • estimatedMonthlyCost (float) –

          The estimated monthly cost of the current resource. For Reserved Instances and Savings Plans, it refers to the cost for eligible usage.

        • currencyCode (string) –

          The currency code used for the recommendation.

        • implementationEffort (string) –

          The effort required to implement the recommendation.

        • restartNeeded (boolean) –

          Whether or not implementing the recommendation requires a restart.

        • actionType (string) –

          The type of tasks that can be carried out by this action.

        • rollbackPossible (boolean) –

          Whether or not implementing the recommendation can be rolled back.

        • currentResourceSummary (string) –

          Describes the current resource.

        • recommendedResourceSummary (string) –

          Describes the recommended resource.

        • lastRefreshTimestamp (datetime) –

          The time when the recommendation was last generated.

        • recommendationLookbackPeriodInDays (integer) –

          The lookback period that’s used to generate the recommendation.

        • source (string) –

          The source of the recommendation.

        • tags (list) –

          A list of tags assigned to the recommendation.

          • (dict) –

            The tag structure that contains a tag key and value.

            • key (string) –

              The key that’s associated with the tag.

            • value (string) –

              The value that’s associated with the tag.

    • nextToken (string) –

      The token to retrieve the next set of results.

Exceptions

  • CostOptimizationHub.Client.exceptions.ValidationException

  • CostOptimizationHub.Client.exceptions.InternalServerException

  • CostOptimizationHub.Client.exceptions.AccessDeniedException

  • CostOptimizationHub.Client.exceptions.ThrottlingException