(params martini.Params)
| 422 | } |
| 423 | |
| 424 | func (s *apiServer) EnableReplicaGroups(params martini.Params) (int, string) { |
| 425 | if err := s.verifyXAuth(params); err != nil { |
| 426 | return rpc.ApiResponseError(err) |
| 427 | } |
| 428 | gid, err := s.parseInteger(params, "gid") |
| 429 | if err != nil { |
| 430 | return rpc.ApiResponseError(err) |
| 431 | } |
| 432 | addr, err := s.parseAddr(params) |
| 433 | if err != nil { |
| 434 | return rpc.ApiResponseError(err) |
| 435 | } |
| 436 | n, err := s.parseInteger(params, "value") |
| 437 | if err != nil { |
| 438 | return rpc.ApiResponseError(err) |
| 439 | } |
| 440 | if err := s.topom.EnableReplicaGroups(gid, addr, n != 0); err != nil { |
| 441 | return rpc.ApiResponseError(err) |
| 442 | } else { |
| 443 | return rpc.ApiResponseJson("OK") |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | func (s *apiServer) EnableReplicaGroupsAll(params martini.Params) (int, string) { |
| 448 | if err := s.verifyXAuth(params); err != nil { |
nothing calls this directly
no test coverage detected