describe_assessment_runs
(**kwargs)¶Describes the assessment runs that are specified by the ARNs of the assessment runs.
See also: AWS API Documentation
Request Syntax
response = client.describe_assessment_runs(
assessmentRunArns=[
'string',
]
)
[REQUIRED]
The ARN that specifies the assessment run that you want to describe.
{
'assessmentRuns': [
{
'arn': 'string',
'name': 'string',
'assessmentTemplateArn': 'string',
'state': 'CREATED'|'START_DATA_COLLECTION_PENDING'|'START_DATA_COLLECTION_IN_PROGRESS'|'COLLECTING_DATA'|'STOP_DATA_COLLECTION_PENDING'|'DATA_COLLECTED'|'START_EVALUATING_RULES_PENDING'|'EVALUATING_RULES'|'FAILED'|'ERROR'|'COMPLETED'|'COMPLETED_WITH_ERRORS'|'CANCELED',
'durationInSeconds': 123,
'rulesPackageArns': [
'string',
],
'userAttributesForFindings': [
{
'key': 'string',
'value': 'string'
},
],
'createdAt': datetime(2015, 1, 1),
'startedAt': datetime(2015, 1, 1),
'completedAt': datetime(2015, 1, 1),
'stateChangedAt': datetime(2015, 1, 1),
'dataCollected': True|False,
'stateChanges': [
{
'stateChangedAt': datetime(2015, 1, 1),
'state': 'CREATED'|'START_DATA_COLLECTION_PENDING'|'START_DATA_COLLECTION_IN_PROGRESS'|'COLLECTING_DATA'|'STOP_DATA_COLLECTION_PENDING'|'DATA_COLLECTED'|'START_EVALUATING_RULES_PENDING'|'EVALUATING_RULES'|'FAILED'|'ERROR'|'COMPLETED'|'COMPLETED_WITH_ERRORS'|'CANCELED'
},
],
'notifications': [
{
'date': datetime(2015, 1, 1),
'event': 'ASSESSMENT_RUN_STARTED'|'ASSESSMENT_RUN_COMPLETED'|'ASSESSMENT_RUN_STATE_CHANGED'|'FINDING_REPORTED'|'OTHER',
'message': 'string',
'error': True|False,
'snsTopicArn': 'string',
'snsPublishStatusCode': 'SUCCESS'|'TOPIC_DOES_NOT_EXIST'|'ACCESS_DENIED'|'INTERNAL_ERROR'
},
],
'findingCounts': {
'string': 123
}
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
Information about the assessment run.
A snapshot of an Amazon Inspector assessment run that contains the findings of the assessment run .
Used as the response element in the DescribeAssessmentRuns action.
The ARN of the assessment run.
The auto-generated name for the assessment run.
The ARN of the assessment template that is associated with the assessment run.
The state of the assessment run.
The duration of the assessment run.
The rules packages selected for the assessment run.
The user-defined attributes that are assigned to every generated finding.
This data type is used as a request parameter in the AddAttributesToFindings and CreateAssessmentTemplate actions.
The attribute key.
The value assigned to the attribute key.
The time when StartAssessmentRun was called.
The time when StartAssessmentRun was called.
The assessment run completion time that corresponds to the rules packages evaluation completion time or failure.
The last time when the assessment run's state changed.
A Boolean value (true or false) that specifies whether the process of collecting data from the agents is completed.
A list of the assessment run state changes.
Used as one of the elements of the AssessmentRun data type.
The last time the assessment run state changed.
The assessment run state.
A list of notifications for the event subscriptions. A notification about a particular generated finding is added to this list only once.
Used as one of the elements of the AssessmentRun data type.
The date of the notification.
The event for which a notification is sent.
The message included in the notification.
The Boolean value that specifies whether the notification represents an error.
The SNS topic to which the SNS notification is sent.
The status code of the SNS notification.
Provides a total count of generated findings per severity.
Assessment run details that cannot be described. An error code is provided for each failed item.
Includes details about the failed items.
The status code of a failed item.
Indicates whether you can immediately retry a request for this item for a specified resource.
Exceptions
Inspector.Client.exceptions.InternalException
Inspector.Client.exceptions.InvalidInputException
Examples
Describes the assessment runs that are specified by the ARNs of the assessment runs.
response = client.describe_assessment_runs(
assessmentRunArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
],
)
print(response)
Expected Output:
{
'assessmentRuns': [
{
'name': 'Run 1 for ExampleAssessmentTemplate',
'arn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
'assessmentTemplateArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw',
'completedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
'createdAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
'dataCollected': True,
'durationInSeconds': 3600,
'findingCounts': {
'High': 14,
'Informational': 0,
'Low': 0,
'Medium': 2,
'Undefined': 0,
},
'notifications': [
],
'rulesPackageArns': [
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP',
],
'startedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
'state': 'COMPLETED',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
'stateChanges': [
{
'state': 'CREATED',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'START_DATA_COLLECTION_PENDING',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'START_DATA_COLLECTION_IN_PROGRESS',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'COLLECTING_DATA',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'STOP_DATA_COLLECTION_PENDING',
'stateChangedAt': datetime(2016, 3, 22, 20, 57, 19, 1, 82, 0),
},
{
'state': 'DATA_COLLECTED',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 19, 1, 82, 0),
},
{
'state': 'EVALUATING_RULES',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 20, 1, 82, 0),
},
{
'state': 'COMPLETED',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
},
],
'userAttributesForFindings': [
],
},
],
'failedItems': {
},
'ResponseMetadata': {
'...': '...',
},
}