@@ -157,6 +157,7 @@ void RGWOp_User_Create::execute(optional_yield y)
157157 std::string op_mask_str;
158158 std::string default_placement_str;
159159 std::string placement_tags_str;
160+ std::string default_storage_class_str;
160161
161162 bool gen_key;
162163 bool suspended;
@@ -188,6 +189,7 @@ void RGWOp_User_Create::execute(optional_yield y)
188189 RESTArgs::get_bool (s, " exclusive" , false , &exclusive);
189190 RESTArgs::get_string (s, " op-mask" , op_mask_str, &op_mask_str);
190191 RESTArgs::get_string (s, " default-placement" , default_placement_str, &default_placement_str);
192+ RESTArgs::get_string (s, " default-storage-class" , default_storage_class_str, &default_storage_class_str);
191193 RESTArgs::get_string (s, " placement-tags" , placement_tags_str, &placement_tags_str);
192194 RESTArgs::get_string (s, " account-id" , " " , &op_state.account_id );
193195 RESTArgs::get_string (s, " path" , " " , &op_state.path );
@@ -251,7 +253,10 @@ void RGWOp_User_Create::execute(optional_yield y)
251253
252254 if (!default_placement_str.empty ()) {
253255 rgw_placement_rule target_rule;
254- target_rule.from_str (default_placement_str);
256+ target_rule.name = default_placement_str;
257+ if (!default_storage_class_str.empty ()){
258+ target_rule.storage_class = default_storage_class_str;
259+ }
255260 if (!driver->valid_placement (target_rule)) {
256261 ldpp_dout (this , 0 ) << " NOTICE: invalid dest placement: " << target_rule.to_str () << dendl;
257262 op_ret = -EINVAL;
@@ -309,6 +314,7 @@ void RGWOp_User_Modify::execute(optional_yield y)
309314 std::string op_mask_str;
310315 std::string default_placement_str;
311316 std::string placement_tags_str;
317+ std::string default_storage_class_str;
312318
313319 bool gen_key;
314320 bool suspended;
@@ -336,6 +342,7 @@ void RGWOp_User_Modify::execute(optional_yield y)
336342 RESTArgs::get_bool (s, " account-root" , false , &account_root);
337343 RESTArgs::get_string (s, " op-mask" , op_mask_str, &op_mask_str);
338344 RESTArgs::get_string (s, " default-placement" , default_placement_str, &default_placement_str);
345+ RESTArgs::get_string (s, " default-storage-class" , default_storage_class_str, &default_storage_class_str);
339346 RESTArgs::get_string (s, " placement-tags" , placement_tags_str, &placement_tags_str);
340347 RESTArgs::get_string (s, " account-id" , " " , &op_state.account_id );
341348 RESTArgs::get_string (s, " path" , " " , &op_state.path );
@@ -404,7 +411,10 @@ void RGWOp_User_Modify::execute(optional_yield y)
404411
405412 if (!default_placement_str.empty ()) {
406413 rgw_placement_rule target_rule;
407- target_rule.from_str (default_placement_str);
414+ target_rule.name = default_placement_str;
415+ if (!default_storage_class_str.empty ()){
416+ target_rule.storage_class = default_storage_class_str;
417+ }
408418 if (!driver->valid_placement (target_rule)) {
409419 ldpp_dout (this , 0 ) << " NOTICE: invalid dest placement: " << target_rule.to_str () << dendl;
410420 op_ret = -EINVAL;
0 commit comments