:doc:`EC2 <../../ec2>` / Client / get_groups_for_capacity_reservation

***********************************
get_groups_for_capacity_reservation
***********************************



.. py:method:: EC2.Client.get_groups_for_capacity_reservation(**kwargs)

  

  Lists the resource groups to which a Capacity Reservation has been added.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetGroupsForCapacityReservation>`_  


  **Request Syntax**
  ::

    response = client.get_groups_for_capacity_reservation(
        CapacityReservationId='string',
        NextToken='string',
        MaxResults=123,
        DryRun=True|False
    )
    
  :type CapacityReservationId: string
  :param CapacityReservationId: **[REQUIRED]** 

    The ID of the Capacity Reservation. If you specify a Capacity Reservation that is shared with you, the operation returns only Capacity Reservation groups that you own.

    

  
  :type NextToken: string
  :param NextToken: 

    The token to use to retrieve the next page of results.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see `Pagination <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination>`__.

    

  
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'NextToken': 'string',
          'CapacityReservationGroups': [
              {
                  'GroupArn': 'string',
                  'OwnerId': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **NextToken** *(string) --* 

        The token to use to retrieve the next page of results. This value is ``null`` when there are no more results to return.

        
      

      - **CapacityReservationGroups** *(list) --* 

        Information about the resource groups to which the Capacity Reservation has been added.

        
        

        - *(dict) --* 

          Describes a resource group to which a Capacity Reservation has been added.

          
          

          - **GroupArn** *(string) --* 

            The ARN of the resource group.

            
          

          - **OwnerId** *(string) --* 

            The ID of the Amazon Web Services account that owns the resource group.

            
      
    
  