- 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.
CreateScheduledAuditCommand
Creates a scheduled audit that is run at a specified time interval.
Requires permission to access the CreateScheduledAudit action.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { IoTClient, CreateScheduledAuditCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, CreateScheduledAuditCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // CreateScheduledAuditRequest
frequency: "DAILY" || "WEEKLY" || "BIWEEKLY" || "MONTHLY", // required
dayOfMonth: "STRING_VALUE",
dayOfWeek: "SUN" || "MON" || "TUE" || "WED" || "THU" || "FRI" || "SAT",
targetCheckNames: [ // TargetAuditCheckNames // required
"STRING_VALUE",
],
scheduledAuditName: "STRING_VALUE", // required
tags: [ // TagList
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE",
},
],
};
const command = new CreateScheduledAuditCommand(input);
const response = await client.send(command);
// { // CreateScheduledAuditResponse
// scheduledAuditArn: "STRING_VALUE",
// };
CreateScheduledAuditCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
frequency Required | AuditFrequency | undefined | How often the scheduled audit takes place, either |
scheduledAuditName Required | string | undefined | The name you want to give to the scheduled audit. (Max. 128 chars) |
targetCheckNames Required | string[] | undefined | Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use |
dayOfMonth | string | undefined | The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to |
dayOfWeek | DayOfWeek | undefined | The day of the week on which the scheduled audit takes place, either |
tags | Tag[] | undefined | Metadata that can be used to manage the scheduled audit. |
CreateScheduledAuditCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
scheduledAuditArn | string | undefined | The ARN of the scheduled audit. |
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. |
ResourceAlreadyExistsException | client | The resource already exists. |
ThrottlingException | client | The rate exceeds the limit. |
IoTServiceException | Base exception class for all service exceptions from IoT service. |