CostOptimizationHub / Paginator / ListRecommendations

ListRecommendations#

class CostOptimizationHub.Paginator.ListRecommendations#
paginator = client.get_paginator('list_recommendations')
paginate(**kwargs)#

Creates an iterator that will paginate through responses from CostOptimizationHub.Client.list_recommendations().

See also: AWS API Documentation

Request Syntax

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

    The constraints that you want all returned recommendations to match.

    • accountIds (list) –

      The account that the recommendation is for.

      • (string) –

    • actionTypes (list) –

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

      • (string) –

    • implementationEfforts (list) –

      The effort required to implement the recommendation.

      • (string) –

    • recommendationIds (list) –

      The IDs for the recommendations.

      • (string) –

    • regions (list) –

      The Amazon Web Services Region of the resource.

      • (string) –

    • resourceArns (list) –

      The Amazon Resource Name (ARN) of the recommendation.

      • (string) –

    • resourceIds (list) –

      The resource ID of the recommendation.

      • (string) –

    • resourceTypes (list) –

      The resource type of the recommendation.

      • (string) –

    • restartNeeded (boolean) –

      Whether or not implementing the recommendation requires a restart.

    • rollbackPossible (boolean) –

      Whether or not implementing the recommendation can be rolled back.

    • 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.

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

  • 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.

  • PaginationConfig (dict) –

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) –

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) –

      The size of each page.

    • StartingToken (string) –

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type:

dict

Returns:

Response Syntax

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

Response Structure

  • (dict) –

    • items (list) –

      List of all savings recommendations.

      • (dict) –

        Describes a recommendation.

        • accountId (string) –

          The account that the recommendation is for.

        • actionType (string) –

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

        • currencyCode (string) –

          The currency code used for the recommendation.

        • currentResourceSummary (string) –

          Describes the current resource.

        • currentResourceType (string) –

          The current resource type.

        • estimatedMonthlyCost (float) –

          The estimated monthly cost for the recommendation.

        • 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.

        • implementationEffort (string) –

          The effort required to implement the recommendation.

        • lastRefreshTimestamp (datetime) –

          The time when the recommendation was last generated.

        • recommendationId (string) –

          The ID for the recommendation.

        • recommendationLookbackPeriodInDays (integer) –

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

        • recommendedResourceSummary (string) –

          Describes the recommended resource.

        • recommendedResourceType (string) –

          The recommended resource type.

        • region (string) –

          The Amazon Web Services Region of the resource.

        • resourceArn (string) –

          The Amazon Resource Name (ARN) for the recommendation.

        • resourceId (string) –

          The resource ID for the recommendation.

        • restartNeeded (boolean) –

          Whether or not implementing the recommendation requires a restart.

        • rollbackPossible (boolean) –

          Whether or not implementing the recommendation can be rolled back.

        • 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) –

      A token to resume pagination.