- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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
See StartOnDemandAuditTaskCommandInput for more details
Parameter | Type | Description |
---|
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 |
StartOnDemandAuditTaskCommand Output
See StartOnDemandAuditTaskCommandOutput for details
Parameter | Type | Description |
---|
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 |
---|
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. |