Class NotificationController
java.lang.Object
com.netflix.spinnaker.echo.controller.NotificationController
@RequestMapping("/notifications")
@RestController
@Slf4j
public class NotificationController
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(com.netflix.spinnaker.echo.api.Notification notification) Provides an endpoint for other Spinnaker services to send out notifications to users.List<com.netflix.spinnaker.echo.api.events.NotificationAgent>org.springframework.http.ResponseEntity<String>processCallback(String source, org.springframework.http.RequestEntity<String> request) Provides a generic callback API for notification services to call, primarily in response to interactive user action (e.g.
-
Constructor Details
-
NotificationController
public NotificationController()
-
-
Method Details
-
create
@RequestMapping(method=POST) public EchoResponse create(@RequestBody com.netflix.spinnaker.echo.api.Notification notification) Provides an endpoint for other Spinnaker services to send out notifications to users. Processing of the request is delegated to an implementation ofNotificationServiceappropriate for theNotification.notificationType.- Parameters:
notification- The notification to be sent, in an echo-generic format.- Returns:
-
processCallback
@RequestMapping(value="/callbacks/{source}", method=POST, consumes="application/x-www-form-urlencoded", produces="application/json") public org.springframework.http.ResponseEntity<String> processCallback(@PathVariable String source, org.springframework.http.RequestEntity<String> request) Provides a generic callback API for notification services to call, primarily in response to interactive user action (e.g. clicking a button in a message). This method makes as few assumptions as possible about the request, delegating the raw request headers, parameters and body to the corresponding [InteractiveNotificationService] to process, and similarly allows the notification service to return an arbitrary response body to the caller.Note that this method must be exposed externally through gate so that external services (e.g. Slack) may call back to echo.
- Parameters:
source- The unique ID of the calling notification service (e.g. "slack")headers- The request headersrawBody- The raw body of the requestparameters- The request parameters, parsed as a Map- Returns:
-
getNotificationTypeMetadata
@GetMapping("/metadata") public List<com.netflix.spinnaker.echo.api.events.NotificationAgent> getNotificationTypeMetadata()
-