MCPcopy
hub / github.com/NVIDIA/aistore / daePathAction

Method daePathAction

ais/proxy.go:2433–2456  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, action string)

Source from the content-addressed store, hash-verified

2431}
2432
2433func (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
2458func (p *proxy) httpdaedelete(w http.ResponseWriter, r *http.Request) {
2459 // the path includes cmn.CallbackRmSelf (compare with t.httpdaedelete)

Callers 1

httpdaeputMethod · 0.95

Calls 10

daeSetPrimaryMethod · 0.95
validateMethod · 0.95
ReadJSONFunction · 0.92
NewErrFailedToFunction · 0.92
InfofFunction · 0.92
writeErrfMethod · 0.80
synchronizeMethod · 0.80
writeErrMethod · 0.80
setDaemonConfigQueryMethod · 0.80
writeErrActMethod · 0.80

Tested by

no test coverage detected