return path;
}
+struct es_dump_type {
+ string type;
+
+ es_dump_type(const string& t) : type(t) {}
+
+ void dump(Formatter *f) const {
+ encode_json("type", type, f);
+ }
+};
+
+struct es_index_mappings {
+ void dump(Formatter *f) const {
+ f->open_object_section("mappings");
+ f->open_object_section("object");
+ f->open_object_section("properties");
+ encode_json("bucket", es_dump_type("string"), f);
+ encode_json("name", es_dump_type("string"), f);
+ encode_json("instance", es_dump_type("string"), f);
+ f->open_object_section("meta");
+ f->open_object_section("properties");
+ encode_json("cache_control", es_dump_type("string"), f);
+ encode_json("content_disposition", es_dump_type("string"), f);
+ encode_json("content_encoding", es_dump_type("string"), f);
+ encode_json("content_language", es_dump_type("string"), f);
+ encode_json("content_type", es_dump_type("string"), f);
+ encode_json("etag", es_dump_type("string"), f);
+ encode_json("expires", es_dump_type("string"), f);
+ f->open_object_section("mtime");
+ ::encode_json("type", "date", f);
+ ::encode_json("format", "strict_date_optional_time||epoch_millis", f);
+ f->close_section(); // mtime
+ encode_json("size", es_dump_type("long"), f);
+ f->open_object_section("custom-string");
+ ::encode_json("type", "nested", f);
+ f->open_object_section("properties");
+ f->open_object_section("name");
+ ::encode_json("type", "string", f);
+ ::encode_json("index", "not_analyzed", f);
+ f->close_section(); // name
+ encode_json("value", es_dump_type("string"), f);
+ f->close_section(); // entry
+ f->close_section(); // custom-string
+ f->close_section(); // properties
+ f->close_section(); // meta
+ f->close_section(); // properties
+ f->close_section(); // object
+ f->close_section(); // mappings
+ }
+};
+
struct es_obj_metadata {
CephContext *cct;
RGWBucketInfo bucket_info;
::encode_json(i.first.c_str(), i.second, f);
}
if (!custom_meta.empty()) {
- f->open_object_section("custom");
+ f->open_array_section("custom-string");
for (auto i : custom_meta) {
- ::encode_json(i.first.c_str(), i.second, f);
+ f->open_object_section("entity");
+ ::encode_json("name", i.first.c_str(), f);
+ ::encode_json("value", i.second, f);
+ f->close_section();
}
f->close_section();
}