summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_lua_request.cc
diff options
context:
space:
mode:
authorYuval Lifshitz <yuvalif@yahoo.com>2021-11-30 07:57:23 +0100
committerGitHub <noreply@github.com>2021-11-30 07:57:23 +0100
commit174ad996c15ee7d50b3c74107946ffc0204b2139 (patch)
tree7caac84cace6fb573f0ead75a8f1ba8b85a26dba /src/rgw/rgw_lua_request.cc
parentMerge pull request #42504 from arjune123/rgw-bug-fixes (diff)
parentrgw/lua: allow read/write of StorageClass field (diff)
downloadceph-174ad996c15ee7d50b3c74107946ffc0204b2139.tar.xz
ceph-174ad996c15ee7d50b3c74107946ffc0204b2139.zip
Merge pull request #43529 from curtbruns/rgw-lua-storageclass
rgw/lua: allow read/write of StorageClass field
Diffstat (limited to 'src/rgw/rgw_lua_request.cc')
-rw-r--r--src/rgw/rgw_lua_request.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rgw/rgw_lua_request.cc b/src/rgw/rgw_lua_request.cc
index 7d6d72e0368..2e971c329c8 100644
--- a/src/rgw/rgw_lua_request.cc
+++ b/src/rgw/rgw_lua_request.cc
@@ -639,11 +639,26 @@ struct HTTPMetaTable : public EmptyMetaTable {
pushstring(L, info->request_params);
} else if (strcasecmp(index, "Domain") == 0) {
pushstring(L, info->domain);
+ } else if (strcasecmp(index, "StorageClass") == 0) {
+ pushstring(L, info->storage_class);
} else {
return error_unknown_field(L, index, TableName());
}
return ONE_RETURNVAL;
}
+
+ static int NewIndexClosure(lua_State* L) {
+ auto info = reinterpret_cast<req_info*>(lua_touserdata(L, lua_upvalueindex(1)));
+
+ const char* index = luaL_checkstring(L, 2);
+
+ if (strcasecmp(index, "StorageClass") == 0) {
+ info->storage_class = luaL_checkstring(L, 3);
+ } else {
+ return error_unknown_field(L, index, TableName());
+ }
+ return NO_RETURNVAL;
+ }
};
struct CopyFromMetaTable : public EmptyMetaTable {