Skip to content

Adding CLI for Notifications and NotificationsContact #9279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions awscli/examples/notifications/associate-channel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**To associate a delivery channel**

The following ``associate-channel`` example associates a delivery channel with a particular NotificationConfiguration. ::

aws notifications associate-channel \
--arn arn:aws:notifications-contacts::123456789012:emailcontact/a01jjz5n8e8557aswvm1fv4wqrf \
--notification-configuration-arn arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb

This command produces no output.

For more information, see `Adding delivery channels in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/manage-delivery-channels.html>`__ in the *AWS User Notifications User Guide*.
24 changes: 24 additions & 0 deletions awscli/examples/notifications/create-event-rule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**To create an eventrule**

The following ``create-event-rule`` example creates an event rule associated with a specified NotificationConfiguration. ::

aws notifications create-event-rule \
--notification-configuration-arn arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb \
--source aws.health \
--event-type "AWS Health Event" \
--regions us-east-1

Output::

{
"arn": "arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb/rule/a01jjzkdcbfq2chvmramvnv28nm",
"notificationConfigurationArn": "arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb",
"statusSummaryByRegion": {
"us-east-1": {
"status": "CREATING",
"reason": ""
}
}
}

For more information, see `Creating your first notification configuration in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/getting-started.html>`__ in the *AWS User Notifications User Guide*.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**To create a notificationconfiguration**

The following ``create-notification-configuration`` example creates a NotificationConfiguration. ::

aws notifications create-notification-configuration \
--name testnotification-1 \
--aggregation-duration SHORT \
--description CLI-Demo

Output::

{
"arn": "arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb",
"status": "INACTIVE"
}

For more information, see `Adding delivery channels in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/manage-delivery-channels.html>`__ in the *AWS User Notifications User Guide*.
10 changes: 10 additions & 0 deletions awscli/examples/notifications/delete-event-rule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**To delete an eventrule**

The following ``delete-event-rule`` example deletes an EventRule associated to a specific NotificationConfiguration. ::

aws notifications delete-event-rule \
--arn arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb/rule/a01jjzkdcbfq2chvmramvnv28nm

This command produces no output.

For more information, see `Deleting notification configurations in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/delete-notifications.html>`__ in the *AWS User Notifications User Guide*.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**To delete a notificationconfiguration**

The following ``delete-notification-configuration`` example deletes a NotificationConfiguration. ::

aws notifications delete-notification-configuration \
--arn arn:aws:notifications::123456789012:configuration/a01jjzj251d2wxsss2wvtvxethb

This command produces no output.

For more information, see `Deleting notification configurations in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/delete-notifications.html>`__ in the *AWS User Notifications User Guide*.
17 changes: 17 additions & 0 deletions awscli/examples/notifications/deregister-notification-hub.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**To deregisters a notificationconfiguration**

The following ``deregister-notification-hub`` example deregisters a NotificationConfiguration in the specified Region. ::

aws notifications deregister-notification-hub --notification-hub-region us-west-2

Output::

{
"notificationHubRegion": "us-west-2",
"statusSummary": {
"status": "DEREGISTERING",
"reason": ""
}
}

For more information, see `Adding or removing a notification hub in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/nhr-add-remove.html>`__ in the *AWS User Notifications User Guide*.
11 changes: 11 additions & 0 deletions awscli/examples/notifications/disassociate-channel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**To disassociates a channel**

The following ``disassociate-channel`` example disassociates a Channel from a specified NotificationConfiguration. ::

aws notifications disassociate-channel \
--notification-configuration-arn arn:aws:notifications::123456789012:configuration/a01jjzhee9p37n8gc2ke1mr5zjx \
--arn arn:aws:chatbot::123456789012:chat-configuration/slack-channel/Slack-CW-Events-Integration

This command produces no output.

For more information, see `Editing notification configurations in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/edit-notifications.html>`__ in the *AWS User Notifications User Guide*.
29 changes: 29 additions & 0 deletions awscli/examples/notifications/get-event-rule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
**To view the details of a specified eventrule**

The following ``get-event-rule`` example display the details about a specific EventRule. ::

aws notifications get-event-rule \
--arn arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/rule/a01jg2z8ydvea0x0v3z8xkwjrrs

Output::

{
"arn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/rule/a01jg2z8ydvea0x0v3z8xkwjrrs",
"notificationConfigurationArn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"creationTime": "2024-10-27T02:31:35.611000+00:00",
"source": "aws.health",
"eventType": "AWS Health Event",
"eventPattern": "",
"regions": [
"us-east-1"
],
"managedRules": [
"arn:aws:events:us-east-1:123456789012:rule/AWSUserNotificationsManagedRule-aa1apyq"
],
"statusSummaryByRegion": {
"us-east-1": {
"status": "ACTIVE",
"reason": ""
}
}
}
17 changes: 17 additions & 0 deletions awscli/examples/notifications/get-notification-configuration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
**To view the details of a specified notificationconfiguration**

