RGWRESTConn *conn;
RGWHTTPManager *http_manager;
string path;
- rgw_http_param_pair *params;
+ param_list_t params;
T *result;
S input;
RGWRESTPostResource *http_op;
public:
- RGWPostRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn, RGWHTTPManager *_http_manager,
- const string& _path, rgw_http_param_pair *_params, S& _input,
- T *_result) : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
- path(_path), params(_params), result(_result), input(_input), http_op(NULL) {}
+ RGWPostRESTResourceCR(CephContext *_cct, RGWRESTConn *_conn,
+ RGWHTTPManager *_http_manager, const string& _path,
+ rgw_http_param_pair *_params, S& _input, T *_result)
+ : RGWSimpleCoroutine(_cct), conn(_conn), http_manager(_http_manager),
+ path(_path), params(make_param_list(_params)), result(_result),
+ input(_input), http_op(NULL)
+ {}
int send_request() {
http_op = new RGWRESTPostResource(conn, path, params, NULL, http_manager);
: cct(_conn->get_ctx()), conn(_conn), resource(_resource),
params(make_param_list(pp)), cb(bl), mgr(_mgr),
req(cct, "POST", conn->get_url(), &cb, NULL, NULL)
+{
+ init_common(extra_headers);
+}
+
+RGWRESTPostResource::RGWRESTPostResource(RGWRESTConn *_conn,
+ const string& _resource,
+ param_list_t& params,
+ param_list_t *extra_headers,
+ RGWHTTPManager *_mgr)
+ : cct(_conn->get_ctx()), conn(_conn), resource(_resource), params(params),
+ cb(bl), mgr(_mgr), req(cct, "POST", conn->get_url(), &cb, NULL, NULL)
+{
+ init_common(extra_headers);
+}
+
+void RGWRESTPostResource::init_common(param_list_t *extra_headers)
{
params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "zonegroup", conn->get_zonegroup()));
RGWHTTPManager *mgr;
RGWRESTStreamRWRequest req;
+ void init_common(param_list_t *extra_headers);
+
public:
RGWRESTPostResource(RGWRESTConn *_conn,
const string& _resource,
param_list_t *extra_headers,
RGWHTTPManager *_mgr);
+ RGWRESTPostResource(RGWRESTConn *_conn,
+ const string& _resource,
+ param_list_t& params,
+ param_list_t *extra_headers,
+ RGWHTTPManager *_mgr);
+
void set_user_info(void *user_info) {
req.set_user_info(user_info);
}