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',
]
)
The 12-digit Amazon Web Services account IDs of the accounts to retrieve Amazon Inspector status for.
{
'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
An array of objects that provide details on the status of Amazon Inspector for each of the requested accounts.
An object with details the status of an Amazon Web Services account within your Amazon Inspector environment.
The Amazon Web Services account ID.
An object detailing which resources Amazon Inspector is enabled to scan for the account.
An object detailing the state of Amazon Inspector scanning for Amazon EC2 resources.
The error code explaining why the account failed to enable Amazon Inspector.
The error message received when the account failed to enable Amazon Inspector.
The status of Amazon Inspector for the account.
An object detailing the state of Amazon Inspector scanning for Amazon ECR resources.
The error code explaining why the account failed to enable Amazon Inspector.
The error message received when the account failed to enable Amazon Inspector.
The status of Amazon Inspector for the account.
An object that described the state of Amazon Inspector scans for an account.
The error code explaining why the account failed to enable Amazon Inspector.
The error message received when the account failed to enable Amazon Inspector.
The status of Amazon Inspector for the account.
An object detailing the status of Amazon Inspector for the account.
The error code explaining why the account failed to enable Amazon Inspector.
The error message received when the account failed to enable Amazon Inspector.
The status of Amazon Inspector for the account.
An array of objects detailing any accounts that failed to enable Amazon Inspector and why.
An object with details on why an account failed to enable Amazon Inspector.
The Amazon Web Services account ID.
The error code explaining why the account failed to enable Amazon Inspector.
The error message received when the account failed to enable Amazon Inspector.
An object detailing which resources Amazon Inspector is enabled to scan for the account.
The status of Amazon Inspector scanning for Amazon EC2 resources.
The status of Amazon Inspector scanning for Amazon ECR resources.
The status of Amazon Inspector scanning for AWS Lambda function resources.
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