INFRA-3098 : Auto escalate refactor (#409)
* INFRA-3098 : Auto escalate refactor * INFRA-3098 : Delete old cron code * INFRA-2887 : File and api name changes * INFRA-2887 : Code review comments
This commit is contained in:
@@ -135,6 +135,18 @@ func (handler *IncidentHandler) HandleResolveIncident(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, common.SuccessResponse("Incident resolved successfully", http.StatusOK))
|
||||
}
|
||||
|
||||
func (handler *IncidentHandler) HandleEscalateIncident(c *gin.Context) {
|
||||
err := handler.service.EscalateIncidents()
|
||||
if err != nil {
|
||||
logger.Error(fmt.Sprintf("%s failed to escalate incidents", logTag), zap.Error(err))
|
||||
metrics.PublishHoustonFlowFailureMetrics(incidentService.ESCALATE_INCIDENT, err.Error())
|
||||
c.JSON(http.StatusInternalServerError, common.ErrorResponse(err, http.StatusInternalServerError, nil))
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, common.SuccessResponse("Incidents escalated successfully", http.StatusOK))
|
||||
}
|
||||
|
||||
func (handler *IncidentHandler) HandleJiraLinking(c *gin.Context) {
|
||||
var linkJiraRequest request.LinkJiraRequest
|
||||
if err := c.ShouldBindJSON(&linkJiraRequest); err != nil {
|
||||
|
||||
@@ -218,6 +218,7 @@ func (s *Server) incidentClientHandlerV2(houstonGroup *gin.RouterGroup) {
|
||||
s.gin.POST("/incidents", authService.IfValidHoustonUser(incidentHandler.HandleUpdateIncident))
|
||||
houstonGroup.POST("/incidents", incidentHandler.HandleUpdateIncident)
|
||||
houstonGroup.POST("/incidents/resolve", authService.IfValidHoustonUser(incidentHandler.HandleResolveIncident))
|
||||
houstonGroup.POST("/incidents/escalate", incidentHandler.HandleEscalateIncident)
|
||||
houstonGroup.POST("/link-jira-to-incident", incidentHandler.HandleJiraLinking)
|
||||
houstonGroup.POST("/unlink-jira-from-incident", incidentHandler.HandleJiraUnLinking)
|
||||
houstonGroup.GET("/get-jira-statuses", incidentHandler.HandleGetJiraStatuses)
|
||||
|
||||
Reference in New Issue
Block a user