mirror of
https://github.com/ceph/ceph
synced 2025-01-19 17:41:39 +00:00
Merge pull request #43529 from curtbruns/rgw-lua-storageclass
rgw/lua: allow read/write of StorageClass field
This commit is contained in:
commit
174ad996c1
@ -262,6 +262,8 @@ Request Fields
|
||||
+----------------------------------------------------+----------+--------------------------------------------------------------+----------+-----------+----------+
|
||||
| ``Request.HTTP.Metadata`` | table | string to string metadata map | yes | yes | no |
|
||||
+----------------------------------------------------+----------+--------------------------------------------------------------+----------+-----------+----------+
|
||||
| ``Request.HTTP.StorageClass`` | string | storage class | no | yes | yes |
|
||||
+----------------------------------------------------+----------+--------------------------------------------------------------+----------+-----------+----------+
|
||||
| ``Request.HTTP.Host`` | string | host name | no | no | no |
|
||||
+----------------------------------------------------+----------+--------------------------------------------------------------+----------+-----------+----------+
|
||||
| ``Request.HTTP.Method`` | string | HTTP method | no | no | no |
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user