MCPcopy Index your code
hub / github.com/NVIDIA/aistore / EvictObject

Function EvictObject

api/object.go:241–255  ·  view source on GitHub ↗

EvictObject evicts an object specified by bucket/object.

(baseParams BaseParams, bck cmn.Bck, object string)

Source from the content-addressed store, hash-verified

239
240// EvictObject evicts an object specified by bucket/object.
241func EvictObject(baseParams BaseParams, bck cmn.Bck, object string) error {
242 baseParams.Method = http.MethodDelete
243 actMsg := apc.ActionMsg{Action: apc.ActEvictObjects, Name: cos.JoinWords(bck.Name, object)}
244 reqParams := AllocRp()
245 {
246 reqParams.BaseParams = baseParams
247 reqParams.Path = apc.URLPathObjects.Join(bck.Name, object)
248 reqParams.Body = cos.MustMarshal(actMsg)
249 reqParams.Header = http.Header{cos.HdrContentType: []string{cos.ContentJSON}}
250 reqParams.Query = bck.AddToQuery(nil)
251 }
252 err := reqParams.DoHTTPRequest()
253 FreeRp(reqParams)
254 return err
255}
256
257// GetObject returns the length of the object. Does not validate checksum of the
258// object in the response.

Callers 3

multiObjOpFunction · 0.92
testETLObjectCloudFunction · 0.92

Calls 7

JoinWordsFunction · 0.92
MustMarshalFunction · 0.92
AllocRpFunction · 0.85
FreeRpFunction · 0.85
JoinMethod · 0.80
DoHTTPRequestMethod · 0.80
AddToQueryMethod · 0.45

Tested by 1

testETLObjectCloudFunction · 0.74