Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class CreateNotificationRuleCommandProtected

Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as Chatbot topics or Chatbot clients configured for Slack) where you want to receive them.

Example

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

import { CodestarNotificationsClient, CreateNotificationRuleCommand } from "@aws-sdk/client-codestar-notifications"; // ES Modules import
// const { CodestarNotificationsClient, CreateNotificationRuleCommand } = require("@aws-sdk/client-codestar-notifications"); // CommonJS import
const client = new CodestarNotificationsClient(config);
const input = { // CreateNotificationRuleRequest
Name: "STRING_VALUE", // required
EventTypeIds: [ // EventTypeIds // required
"STRING_VALUE",
],
Resource: "STRING_VALUE", // required
Targets: [ // Targets // required
{ // Target
TargetType: "STRING_VALUE",
TargetAddress: "STRING_VALUE",
},
],
DetailType: "BASIC" || "FULL", // required
ClientRequestToken: "STRING_VALUE",
Tags: { // Tags
"<keys>": "STRING_VALUE",
},
Status: "ENABLED" || "DISABLED",
};
const command = new CreateNotificationRuleCommand(input);
const response = await client.send(command);
// { // CreateNotificationRuleResult
// Arn: "STRING_VALUE",
// };

Param

CreateNotificationRuleCommandInput

Returns

CreateNotificationRuleCommandOutput

See

Throws

AccessDeniedException (client fault)

AWS CodeStar Notifications can't create the notification rule because you do not have sufficient permissions.

Throws

ConcurrentModificationException (client fault)

AWS CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.

Throws

ConfigurationException (client fault)

Some or all of the configuration is incomplete, missing, or not valid.

Throws

LimitExceededException (client fault)

One of the AWS CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.

Throws

ResourceAlreadyExistsException (client fault)

A resource with the same name or ID already exists. Notification rule names must be unique in your Amazon Web Services account.

Throws

ValidationException (client fault)

One or more parameter values are not valid.

Throws

CodestarNotificationsServiceException

Base exception class for all service exceptions from CodestarNotifications service.

Hierarchy

Constructors

Properties

Methods