- 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.
EnableInsightRulesCommand
Enables the specified Contributor Insights rules. When rules are enabled, they immediately begin analyzing log data.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudWatchClient, EnableInsightRulesCommand } from "@aws-sdk/client-cloudwatch"; // ES Modules import
// const { CloudWatchClient, EnableInsightRulesCommand } = require("@aws-sdk/client-cloudwatch"); // CommonJS import
const client = new CloudWatchClient(config);
const input = { // EnableInsightRulesInput
RuleNames: [ // InsightRuleNames // required
"STRING_VALUE",
],
};
const command = new EnableInsightRulesCommand(input);
const response = await client.send(command);
// { // EnableInsightRulesOutput
// Failures: [ // BatchFailures
// { // PartialFailure
// FailureResource: "STRING_VALUE",
// ExceptionType: "STRING_VALUE",
// FailureCode: "STRING_VALUE",
// FailureDescription: "STRING_VALUE",
// },
// ],
// };
EnableInsightRulesCommand Input
See EnableInsightRulesCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
RuleNames Required | string[] | undefined | An array of the rule names to enable. If you need to find out the names of your rules, use DescribeInsightRules . |
EnableInsightRulesCommand Output
See EnableInsightRulesCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Failures | PartialFailure[] | undefined | An array listing the rules that could not be enabled. You cannot disable or enable built-in rules. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidParameterValueException | client | The value of an input parameter is bad or out-of-range. |
LimitExceededException | client | The operation exceeded one or more limits. |
MissingRequiredParameterException | client | An input parameter that is required is missing. |
CloudWatchServiceException | Base exception class for all service exceptions from CloudWatch service. |