StartOnDemandAuditTaskCommand

Starts an on-demand Device Defender audit.

Requires permission to access the StartOnDemandAuditTask  action.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { IoTClient, StartOnDemandAuditTaskCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, StartOnDemandAuditTaskCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // StartOnDemandAuditTaskRequest
  targetCheckNames: [ // TargetAuditCheckNames // required
    "STRING_VALUE",
  ],
};
const command = new StartOnDemandAuditTaskCommand(input);
const response = await client.send(command);
// { // StartOnDemandAuditTaskResponse
//   taskId: "STRING_VALUE",
// };

StartOnDemandAuditTaskCommand Input

Parameter
Type
Description
targetCheckNames
Required
string[] | undefined

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.

StartOnDemandAuditTaskCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
taskId
string | undefined

The ID of the on-demand audit you started.

Throws

Name
Fault
Details
InternalFailureException
server

An unexpected error has occurred.

InvalidRequestException
client

The request is not valid.

LimitExceededException
client

A limit has been exceeded.

ThrottlingException
client

The rate exceeds the limit.

IoTServiceException
Base exception class for all service exceptions from IoT service.