:doc:`CostOptimizationHub <../../cost-optimization-hub>` / Client / list_recommendations

********************
list_recommendations
********************



.. py:method:: CostOptimizationHub.Client.list_recommendations(**kwargs)

  

  Returns a list of recommendations.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListRecommendations>`_  


  **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'|'AuroraDbClusterStorage'|'DynamoDbReservedCapacity'|'MemoryDbReservedInstances'|'NatGateway',
            ],
            'actionTypes': [
                'Rightsize'|'Stop'|'Upgrade'|'PurchaseSavingsPlans'|'PurchaseReservedInstances'|'MigrateToGraviton'|'Delete'|'ScaleIn',
            ],
            'tags': [
                {
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                'string',
            ],
            'resourceArns': [
                'string',
            ],
            'recommendationIds': [
                'string',
            ]
        },
        orderBy={
            'dimension': 'string',
            'order': 'Asc'|'Desc'
        },
        includeAllRecommendations=True|False,
        maxResults=123,
        nextToken='string'
    )
    
  :type filter: dict
  :param filter: 

    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 to which the recommendation applies.

      

    
      - *(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) --* 

      
  
  
  :type orderBy: dict
  :param orderBy: 

    The ordering of recommendations by a dimension.

    

  
    - **dimension** *(string) --* 

      Sorts by dimension values.

      

    
    - **order** *(string) --* 

      The order that's used to sort the data.

      

    
  
  :type includeAllRecommendations: boolean
  :param includeAllRecommendations: 

    List of all recommendations for a resource, or a single recommendation if de-duped by ``resourceId``.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of recommendations that are returned for the request.

    

  
  :type nextToken: string
  :param nextToken: 

    The token to retrieve the next set of results.

    

  
  
  :rtype: 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 to which the recommendation applies.

            
          

          - **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**
  
  *   :py:class:`CostOptimizationHub.Client.exceptions.ValidationException`

  
  *   :py:class:`CostOptimizationHub.Client.exceptions.InternalServerException`

  
  *   :py:class:`CostOptimizationHub.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CostOptimizationHub.Client.exceptions.ThrottlingException`

  