(params martini.Params)
| 460 | } |
| 461 | |
| 462 | func (s *apiServer) AddSentinel(params martini.Params) (int, string) { |
| 463 | if err := s.verifyXAuth(params); err != nil { |
| 464 | return rpc.ApiResponseError(err) |
| 465 | } |
| 466 | addr, err := s.parseAddr(params) |
| 467 | if err != nil { |
| 468 | return rpc.ApiResponseError(err) |
| 469 | } |
| 470 | if err := s.topom.AddSentinel(addr); err != nil { |
| 471 | return rpc.ApiResponseError(err) |
| 472 | } else { |
| 473 | return rpc.ApiResponseJson("OK") |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | func (s *apiServer) DelSentinel(params martini.Params) (int, string) { |
| 478 | if err := s.verifyXAuth(params); err != nil { |
no test coverage detected