create_notification_rule
¶
create_notification_rule(
name: NotificationRuleName,
event_type_ids: EventTypeIds,
resource: NotificationRuleResource,
targets: Targets,
detail_type: DetailType,
*,
config_overrides: Optional[codestarnotificationsClientConfig] = None,
client_request_token: Optional[ClientRequestToken] = None,
tags: Optional[Tags] = None,
status: Optional[NotificationRuleStatus] = None,
) -> CreateNotificationRuleResult
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as Amazon Q Developer in chat applications topics or Amazon Q Developer in chat applications clients configured for Slack) where you want to receive them.
Parameters:
-
name(NotificationRuleName) –The name for the notification rule. Notification rule names must be unique in your Amazon Web Services account.
-
event_type_ids(EventTypeIds) –A list of event types associated with this notification rule. For a list of allowed events, see EventTypeSummary.
-
resource(NotificationRuleResource) –The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in CodePipeline, repositories in CodeCommit, and build projects in CodeBuild.
-
targets(Targets) –A list of Amazon Resource Names (ARNs) of Amazon Simple Notification Service topics and Amazon Q Developer in chat applications clients to associate with the notification rule.
-
detail_type(DetailType) –The level of detail to include in the notifications for this resource.
BASICwill include only the contents of the event as it would appear in Amazon CloudWatch.FULLwill include any supplemental information provided by CodeStar Notifications and/or the service for the resource for which the notification is created. -
client_request_token(Optional[ClientRequestToken], default:None) –A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request with the same parameters is received and a token is included, the request returns information about the initial request that used that token.
The Amazon Web Services SDKs prepopulate client request tokens. If you are using an Amazon Web Services SDK, an idempotency token is created for you.
-
tags(Optional[Tags], default:None) –A list of tags to apply to this notification rule. Key names cannot start with "
aws". -
status(Optional[NotificationRuleStatus], default:None) –The status of the notification rule. The default value is
ENABLED. If the status is set toDISABLED, notifications aren't sent for the notification rule.
Raises:
-
AccessDeniedException–CodeStar Notifications can't create the notification rule because you do not have sufficient permissions.
-
ConcurrentModificationException–CodeStar Notifications can't complete the request because the resource is being modified by another process. Wait a few minutes and try again.
-
ConfigurationException–Some or all of the configuration is incomplete, missing, or not valid.
-
LimitExceededException–One of the CodeStar Notifications limits has been exceeded. Limits apply to accounts, notification rules, notifications, resources, and targets. For more information, see Limits.
-
ResourceAlreadyExistsException–A resource with the same name or ID already exists. Notification rule names must be unique in your Amazon Web Services account.
-
ValidationException–One or more parameter values are not valid.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codestar_notifications/_services/codestarnotifications.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |