(w http.ResponseWriter, r *http.Request, bck *cluster.Bck, objName string, msg *apc.ActionMsg)
| 2158 | } |
| 2159 | |
| 2160 | func (p *proxy) objMv(w http.ResponseWriter, r *http.Request, bck *cluster.Bck, objName string, msg *apc.ActionMsg) { |
| 2161 | started := time.Now() |
| 2162 | if objName == msg.Name { |
| 2163 | p.writeErrMsg(w, r, "the new and the current name are the same") |
| 2164 | return |
| 2165 | } |
| 2166 | smap := p.owner.smap.get() |
| 2167 | si, err := cluster.HrwTarget(bck.MakeUname(objName), &smap.Smap) |
| 2168 | if err != nil { |
| 2169 | p.writeErr(w, r, err) |
| 2170 | return |
| 2171 | } |
| 2172 | if glog.FastV(4, glog.SmoduleAIS) { |
| 2173 | glog.Infof("%q %s/%s => %s", msg.Action, bck.Name, objName, si) |
| 2174 | } |
| 2175 | |
| 2176 | // NOTE: Code 307 is the only way to http-redirect with the original JSON payload. |
| 2177 | redirectURL := p.redirectURL(r, si, started, cmn.NetIntraControl) |
| 2178 | http.Redirect(w, r, redirectURL, http.StatusTemporaryRedirect) |
| 2179 | |
| 2180 | p.statsT.Add(stats.RenameCount, 1) |
| 2181 | } |
| 2182 | |
| 2183 | func (p *proxy) doListRange(method, bucket string, msg *apc.ActionMsg, query url.Values) (xactID string, err error) { |
| 2184 | var ( |
no test coverage detected