From: Abhishek Lekshmanan Date: Thu, 4 May 2017 13:16:03 +0000 (+0200) Subject: rgw es: add support for obj tags X-Git-Tag: v12.1.2~1^2~48^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=72b9d64604a78f09b26e7058d7873943c00c166d;p=ceph.git rgw es: add support for obj tags Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 7bff49bd3eadca59d5c23fe1eafa18bb40292463) --- diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index 484352dc835c..6c8c65c5a14c 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -263,6 +263,7 @@ struct es_obj_metadata { map custom_meta; RGWAccessControlPolicy policy; set permissions; + RGWObjTags obj_tags; for (auto i : attrs) { const string& attr_name = i.first; @@ -302,6 +303,9 @@ struct es_obj_metadata { } } } + } else if (name == "x-amz-tagging") { + auto tags_bl = val.begin(); + ::decode(obj_tags, tags_bl); } else { if (name != "pg_ver" && name != "source_zone" && @@ -396,7 +400,18 @@ struct es_obj_metadata { } f->close_section(); } - f->close_section(); + f->close_section(); // meta + const auto& m = obj_tags.get_tags(); + if (m.size() > 0){ + f->open_array_section("tagging"); + for (const auto &it : m) { + f->open_object_section("tag"); + ::encode_json("key", it.first, f); + ::encode_json("value",it.second, f); + f->close_section(); + } + f->close_section(); // tagging + } } };