mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
http: parsing flags for node drain
This commit is contained in:
@@ -2,6 +2,7 @@ package agent
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/nomad/nomad/structs"
|
||||
@@ -88,6 +89,16 @@ func (s *HTTPServer) nodeToggleDrain(resp http.ResponseWriter, req *http.Request
|
||||
return nil, CodedError(405, ErrInvalidMethod)
|
||||
}
|
||||
|
||||
// Get the enable value
|
||||
enableRaw := req.URL.Query().Get("enable")
|
||||
if enableRaw == "" {
|
||||
return nil, CodedError(400, "missing enable value")
|
||||
}
|
||||
enable, err := strconv.ParseBool(enableRaw)
|
||||
if err != nil {
|
||||
return nil, CodedError(400, "invalid enable value")
|
||||
}
|
||||
|
||||
// TODO
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user