11.2. Creating notifications by using the UI
Use the following procedure to add notifications.
Prerequisites
- You have created a repository.
- You have administrative privileges for the repository.
Procedure
- Navigate to a repository on Red Hat Quay.
- In the navigation pane, click Settings.
- In the Events and Notifications category, click Create Notification to add a new notification for a repository event. The Create notification popup box appears.
On the Create repository popup box, click the When this event occurs box to select an event. You can select a notification for the following types of events:
- Push to Repository
- Image build failed
- Image build queued
- Image build started
- Image build success
- Image build cancelled
- Image expiry trigger
After you have selected the event type, select the notification method. The following methods are supported:
- Quay Notification
- E-mail Notification
- Webhook POST
- Flowdock Team Notification
- HipChat Room Notification
Slack Notification
Depending on the method that you choose, you must include additional information. For example, if you select E-mail, you are required to include an e-mail address and an optional notification title.
- After selecting an event and notification method, click Create Notification.
11.2.1. Creating an image expiration notification 링크 복사링크가 클립보드에 복사되었습니다!
Image expiration event triggers can be configured to notify users through email, Slack, webhooks, and so on, and can be configured at the repository level. Triggers can be set for images expiring in any amount of days, and can work in conjunction with the auto-pruning feature.
Image expiration notifications can be set by using the Red Hat Quay v2 UI or by using the createRepoNotification API endpoint.
Prerequisites
-
FEATURE_GARBAGE_COLLECTION: trueis set in yourconfig.yamlfile. -
Optional.
FEATURE_AUTO_PRUNE: trueis set in yourconfig.yamlfile.
Procedure
- On the Red Hat Quay v2 UI, click Repositories.
- Select the name of a repository.
-
Click Settings
Events and notifications. - Click Create notification. The Create notification popup box appears.
- Click the Select event… box, then click Image expiry trigger.
-
In the When the image is due to expiry in days box, enter the number of days before the image’s expiration when you want to receive an alert. For example, use
1for 1 day. In the Select method… box, click one of the following:
- Webhook POST
- Flowdock Team Notification
- HipChat Room Notification
- Slack Notification
-
Depending on which method you chose, include the necessary data. For example, if you chose Webhook POST, include the
Webhook URL. - Optional. Provide a POST JSON body template.
- Optional. Provide a Title for your notification.
- Click Submit. You are returned to the Events and notifications page, and the notification now appears.
Optional. You can set the
NOTIFICATION_TASK_RUN_MINIMUM_INTERVAL_MINUTESvariable in your config.yaml file. with this field set, if there are any expiring images notifications will be sent automatically. By default, this is set to300, or 5 hours, however it can be adjusted as warranted.NOTIFICATION_TASK_RUN_MINIMUM_INTERVAL_MINUTES: 3001 - 1
- By default, this field is set to
300, or 5 hours.
Verification
Click the menu kebab
Test Notification. The following message is returned: Test Notification Queued A test version of this notification has been queued and should appear shortlyDepending on which method you chose, check your e-mail, webhook address, Slack channel, and so on. The information sent should look similar to the following example:
{ "repository": "sample_org/busybox", "namespace": "sample_org", "name": "busybox", "docker_url": "quay-server.example.com/sample_org/busybox", "homepage": "http://quay-server.example.com/repository/sample_org/busybox", "tags": [ "latest", "v1" ], "expiring_in": "1 days" }