(w http.ResponseWriter, r *http.Request, action string)
| 2431 | } |
| 2432 | |
| 2433 | func (p *proxy) daePathAction(w http.ResponseWriter, r *http.Request, action string) { |
| 2434 | switch action { |
| 2435 | case apc.Proxy: |
| 2436 | p.daeSetPrimary(w, r) |
| 2437 | case apc.SyncSmap: |
| 2438 | newsmap := &smapX{} |
| 2439 | if cmn.ReadJSON(w, r, newsmap) != nil { |
| 2440 | return |
| 2441 | } |
| 2442 | if err := newsmap.validate(); err != nil { |
| 2443 | p.writeErrf(w, r, "%s: invalid %s: %v", p.si, newsmap, err) |
| 2444 | return |
| 2445 | } |
| 2446 | if err := p.owner.smap.synchronize(p.si, newsmap, nil /*ms payload*/); err != nil { |
| 2447 | p.writeErr(w, r, cmn.NewErrFailedTo(p, "synchronize", newsmap, err)) |
| 2448 | return |
| 2449 | } |
| 2450 | glog.Infof("%s: %s %s done", p, apc.SyncSmap, newsmap) |
| 2451 | case apc.ActSetConfig: // set-config #1 - via query parameters and "?n1=v1&n2=v2..." |
| 2452 | p.setDaemonConfigQuery(w, r) |
| 2453 | default: |
| 2454 | p.writeErrAct(w, r, action) |
| 2455 | } |
| 2456 | } |
| 2457 | |
| 2458 | func (p *proxy) httpdaedelete(w http.ResponseWriter, r *http.Request) { |
| 2459 | // the path includes cmn.CallbackRmSelf (compare with t.httpdaedelete) |
no test coverage detected