docs/proposals/notifications-API.md
Provide the ability to subscribe to a notification from the Application Details page
Allow users to subscribe application with a notification from the Application Details page using provided instruments for selecting available triggers and services.
It is already possible to subscribe to notifications by modifying annotations however this is a pretty poor user experience. Users have to understand annotation structure and have to find available services and triggers in configmap.
Be able to subscribe to a notification from the Application Details page without forcing users to read the notification configmap.
We provide only ability to select existing services and triggers, we don't provide instruments to add/edit/delete notification services and triggers.
Two changes are required:
Add a list of detailed use cases this enhancement intends to take care of.
As a user, I would like to be able to subscribe application to a notification from the Application Details Page without reading knowing of annotation format and reading notification configmap.
Three read-only API endpoints will be added to provide a list of notification services, triggers, and templates.
message Triggers { repeated string triggers = 1; }
message TriggersListRequest {}
message Services { repeated string services = 1; }
message ServicesListRequest {}
message Templates { repeated string templates = 1; }
message TemplatesListRequest {}
service NotificationService {
rpc ListTriggers(TriggersListRequest) returns (Triggers) {
option (google.api.http).get = "/api/v1/notifications/triggers";
}
rpc ListServices(ServicesListRequest) returns (Services) {
option (google.api.http).get = "/api/v1/notifications/services";
}
rpc ListTemplates(TemplatesListRequest) returns (Templates) {
option (google.api.http).get = "/api/v1/notifications/templates";
}
}
New API endpoints are available only for authenticated users. API endpoints response does not contain any sensitive data.
TBD
By default, we don't have a notification configmap in the system; in that case, API should return an empty list instead of erroring.
Continue to do that manually.