:doc:`Inspector <../../inspector>` / Client / describe_assessment_runs

************************
describe_assessment_runs
************************



.. py:method:: Inspector.Client.describe_assessment_runs(**kwargs)

  

  Describes the assessment runs that are specified by the ARNs of the assessment runs.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRuns>`_  


  **Request Syntax**
  ::

    response = client.describe_assessment_runs(
        assessmentRunArns=[
            'string',
        ]
    )
    
  :type assessmentRunArns: list
  :param assessmentRunArns: **[REQUIRED]** 

    The ARN that specifies the assessment run that you want to describe.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          '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**

    

    - *(dict) --* 
      

      - **assessmentRuns** *(list) --* 

        Information about the assessment run.

        
        

        - *(dict) --* 

          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.

          
          

          - **arn** *(string) --* 

            The ARN of the assessment run.

            
          

          - **name** *(string) --* 

            The auto-generated name for the assessment run.

            
          

          - **assessmentTemplateArn** *(string) --* 

            The ARN of the assessment template that is associated with the assessment run.

            
          

          - **state** *(string) --* 

            The state of the assessment run.

            
          

          - **durationInSeconds** *(integer) --* 

            The duration of the assessment run.

            
          

          - **rulesPackageArns** *(list) --* 

            The rules packages selected for the assessment run.

            
            

            - *(string) --* 
        
          

          - **userAttributesForFindings** *(list) --* 

            The user-defined attributes that are assigned to every generated finding.

            
            

            - *(dict) --* 

              This data type is used as a request parameter in the  AddAttributesToFindings and  CreateAssessmentTemplate actions.

              
              

              - **key** *(string) --* 

                The attribute key.

                
              

              - **value** *(string) --* 

                The value assigned to the attribute key.

                
          
        
          

          - **createdAt** *(datetime) --* 

            The time when  StartAssessmentRun was called.

            
          

          - **startedAt** *(datetime) --* 

            The time when  StartAssessmentRun was called.

            
          

          - **completedAt** *(datetime) --* 

            The assessment run completion time that corresponds to the rules packages evaluation completion time or failure.

            
          

          - **stateChangedAt** *(datetime) --* 

            The last time when the assessment run's state changed.

            
          

          - **dataCollected** *(boolean) --* 

            A Boolean value (true or false) that specifies whether the process of collecting data from the agents is completed.

            
          

          - **stateChanges** *(list) --* 

            A list of the assessment run state changes.

            
            

            - *(dict) --* 

              Used as one of the elements of the  AssessmentRun data type.

              
              

              - **stateChangedAt** *(datetime) --* 

                The last time the assessment run state changed.

                
              

              - **state** *(string) --* 

                The assessment run state.

                
          
        
          

          - **notifications** *(list) --* 

            A list of notifications for the event subscriptions. A notification about a particular generated finding is added to this list only once.

            
            

            - *(dict) --* 

              Used as one of the elements of the  AssessmentRun data type.

              
              

              - **date** *(datetime) --* 

                The date of the notification.

                
              

              - **event** *(string) --* 

                The event for which a notification is sent.

                
              

              - **message** *(string) --* 

                The message included in the notification.

                
              

              - **error** *(boolean) --* 

                The Boolean value that specifies whether the notification represents an error.

                
              

              - **snsTopicArn** *(string) --* 

                The SNS topic to which the SNS notification is sent.

                
              

              - **snsPublishStatusCode** *(string) --* 

                The status code of the SNS notification.

                
          
        
          

          - **findingCounts** *(dict) --* 

            Provides a total count of generated findings per severity.

            
            

            - *(string) --* 
              

              - *(integer) --* 
        
      
      
    
      

      - **failedItems** *(dict) --* 

        Assessment run details that cannot be described. An error code is provided for each failed item.

        
        

        - *(string) --* 
          

          - *(dict) --* 

            Includes details about the failed items.

            
            

            - **failureCode** *(string) --* 

              The status code of a failed item.

              
            

            - **retryable** *(boolean) --* 

              Indicates whether you can immediately retry a request for this item for a specified resource.

              
        
    
  
  
  **Exceptions**
  
  *   :py:class:`Inspector.Client.exceptions.InternalException`

  
  *   :py:class:`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': {
            '...': '...',
        },
    }

  