JSONDecoder::decode_json("active", active, obj);
}
+
+void RGWAccountInfo::dump(Formatter * const f) const
+{
+ encode_json("id", id, f);
+ encode_json("tenant", tenant, f);
+ encode_json("name", name, f);
+ encode_json("email", email, f);
+ encode_json("quota", quota, f);
+ encode_json("max_users", max_users, f);
+ encode_json("max_roles", max_roles, f);
+ encode_json("max_groups", max_groups, f);
+ encode_json("max_buckets", max_buckets, f);
+ encode_json("max_access_keys", max_access_keys, f);
+}
+
+void RGWAccountInfo::decode_json(JSONObj* obj)
+{
+ JSONDecoder::decode_json("id", id, obj);
+ JSONDecoder::decode_json("tenant", tenant, obj);
+ JSONDecoder::decode_json("name", name, obj);
+ JSONDecoder::decode_json("email", email, obj);
+ JSONDecoder::decode_json("quota", quota, obj);
+ JSONDecoder::decode_json("max_users", max_users, obj);
+ JSONDecoder::decode_json("max_roles", max_roles, obj);
+ JSONDecoder::decode_json("max_groups", max_groups, obj);
+ JSONDecoder::decode_json("max_buckets", max_buckets, obj);
+ JSONDecoder::decode_json("max_access_keys", max_access_keys, obj);
+}
+
+void RGWAccountInfo::generate_test_instances(std::list<RGWAccountInfo*>& o)
+{
+ o.push_back(new RGWAccountInfo);
+ auto p = new RGWAccountInfo;
+ p->id = "account1";
+ p->tenant = "tenant1";
+ p->name = "name1";
+ p->email = "email@example.com";
+ p->max_users = 10;
+ p->max_roles = 10;
+ p->max_groups = 10;
+ p->max_buckets = 10;
+ p->max_access_keys = 10;
+ o.push_back(p);
+}
+
void RGWStorageStats::dump(Formatter *f) const
{
encode_json("size", size, f);
};
WRITE_CLASS_ENCODER(RGWUserInfo)
+// user account metadata
+struct RGWAccountInfo {
+ rgw_account_id id;
+ std::string tenant;
+ std::string name;
+ std::string email;
+ RGWQuotaInfo quota;
+
+ static constexpr int32_t DEFAULT_USER_LIMIT = 1000;
+ int32_t max_users = DEFAULT_USER_LIMIT;
+
+ static constexpr int32_t DEFAULT_ROLE_LIMIT = 1000;
+ int32_t max_roles = DEFAULT_ROLE_LIMIT;
+
+ static constexpr int32_t DEFAULT_GROUP_LIMIT = 1000;
+ int32_t max_groups = DEFAULT_GROUP_LIMIT;
+
+ static constexpr int32_t DEFAULT_BUCKET_LIMIT = 1000;
+ int32_t max_buckets = DEFAULT_BUCKET_LIMIT;
+
+ static constexpr int32_t DEFAULT_ACCESS_KEY_LIMIT = 4;
+ int32_t max_access_keys = DEFAULT_ACCESS_KEY_LIMIT;
+
+ void encode(bufferlist& bl) const {
+ ENCODE_START(1, 1, bl);
+ encode(id, bl);
+ encode(tenant, bl);
+ encode(name, bl);
+ encode(email, bl);
+ encode(quota, bl);
+ encode(max_users, bl);
+ encode(max_roles, bl);
+ encode(max_groups, bl);
+ encode(max_buckets, bl);
+ encode(max_access_keys, bl);
+ ENCODE_FINISH(bl);
+ }
+
+ void decode(bufferlist::const_iterator& bl) {
+ DECODE_START(1, bl);
+ decode(id, bl);
+ decode(tenant, bl);
+ decode(name, bl);
+ decode(email, bl);
+ decode(quota, bl);
+ decode(max_users, bl);
+ decode(max_roles, bl);
+ decode(max_groups, bl);
+ decode(max_buckets, bl);
+ decode(max_access_keys, bl);
+ DECODE_FINISH(bl);
+ }
+
+ void dump(Formatter* f) const;
+ void decode_json(JSONObj* obj);
+ static void generate_test_instances(std::list<RGWAccountInfo*>& o);
+};
+WRITE_CLASS_ENCODER(RGWAccountInfo)
+
/// `RGWObjVersionTracker`
/// ======================
///