Inspector2 / Client / batch_get_account_status

batch_get_account_status#

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

Request Syntax

response = client.batch_get_account_status(
    accountIds=[
        'string',
    ]
)
Parameters:

accountIds (list) –

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

  • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'resourceState': {
                'ec2': {
                    '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',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                },
                'ecr': {
                    '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',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                },
                'lambda': {
                    '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',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                }
            },
            'state': {
                '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',
                'errorMessage': 'string',
                'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            }
        },
    ],
    'failedAccounts': [
        {
            'accountId': 'string',
            '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',
            'errorMessage': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ]
}

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.

        • 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.

            • 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.

            • status (string) –

              The status of Amazon Inspector for the account.

          • ecr (dict) –

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

            • 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.

            • status (string) –

              The status of Amazon Inspector for the account.

          • lambda (dict) –

            An object that described the state of Amazon Inspector scans for an 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.

            • status (string) –

              The status of Amazon Inspector for the account.

        • state (dict) –

          An object detailing 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.

          • status (string) –

            The status of Amazon Inspector for the account.

    • 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.

        • 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.

        • 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 AWS Lambda function resources.

        • status (string) –

          The status of Amazon Inspector for the account.

Exceptions

  • Inspector2.Client.exceptions.ValidationException

  • Inspector2.Client.exceptions.AccessDeniedException

  • Inspector2.Client.exceptions.ResourceNotFoundException

  • Inspector2.Client.exceptions.ThrottlingException

  • Inspector2.Client.exceptions.InternalServerException