describe_audit_task

IoT.Client.describe_audit_task(**kwargs)

Gets information about a Device Defender audit.

Requires permission to access the DescribeAuditTask action.

See also: AWS API Documentation

Request Syntax

response = client.describe_audit_task(
    taskId='string'
)
Parameters
taskId (string) --

[REQUIRED]

The ID of the audit whose information you want to get.

Return type
dict
Returns
Response Syntax
{
    'taskStatus': 'IN_PROGRESS'|'COMPLETED'|'FAILED'|'CANCELED',
    'taskType': 'ON_DEMAND_AUDIT_TASK'|'SCHEDULED_AUDIT_TASK',
    'taskStartTime': datetime(2015, 1, 1),
    'taskStatistics': {
        'totalChecks': 123,
        'inProgressChecks': 123,
        'waitingForDataCollectionChecks': 123,
        'compliantChecks': 123,
        'nonCompliantChecks': 123,
        'failedChecks': 123,
        'canceledChecks': 123
    },
    'scheduledAuditName': 'string',
    'auditDetails': {
        'string': {
            'checkRunStatus': 'IN_PROGRESS'|'WAITING_FOR_DATA_COLLECTION'|'CANCELED'|'COMPLETED_COMPLIANT'|'COMPLETED_NON_COMPLIANT'|'FAILED',
            'checkCompliant': True|False,
            'totalResourcesCount': 123,
            'nonCompliantResourcesCount': 123,
            'suppressedNonCompliantResourcesCount': 123,
            'errorCode': 'string',
            'message': 'string'
        }
    }
}

Response Structure

  • (dict) --
    • taskStatus (string) --

      The status of the audit: one of "IN_PROGRESS", "COMPLETED", "FAILED", or "CANCELED".

    • taskType (string) --

      The type of audit: "ON_DEMAND_AUDIT_TASK" or "SCHEDULED_AUDIT_TASK".

    • taskStartTime (datetime) --

      The time the audit started.

    • taskStatistics (dict) --

      Statistical information about the audit.

      • totalChecks (integer) --

        The number of checks in this audit.

      • inProgressChecks (integer) --

        The number of checks in progress.

      • waitingForDataCollectionChecks (integer) --

        The number of checks waiting for data collection.

      • compliantChecks (integer) --

        The number of checks that found compliant resources.

      • nonCompliantChecks (integer) --

        The number of checks that found noncompliant resources.

      • failedChecks (integer) --

        The number of checks.

      • canceledChecks (integer) --

        The number of checks that did not run because the audit was canceled.

    • scheduledAuditName (string) --

      The name of the scheduled audit (only if the audit was a scheduled audit).

    • auditDetails (dict) --

      Detailed information about each check performed during this audit.

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

        • (dict) --

          Information about the audit check.

          • checkRunStatus (string) --

            The completion status of this check. One of "IN_PROGRESS", "WAITING_FOR_DATA_COLLECTION", "CANCELED", "COMPLETED_COMPLIANT", "COMPLETED_NON_COMPLIANT", or "FAILED".

          • checkCompliant (boolean) --

            True if the check is complete and found all resources compliant.

          • totalResourcesCount (integer) --

            The number of resources on which the check was performed.

          • nonCompliantResourcesCount (integer) --

            The number of resources that were found noncompliant during the check.

          • suppressedNonCompliantResourcesCount (integer) --

            Describes how many of the non-compliant resources created during the evaluation of an audit check were marked as suppressed.

          • errorCode (string) --

            The code of any error encountered when this check is performed during this audit. One of "INSUFFICIENT_PERMISSIONS" or "AUDIT_CHECK_DISABLED".

          • message (string) --

            The message associated with any error encountered when this check is performed during this audit.

Exceptions

  • IoT.Client.exceptions.InvalidRequestException
  • IoT.Client.exceptions.ResourceNotFoundException
  • IoT.Client.exceptions.ThrottlingException
  • IoT.Client.exceptions.InternalFailureException