查看通知规则 - 开发工具控制台

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

查看通知规则

您可以使用开发工具控制台或 AWS CLI 查看 AWS 区域中所有资源的所有通知规则。您还可以查看每个通知规则的详细信息。与创建通知规则的过程不同,您不必转到资源的资源页面。

查看通知规则(控制台)

  1. 打开 https://console.aws.amazon.com/codesuite/settings/notifications 上的 AWS 开发工具控制台。

  2. 在导航栏中,展开设置,然后选择通知规则

  3. Notification rules(通知规则)中,查看为您当前登录的 AWS 区域的 AWS 账户中的资源配置的规则列表。使用选择器更改 AWS 区域。

  4. 要查看一个通知规则的详细信息,请从列表中选择该规则,然后选择 View details (查看详细信息)。您也可以仅在列表中选择其名称。

查看通知规则列表 (AWS CLI)

  1. 在终端或命令提示符处,运行 list-notification-rules 命令可查看指定的 AWS 区域的所有通知规则。

    aws codestar-notifications list-notification-rules --region us-east-1
  2. 如果成功,此命令将为 AWS 区域中的每个通知规则返回 ID 和 ARN,类似于以下内容。

    { "NotificationRules": [ { "Id": "dc82df7a-EXAMPLE", "Arn": "arn:aws:codestar-notifications:us-east-1:123456789012:notificationrule/dc82df7a-EXAMPLE" }, { "Id": "8d1f0983-EXAMPLE", "Arn": "arn:aws:codestar-notifications:us-east-1:123456789012:notificationrule/8d1f0983-EXAMPLE" } ] }

查看通知规则的详细信息 (AWS CLI)

  1. 在终端或命令提示符处,运行 describe-notification-rule 命令,并指定通知规则的 ARN。

    aws codestar-notifications describe-notification-rule --arn arn:aws:codestar-notifications:us-east-1:123456789012:notificationrule/dc82df7a-EXAMPLE
  2. 如果成功,该命令将返回类似于以下内容的输出。

    { "LastModifiedTimestamp": 1569199844.857, "EventTypes": [ { "ServiceName": "CodeCommit", "EventTypeName": "Branches and tags: Created", "ResourceType": "Repository", "EventTypeId": "codecommit-repository-branches-and-tags-created" } ], "Status": "ENABLED", "DetailType": "FULL", "Resource": "arn:aws:codecommit:us-east-1:123456789012:MyDemoRepo", "Arn": "arn:aws:codestar-notifications:us-east-1:123456789012:notificationrule/dc82df7a-EXAMPLE", "Targets": [ { "TargetStatus": "ACTIVE", "TargetAddress": "arn:aws:sns:us-east-1:123456789012:MyNotificationTopic", "TargetType": "SNS" } ], "Name": "MyNotificationRule", "CreatedTimestamp": 1569199844.857, "CreatedBy": "arn:aws:iam::123456789012:user/Mary_Major" }

查看通知规则的标签列表 (AWS CLI)

  1. 在终端或命令提示符处,运行 list-tags-for-resource 命令可查看指定通知规则 ARN 的所有标签。

    aws codestar-notifications list-tags-for-resource --arn arn:aws:codestar-notifications:us-east-1:123456789012:notificationrule/fe1efd35-EXAMPLE
  2. 如果成功,该命令返回类似以下内容的输出。

    { "Tags": { "Team": "Li_Juan" } }