github.com/argoproj/argo-cd/v2@v2.10.5/docs/proposals/notifications-API.md (about) 1 --- 2 title: Subscribe to a notification from the Application Details page 3 authors: 4 - "@aborilov" 5 sponsors: 6 - TBD 7 reviewers: 8 - "@alexmt" 9 - TBD 10 approvers: 11 - "@alexmt" 12 - TBD 13 14 creation-date: 2022-08-16 15 last-updated: 2022-08-16 16 --- 17 18 # Subscribe to a notification from the Application Details page 19 20 Provide the ability to subscribe to a notification from the Application Details page 21 22 ## Summary 23 24 Allow users to subscribe application with a notification from the Application Details page 25 using provided instruments for selecting available triggers and services. 26 27 ## Motivation 28 29 It is already possible to subscribe to notifications by modifying annotations however this is a pretty 30 poor user experience. Users have to understand annotation structure and have to find available services and triggers in configmap. 31 32 ### Goals 33 34 Be able to subscribe to a notification from the Application Details page without forcing users to read the notification configmap. 35 36 ### Non-Goals 37 38 We provide only ability to select existing services and triggers, we don't provide instruments to add/edit/delete notification services and triggers. 39 40 ## Proposal 41 42 Two changes are required: 43 44 * Implement notifications API that would expose a list of configured triggers and services 45 * Implement UI that leverages notifications API and helps users to create a correct annotation. 46 47 ### Use cases 48 49 Add a list of detailed use cases this enhancement intends to take care of. 50 51 #### Use case 1: 52 As a user, I would like to be able to subscribe application to a notification from the Application Details Page 53 without reading knowing of annotation format and reading notification configmap. 54 55 ### Implementation Details/Notes/Constraints [optional] 56 57 Three read-only API endpoints will be added to provide a list of notification services, triggers, and templates. 58 59 ``` 60 message Triggers { repeated string triggers = 1; } 61 message TriggersListRequest {} 62 message Services { repeated string services = 1; } 63 message ServicesListRequest {} 64 message Templates { repeated string templates = 1; } 65 message TemplatesListRequest {} 66 service NotificationService { 67 rpc ListTriggers(TriggersListRequest) returns (Triggers) { 68 option (google.api.http).get = "/api/v1/notifications/triggers"; 69 } 70 rpc ListServices(ServicesListRequest) returns (Services) { 71 option (google.api.http).get = "/api/v1/notifications/services"; 72 } 73 rpc ListTemplates(TemplatesListRequest) returns (Templates) { 74 option (google.api.http).get = "/api/v1/notifications/templates"; 75 } 76 } 77 ``` 78 79 ### Detailed examples 80 81 ### Security Considerations 82 83 New API endpoints are available only for authenticated users. API endpoints response does not contain any sensitive data. 84 85 ### Risks and Mitigations 86 87 TBD 88 89 ### Upgrade / Downgrade Strategy 90 91 By default, we don't have a notification configmap in the system; in that case, API should return an empty list instead of erroring. 92 93 ## Drawbacks 94 95 96 ## Alternatives 97 98 Continue to do that manually. 99