The following ``get-notification-configuration`` example displays the details about a specific NotificationConfiguration. ::

aws notifications get-notification-configuration \
--arn arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh

Output::

{
"arn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"name": "Health-quick-setup",
"description": "Health notifications created with quick setup",
"status": "ACTIVE",
"creationTime": "2024-10-27T02:31:34.987000+00:00",
"aggregationDuration": "SHORT"
}
87 changes: 87 additions & 0 deletions awscli/examples/notifications/get-notification-event.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
**To view the details of a specified notification event**

The following ``get-notification-event`` example displays a specific notification event. ::

aws notifications get-notification-event \
--arn arn:aws:notifications:us-east-1:123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/event/a01jjta9p8wvpgt281q0e10e457

Output::

{
"arn": "arn:aws:notifications:us-east-1:123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/event/a01jjta9p8wvpgt281q0e10e457",
"notificationConfigurationArn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"creationTime": "2024-11-30T00:38:09.948000+00:00",
"content": {
"schemaVersion": "v1.0",
"id": "a01jjta9p8wvpgt281q0e10e457",
"sourceEventMetadata": {
"eventTypeVersion": "0",
"sourceEventId": "0c1aa45d-8e0c-6a46-114c-f89a9f7c3bd1",
"eventOriginRegion": "us-east-1",
"relatedAccount": "123456789012",
"source": "aws.health",
"eventOccurrenceTime": "2024-11-30T00:37:40+00:00",
"eventType": "AWS Health Event",
"relatedResources": []
},
"messageComponents": {
"headline": "$SingleSentenceSummary",
"paragraphSummary": "$ParagraphSummary",
"completeDescription": "$CompleteDescription",
"dimensions": [
{
"name": "Affected account",
"value": "123456789012"
},
{
"name": "Service",
"value": "CLOUDFRONT"
},
{
"name": "Event type code",
"value": "AWS_CLOUDFRONT_OPERATIONAL_ISSUE"
},
{
"name": "Event type category",
"value": "issue"
},
{
"name": "Event region",
"value": "global"
},
{
"name": "Start time",
"value": "Wed, 29 Nov 2024 10:18:05 GMT"
},
{
"name": "End time",
"value": "Wed, 29 Nov 2024 11:40:53 GMT"
}
]
},
"sourceEventDetailUrl": "https://health.aws.amazon.com/health/home?region=us-east-1#/event-log?eventID=arn:aws:health:global::event/CLOUDFRONT/AWS_CLOUDFRONT_OPERATIONAL_ISSUE/AWS_CLOUDFRONT_OPERATIONAL_ISSUE_94265_0AFCF3D5C81&eventTab=details&layout=vertical",
"notificationType": "ALERT",
"aggregationEventType": "NONE",
"textParts": {
"CompleteDescription": {
"type": "LOCALIZED_TEXT",
"textByLocale": {
"en_US": "Current severity level: Operating normally\n\n[RESOLVED] Increased Error Rates\n\n[03:40 AM PST] Between November 28 10:56 PM and November 29 3:06 AM PST, we experienced an issue for CloudFront customers with S3 static website origins. This issue was the result of a recent change which impacted traffic from certain CloudFront locations to S3 static website origins and resulted in \"404 NoSuchBucket\" errors. Our engineers were engaged and immediately began investigating multiple parallel paths to mitigate the impact. We initiated a rollback of the change which led to full recovery of errors at 3:06 AM PST. The issue has been resolved and the service is operating normally."
}
},
"ParagraphSummary": {
"type": "LOCALIZED_TEXT",
"textByLocale": {
"en_US": "Current severity level: Operating normally\n\n[RESOLVED] Increased Error Rates\n\n[03:40 AM PST] Between November 28 10:56 PM and November 29 3:06 AM PST, we experienced an issue for CloudFront customers with S3 static website origins. This issue was the result of a recent change which impacted traffic from certain CloudFront locations to S3 static website origins and resulted in \"404 NoSuchBucket\" errors. Our engineers were engaged and immediately began investigating multiple parallel paths to mitigate the im..."
}
},
"SingleSentenceSummary": {
"type": "LOCALIZED_TEXT",
"textByLocale": {
"en_US": "Health Event: AWS CLOUDFRONT OPERATIONAL ISSUE in global on account 123456789012."
}
}
},
"media": []
}
}
16 changes: 16 additions & 0 deletions awscli/examples/notifications/list-channels.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
**To view the list of channels for a specific notificationconfiguration**

