// The PullHandler processes "PUT /pull" commands from Data Manager.
// It parses the JSON list of pull requests in the request body, and
// The PullHandler processes "PUT /pull" commands from Data Manager.
// It parses the JSON list of pull requests in the request body, and
rest.HandleFunc(`/pull`, PullHandler).Methods("PUT")
// Any request which does not match any of these routes gets
rest.HandleFunc(`/pull`, PullHandler).Methods("PUT")
// Any request which does not match any of these routes gets
func PullHandler(resp http.ResponseWriter, req *http.Request) {
// Reject unauthorized requests.
api_token := GetApiToken(req)
if !IsDataManagerToken(api_token) {
http.Error(resp, UnauthorizedError.Error(), UnauthorizedError.HTTPCode)
func PullHandler(resp http.ResponseWriter, req *http.Request) {
// Reject unauthorized requests.
api_token := GetApiToken(req)
if !IsDataManagerToken(api_token) {
http.Error(resp, UnauthorizedError.Error(), UnauthorizedError.HTTPCode)
- // manager. Report success and send the list to the keep
- // replicator for further handling.
+ // manager. Report success and send the list to the pull list
+ // manager for further handling.
+ log.Printf("%s %s: received %v\n", req.Method, req.URL, pr)