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

Method httpobjpatch

ais/proxy.go:1692–1718  ·  view source on GitHub ↗

PATCH /v1/objects/bucket-name/object-name

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

1690
1691// PATCH /v1/objects/bucket-name/object-name
1692func (p *proxy) httpobjpatch(w http.ResponseWriter, r *http.Request) {
1693 started := time.Now()
1694 bckArgs := allocInitBckArgs()
1695 {
1696 bckArgs.p = p
1697 bckArgs.w = w
1698 bckArgs.r = r
1699 bckArgs.perms = apc.AceObjHEAD
1700 bckArgs.createAIS = false
1701 bckArgs.headRemB = true
1702 }
1703 bck, objName, err := p._parseReqTry(w, r, bckArgs)
1704 if err != nil {
1705 return
1706 }
1707 smap := p.owner.smap.get()
1708 si, err := cluster.HrwTarget(bck.MakeUname(objName), &smap.Smap)
1709 if err != nil {
1710 p.writeErr(w, r, err, http.StatusInternalServerError)
1711 return
1712 }
1713 if glog.FastV(4, glog.SmoduleAIS) {
1714 glog.Infof("%s %s/%s => %s", r.Method, bck.Name, objName, si)
1715 }
1716 redirectURL := p.redirectURL(r, si, started, cmn.NetIntraControl)
1717 http.Redirect(w, r, redirectURL, http.StatusTemporaryRedirect)
1718}
1719
1720//============================
1721//

Callers 1

objectHandlerMethod · 0.95

Calls 9

_parseReqTryMethod · 0.95
redirectURLMethod · 0.95
HrwTargetFunction · 0.92
FastVFunction · 0.92
InfofFunction · 0.92
allocInitBckArgsFunction · 0.85
writeErrMethod · 0.80
getMethod · 0.65
MakeUnameMethod · 0.45

Tested by

no test coverage detected