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

**********************************
cancel_capacity_reservation_fleets
**********************************



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

  

  Cancels one or more Capacity Reservation Fleets. When you cancel a Capacity Reservation Fleet, the following happens:

   

  
  * The Capacity Reservation Fleet's status changes to ``cancelled``.
   
  * The individual Capacity Reservations in the Fleet are cancelled. Instances running in the Capacity Reservations at the time of cancelling the Fleet continue to run in shared capacity.
   
  * The Fleet stops creating new Capacity Reservations.
  

  

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


  **Request Syntax**
  ::

    response = client.cancel_capacity_reservation_fleets(
        DryRun=True|False,
        CapacityReservationFleetIds=[
            'string',
        ]
    )
    
  :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``.

    

  
  :type CapacityReservationFleetIds: list
  :param CapacityReservationFleetIds: **[REQUIRED]** 

    The IDs of the Capacity Reservation Fleets to cancel.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'SuccessfulFleetCancellations': [
              {
                  'CurrentFleetState': 'submitted'|'modifying'|'active'|'partially_fulfilled'|'expiring'|'expired'|'cancelling'|'cancelled'|'failed',
                  'PreviousFleetState': 'submitted'|'modifying'|'active'|'partially_fulfilled'|'expiring'|'expired'|'cancelling'|'cancelled'|'failed',
                  'CapacityReservationFleetId': 'string'
              },
          ],
          'FailedFleetCancellations': [
              {
                  'CapacityReservationFleetId': 'string',
                  'CancelCapacityReservationFleetError': {
                      'Code': 'string',
                      'Message': 'string'
                  }
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SuccessfulFleetCancellations** *(list) --* 

        Information about the Capacity Reservation Fleets that were successfully cancelled.

        
        

        - *(dict) --* 

          Describes a Capacity Reservation Fleet that was successfully cancelled.

          
          

          - **CurrentFleetState** *(string) --* 

            The current state of the Capacity Reservation Fleet.

            
          

          - **PreviousFleetState** *(string) --* 

            The previous state of the Capacity Reservation Fleet.

            
          

          - **CapacityReservationFleetId** *(string) --* 

            The ID of the Capacity Reservation Fleet that was successfully cancelled.

            
      
    
      

      - **FailedFleetCancellations** *(list) --* 

        Information about the Capacity Reservation Fleets that could not be cancelled.

        
        

        - *(dict) --* 

          Describes a Capacity Reservation Fleet that could not be cancelled.

          
          

          - **CapacityReservationFleetId** *(string) --* 

            The ID of the Capacity Reservation Fleet that could not be cancelled.

            
          

          - **CancelCapacityReservationFleetError** *(dict) --* 

            Information about the Capacity Reservation Fleet cancellation error.

            
            

            - **Code** *(string) --* 

              The error code.

              
            

            - **Message** *(string) --* 

              The error message.

              
        
      
    
  