:doc:`Outposts <../../outposts>` / Client / get_capacity_task

*****************
get_capacity_task
*****************



.. py:method:: Outposts.Client.get_capacity_task(**kwargs)

  

  Gets details of the specified capacity task.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/outposts-2019-12-03/GetCapacityTask>`_  


  **Request Syntax**
  ::

    response = client.get_capacity_task(
        CapacityTaskId='string',
        OutpostIdentifier='string'
    )
    
  :type CapacityTaskId: string
  :param CapacityTaskId: **[REQUIRED]** 

    ID of the capacity task.

    

  
  :type OutpostIdentifier: string
  :param OutpostIdentifier: **[REQUIRED]** 

    ID or ARN of the Outpost associated with the specified capacity task.

    

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

    
    ::

      {
          'CapacityTaskId': 'string',
          'OutpostId': 'string',
          'OrderId': 'string',
          'AssetId': 'string',
          'RequestedInstancePools': [
              {
                  'InstanceType': 'string',
                  'Count': 123
              },
          ],
          'InstancesToExclude': {
              'Instances': [
                  'string',
              ],
              'AccountIds': [
                  'string',
              ],
              'Services': [
                  'AWS'|'EC2'|'ELASTICACHE'|'ELB'|'RDS'|'ROUTE53',
              ]
          },
          'DryRun': True|False,
          'CapacityTaskStatus': 'REQUESTED'|'IN_PROGRESS'|'FAILED'|'COMPLETED'|'WAITING_FOR_EVACUATION'|'CANCELLATION_IN_PROGRESS'|'CANCELLED',
          'Failed': {
              'Reason': 'string',
              'Type': 'UNSUPPORTED_CAPACITY_CONFIGURATION'|'UNEXPECTED_ASSET_STATE'|'BLOCKING_INSTANCES_NOT_EVACUATED'|'INTERNAL_SERVER_ERROR'|'RESOURCE_NOT_FOUND'
          },
          'CreationDate': datetime(2015, 1, 1),
          'CompletionDate': datetime(2015, 1, 1),
          'LastModifiedDate': datetime(2015, 1, 1),
          'TaskActionOnBlockingInstances': 'WAIT_FOR_EVACUATION'|'FAIL_TASK'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **CapacityTaskId** *(string) --* 

        ID of the capacity task.

        
      

      - **OutpostId** *(string) --* 

        ID of the Outpost associated with the specified capacity task.

        
      

      - **OrderId** *(string) --* 

        ID of the Amazon Web Services Outposts order associated with the specified capacity task.

        
      

      - **AssetId** *(string) --* 

        The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.

        
      

      - **RequestedInstancePools** *(list) --* 

        List of instance pools requested in the capacity task.

        
        

        - *(dict) --* 

          The instance type that you specify determines the combination of CPU, memory, storage, and networking capacity.

          
          

          - **InstanceType** *(string) --* 

            The instance type of the hosts.

            
          

          - **Count** *(integer) --* 

            The number of instances for the specified instance type.

            
      
    
      

      - **InstancesToExclude** *(dict) --* 

        Instances that the user specified they cannot stop in order to free up the capacity needed to run the capacity task.

        
        

        - **Instances** *(list) --* 

          List of user-specified instances that must not be stopped.

          
          

          - *(string) --* 
      
        

        - **AccountIds** *(list) --* 

          IDs of the accounts that own each instance that must not be stopped.

          
          

          - *(string) --* 

            The ID of the Amazon Web Services account.

            
      
        

        - **Services** *(list) --* 

          Names of the services that own each instance that must not be stopped in order to free up the capacity needed to run the capacity task.

          
          

          - *(string) --* 
      
    
      

      - **DryRun** *(boolean) --* 

        Performs a dry run to determine if you are above or below instance capacity.

        
      

      - **CapacityTaskStatus** *(string) --* 

        Status of the capacity task.

         

        A capacity task can have one of the following statuses:

         

        
        * ``REQUESTED`` - The capacity task was created and is awaiting the next step by Amazon Web Services Outposts.
         
        * ``IN_PROGRESS`` - The capacity task is running and cannot be cancelled.
         
        * ``FAILED`` - The capacity task could not be completed.
         
        * ``COMPLETED`` - The capacity task has completed successfully.
         
        * ``WAITING_FOR_EVACUATION`` - The capacity task requires capacity to run. You must stop the recommended EC2 running instances to free up capacity for the task to run.
         
        * ``CANCELLATION_IN_PROGRESS`` - The capacity task has been cancelled and is in the process of cleaning up resources.
         
        * ``CANCELLED`` - The capacity task is cancelled.
        

        
      

      - **Failed** *(dict) --* 

        Reason why the capacity task failed.

        
        

        - **Reason** *(string) --* 

          The reason that the specified capacity task failed.

          
        

        - **Type** *(string) --* 

          The type of failure.

          
    
      

      - **CreationDate** *(datetime) --* 

        The date the capacity task was created.

        
      

      - **CompletionDate** *(datetime) --* 

        The date the capacity task ran successfully.

        
      

      - **LastModifiedDate** *(datetime) --* 

        The date the capacity task was last modified.

        
      

      - **TaskActionOnBlockingInstances** *(string) --* 

        User-specified option in case an instance is blocking the capacity task from running. Shows one of the following options:

         

        
        * ``WAIT_FOR_EVACUATION`` - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.
         
        * ``FAIL_TASK`` - The capacity task fails.
        

        
  
  **Exceptions**
  
  *   :py:class:`Outposts.Client.exceptions.ValidationException`

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

  
  *   :py:class:`Outposts.Client.exceptions.NotFoundException`

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

  