]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_lua.h
8241622b246cab8ab4f0a4e7dafc5650797f2387
4 #include "common/async/yield_context.h"
20 // get context enum from string
21 // the expected string the same as the enum (case insensitive)
22 // return "none" if not matched
23 context
to_context(const std::string
& s
);
25 // verify a lua script
26 bool verify(const std::string
& script
, std::string
& err_msg
);
28 // store a lua script in a context
29 int write_script(rgw::sal::RGWRadosStore
* store
, const std::string
& tenant
, optional_yield y
, context ctx
, const std::string
& script
);
31 // read the stored lua script from a context
32 int read_script(rgw::sal::RGWRadosStore
* store
, const std::string
& tenant
, optional_yield y
, context ctx
, std::string
& script
);
34 // delete the stored lua script from a context
35 int delete_script(rgw::sal::RGWRadosStore
* store
, const std::string
& tenant
, optional_yield y
, context ctx
);
37 #ifdef WITH_RADOSGW_LUA_PACKAGES
40 using packages_t
= std::set
<std::string
>;
42 // add a lua package to the allowlist
43 int add_package(rgw::sal::RGWRadosStore
* store
, optional_yield y
, const std::string
& package_name
, bool allow_compilation
);
45 // remove a lua package from the allowlist
46 int remove_package(rgw::sal::RGWRadosStore
* store
, optional_yield y
, const std::string
& package_name
);
48 // list lua packages in the allowlist
49 int list_packages(rgw::sal::RGWRadosStore
* store
, optional_yield y
, packages_t
& packages
);
51 // install all packages from the allowlist
52 // return the list of packages that failed to install and the output of the install command
53 int install_packages(rgw::sal::RGWRadosStore
* store
, optional_yield y
, packages_t
& failed_packages
, std::string
& output
);