The following ``list-channels`` example displays the list of channels configured for a specific NotificationConfiguration. ::

aws notifications list-channels \
--notification-configuration-arn arn:aws:notifications::123456789012:configuration/a01jg38mtmd0ta5zshhstphfw8w

Output::

{
"channels": [
"arn:aws:notifications-contacts::123456789012:emailcontact/a01jjz5n8e8557aswvm1fv4wqrf"
]
}

For more information, see `Viewing delivery channel details in AWS User Notifications <https://docs.aws.amazon.com/notifications/latest/userguide/detail-delivery-channels.html>`__ in the *AWS User Notifications User Guide*.
33 changes: 33 additions & 0 deletions awscli/examples/notifications/list-event-rules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
**To view the list of event rules**

The following ``list-event-rules`` example displays the list of event rules for a specific NotificationConfiguration. ::

aws notifications list-event-rules \
--notification-configuration-arn arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh

Output::

{
"eventRules": [
{
"arn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/rule/a01jg2z8ydvea0x0v3z8xkwjrrs",
"notificationConfigurationArn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"creationTime": "2024-10-27T02:31:35.611000+00:00",
"source": "aws.health",
"eventType": "AWS Health Event",
"eventPattern": "",
"regions": [
"us-east-1"
],
"managedRules": [
"arn:aws:events:us-east-1:123456789012:rule/AWSUserNotificationsManagedRule-aa1apyq"
],
"statusSummaryByRegion": {
"us-east-1": {
"status": "ACTIVE",
"reason": ""
}
}
}
]
}
36 changes: 36 additions & 0 deletions awscli/examples/notifications/list-notification-configurations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
**To view the list of notificationconfiguration **

The following ``list-notification-configurations`` example displays the list of NotificationConfiguration. ::

aws notifications list-notification-configurations

Output::

{
"notificationConfigurations": [
{
"arn": "arn:aws:notifications::123456789012:configuration/a01jg38mtmd0ta5zshhstphfw8w",
"name": "EC2-quick-setup",
"description": "EC2 notifications created with quick setup",
"status": "ACTIVE",
"creationTime": "2024-10-27T05:15:22.126000+00:00",
"aggregationDuration": "SHORT"
},
{
"arn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"name": "Health-quick-setup",
"description": "Health notifications created with quick setup",
"status": "ACTIVE",
"creationTime": "2024-10-27T02:31:34.987000+00:00",
"aggregationDuration": "SHORT"
},
{
"arn": "arn:aws:notifications::123456789012:configuration/a01jg2ne1shtc7pbwanwdvn0h7t",
"name": "test-notification",
"description": "test-notification",
"status": "INACTIVE",
"creationTime": "2024-10-26T23:39:37.137000+00:00",
"aggregationDuration": "SHORT"
}
]
}
51 changes: 51 additions & 0 deletions awscli/examples/notifications/list-notification-events.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
**To view the list of notification events**

The following ``list-notification-events`` example displays the list of notification events. ::

aws notifications list-notification-events

Output::

{
"notificationEvents": [{
"arn": "arn:aws:notifications:us-east-1:123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/event/a01jjta9p8wvpgt281q0e10e457",
"notificationConfigurationArn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"relatedAccount": "123456789012",
"creationTime": "2024-11-30T00:38:09.948000+00:00",
"notificationEvent": {
"schemaVersion": "v1.0",
"sourceEventMetadata": {
"eventOriginRegion": "us-east-1",
"source": "aws.health",
"eventType": "AWS Health Event"
},
"messageComponents": {
"headline": "Health Event: AWS CLOUDFRONT OPERATIONAL ISSUE in global on account 123456789012."
},
"eventStatus": "null",
"notificationType": "ALERT"
},
"aggregationEventType": "NONE"
},
{
"arn": "arn:aws:notifications:us-east-1:123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh/event/a01jjt9mgqeewxcr08jccgxqnkj",
"notificationConfigurationArn": "arn:aws:notifications::123456789012:configuration/a01jg2z8xtb12whwyg3ztxmjazh",
"relatedAccount": "123456789012",
"creationTime": "2024-11-30T00:26:36.142000+00:00",
"notificationEvent": {
"schemaVersion": "v1.0",
"sourceEventMetadata": {
"eventOriginRegion": "us-east-1",
"source": "aws.health",
"eventType": "AWS Health Event"
},
"messageComponents": {
"headline": "Health Event: AWS CLOUDFRONT OPERATIONAL ISSUE in global on account 123456789012."
},
"eventStatus": "null",
"notificationType": "ALERT"
},
"aggregationEventType": "NONE"
}
]
}
Loading