:doc:`IoT <../../iot>` / Client / start_on_demand_audit_task

**************************
start_on_demand_audit_task
**************************



.. py:method:: IoT.Client.start_on_demand_audit_task(**kwargs)

  

  Starts an on-demand Device Defender audit.

   

  Requires permission to access the `StartOnDemandAuditTask <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartOnDemandAuditTask>`_  


  **Request Syntax**
  ::

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

    Which checks are performed during the audit. The checks you specify must be enabled for your account or an exception occurs. Use ``DescribeAccountAuditConfiguration`` to see the list of all checks, including those that are enabled or ``UpdateAccountAuditConfiguration`` to select which checks are enabled.

    

  
    - *(string) --* 

      An audit check name. Checks must be enabled for your account. (Use ``DescribeAccountAuditConfiguration`` to see the list of all checks, including those that are enabled or use ``UpdateAccountAuditConfiguration`` to select which checks are enabled.)

      

    

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

    
    ::

      {
          'taskId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **taskId** *(string) --* 

        The ID of the on-demand audit you started.

        
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

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

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  
  *   :py:class:`IoT.Client.exceptions.LimitExceededException`

  