:doc:`Inspector2 <../../inspector2>` / Client / batch_get_account_status

************************
batch_get_account_status
************************



.. py:method:: Inspector2.Client.batch_get_account_status(**kwargs)

  

  Retrieves the Amazon Inspector status of multiple Amazon Web Services accounts within your environment.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/inspector2-2020-06-08/BatchGetAccountStatus>`_  


  **Request Syntax**
  ::

    response = client.batch_get_account_status(
        accountIds=[
            'string',
        ]
    )
    
  :type accountIds: list
  :param accountIds: 

    The 12-digit Amazon Web Services account IDs of the accounts to retrieve Amazon Inspector status for.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'accounts': [
              {
                  'accountId': 'string',
                  'state': {
                      'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                      'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                      'errorMessage': 'string'
                  },
                  'resourceState': {
                      'ec2': {
                          'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                          'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                          'errorMessage': 'string'
                      },
                      'ecr': {
                          'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                          'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                          'errorMessage': 'string'
                      },
                      'lambda': {
                          'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                          'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                          'errorMessage': 'string'
                      },
                      'lambdaCode': {
                          'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                          'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                          'errorMessage': 'string'
                      },
                      'codeRepository': {
                          'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                          'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                          'errorMessage': 'string'
                      }
                  }
              },
          ],
          'failedAccounts': [
              {
                  'accountId': 'string',
                  'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                  'resourceStatus': {
                      'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                      'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                      'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                      'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                      'codeRepository': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                  },
                  'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED'|'BLOCKED_BY_ORGANIZATION_POLICY',
                  'errorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **accounts** *(list) --* 

        An array of objects that provide details on the status of Amazon Inspector for each of the requested accounts.

        
        

        - *(dict) --* 

          An object with details the status of an Amazon Web Services account within your Amazon Inspector environment.

          
          

          - **accountId** *(string) --* 

            The Amazon Web Services account ID.

            
          

          - **state** *(dict) --* 

            An object detailing the status of Amazon Inspector for the account.

            
            

            - **status** *(string) --* 

              The status of Amazon Inspector for the account.

              
            

            - **errorCode** *(string) --* 

              The error code explaining why the account failed to enable Amazon Inspector.

              
            

            - **errorMessage** *(string) --* 

              The error message received when the account failed to enable Amazon Inspector.

              
        
          

          - **resourceState** *(dict) --* 

            An object detailing which resources Amazon Inspector is enabled to scan for the account.

            
            

            - **ec2** *(dict) --* 

              An object detailing the state of Amazon Inspector scanning for Amazon EC2 resources.

              
              

              - **status** *(string) --* 

                The status of Amazon Inspector for the account.

                
              

              - **errorCode** *(string) --* 

                The error code explaining why the account failed to enable Amazon Inspector.

                
              

              - **errorMessage** *(string) --* 

                The error message received when the account failed to enable Amazon Inspector.

                
          
            

            - **ecr** *(dict) --* 

              An object detailing the state of Amazon Inspector scanning for Amazon ECR resources.

              
              

              - **status** *(string) --* 

                The status of Amazon Inspector for the account.

                
              

              - **errorCode** *(string) --* 

                The error code explaining why the account failed to enable Amazon Inspector.

                
              

              - **errorMessage** *(string) --* 

                The error message received when the account failed to enable Amazon Inspector.

                
          
            

            - **lambda** *(dict) --* 

              An object that described the state of Amazon Inspector scans for an account.

              
              

              - **status** *(string) --* 

                The status of Amazon Inspector for the account.

                
              

              - **errorCode** *(string) --* 

                The error code explaining why the account failed to enable Amazon Inspector.

                
              

              - **errorMessage** *(string) --* 

                The error message received when the account failed to enable Amazon Inspector.

                
          
            

            - **lambdaCode** *(dict) --* 

              An object that described the state of Amazon Inspector scans for an account.

              
              

              - **status** *(string) --* 

                The status of Amazon Inspector for the account.

                
              

              - **errorCode** *(string) --* 

                The error code explaining why the account failed to enable Amazon Inspector.

                
              

              - **errorMessage** *(string) --* 

                The error message received when the account failed to enable Amazon Inspector.

                
          
            

            - **codeRepository** *(dict) --* 

              An object that described the state of Amazon Inspector scans for an account.

              
              

              - **status** *(string) --* 

                The status of Amazon Inspector for the account.

                
              

              - **errorCode** *(string) --* 

                The error code explaining why the account failed to enable Amazon Inspector.

                
              

              - **errorMessage** *(string) --* 

                The error message received when the account failed to enable Amazon Inspector.

                
          
        
      
    
      

      - **failedAccounts** *(list) --* 

        An array of objects detailing any accounts that failed to enable Amazon Inspector and why.

        
        

        - *(dict) --* 

          An object with details on why an account failed to enable Amazon Inspector.

          
          

          - **accountId** *(string) --* 

            The Amazon Web Services account ID.

            
          

          - **status** *(string) --* 

            The status of Amazon Inspector for the account.

            
          

          - **resourceStatus** *(dict) --* 

            An object detailing which resources Amazon Inspector is enabled to scan for the account.

            
            

            - **ec2** *(string) --* 

              The status of Amazon Inspector scanning for Amazon EC2 resources.

              
            

            - **ecr** *(string) --* 

              The status of Amazon Inspector scanning for Amazon ECR resources.

              
            

            - **lambda** *(string) --* 

              The status of Amazon Inspector scanning for Amazon Web Services Lambda function.

              
            

            - **lambdaCode** *(string) --* 

              The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

              
            

            - **codeRepository** *(string) --* 

              The status of Amazon Inspector scanning for code repositories.

              
        
          

          - **errorCode** *(string) --* 

            The error code explaining why the account failed to enable Amazon Inspector.

            
          

          - **errorMessage** *(string) --* 

            The error message received when the account failed to enable Amazon Inspector.

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

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

  
  *   :py:class:`Inspector2.Client.exceptions.ResourceNotFoundException`

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

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

  