]> git.proxmox.com Git - ceph.git/blame - ceph/examples/rgw/lua/storage_class.lua
update ceph source to reef 18.1.2
[ceph.git] / ceph / examples / rgw / lua / storage_class.lua
CommitLineData
20effc67
TL
1local function isempty(input)
2 return input == nil or input == ''
3end
4
5if Request.RGWOp == 'put_obj' then
6 RGWDebugLog("Put_Obj with StorageClass: " .. Request.HTTP.StorageClass )
7 if (isempty(Request.HTTP.StorageClass)) then
8 if (Request.ContentLength >= 65536) then
9 RGWDebugLog("No StorageClass for Object and size >= threshold: " .. Request.Object.Name .. " adding QLC StorageClass")
10 Request.HTTP.StorageClass = "QLC_CLASS"
11 else
12 RGWDebugLog("No StorageClass for Object and size < threshold: " .. Request.Object.Name .. " adding STANDARD StorageClass")
13 Request.HTTP.StorageClass = "STANDARD"
14 end
15 else
16 RGWDebugLog("Storage Class Header Present on Object: " .. Request.Object.Name .. " with StorageClass: " .. Request.HTTP.StorageClass)
17 end
18end
19