quota is set for all subsequently-created users, and that quota is enabled. See
``rgw_bucket_default_quota_max_objects``,
``rgw_bucket_default_quota_max_size``, ``rgw_user_default_quota_max_objects``,
-and ``rgw_user_default_quota_max_size`` in `Ceph Object Gateway Config
-Reference`_
+``rgw_user_default_quota_max_size``, ``rgw_account_default_quota_max_objects``,
+and ``rgw_account_default_quota_max_size`` in `Ceph Object Gateway Config
+Reference`_.
Quota Cache
-----------
.. confval:: rgw_bucket_default_quota_max_size
.. confval:: rgw_user_default_quota_max_objects
.. confval:: rgw_user_default_quota_max_size
+.. confval:: rgw_account_default_quota_max_objects
+.. confval:: rgw_account_default_quota_max_size
.. confval:: rgw_verify_ssl
.. confval:: rgw_max_chunk_size
services:
- rgw
with_legacy: true
+- name: rgw_account_default_quota_max_objects
+ type: int
+ level: basic
+ desc: Account quota max objects
+ long_desc: The default quota configuration for total number of objects for a single
+ account. A negative number means 'unlimited'.
+ fmt_desc: Default max number of objects for a account. This includes all
+ objects in all buckets owned by the account. Set on new accounts
+ if no other quota is specified. Has no effect on existing accounts.
+ default: -1
+ services:
+ - rgw
+ with_legacy: true
+- name: rgw_account_default_quota_max_size
+ type: int
+ level: basic
+ desc: Account quota max size
+ long_desc: The default quota configuration for total size of objects for a single
+ account. A negative number means 'unlimited'.
+ fmt_desc: The value for account max size quota in bytes set on new accounts,
+ if no other quota is specified. Has no effect on existing accounts.
+ default: -1
+ services:
+ - rgw
+ with_legacy: true
- name: rgw_multipart_min_part_size
type: size
level: advanced
#include "common/utf8.h"
#include "rgw_oidc_provider.h"
+#include "rgw_quota.h"
#include "rgw_role.h"
#include "rgw_sal.h"
info.max_buckets = *op_state.max_buckets;
}
+ const ConfigProxy& conf = dpp->get_cct()->_conf;
+ rgw_apply_default_account_quota(info.quota, conf);
+ rgw_apply_default_bucket_quota(info.bucket_quota, conf);
+
// account id is optional, but must be valid
if (op_state.account_id.empty()) {
info.id = generate_id(dpp->get_cct());
}
}
+void rgw_apply_default_account_quota(RGWQuotaInfo& quota, const ConfigProxy& conf)
+{
+ if (conf->rgw_account_default_quota_max_objects >= 0) {
+ quota.max_objects = conf->rgw_account_default_quota_max_objects;
+ quota.enabled = true;
+ }
+ if (conf->rgw_account_default_quota_max_size >= 0) {
+ quota.max_size = conf->rgw_account_default_quota_max_size;
+ quota.enabled = true;
+ }
+}
+
void RGWQuotaInfo::dump(Formatter *f) const
{
f->dump_bool("enabled", enabled);
#include "common/lru_map.h"
#include "rgw/rgw_quota_types.h"
+#include "rgw/rgw_user_types.h"
#include "common/async/yield_context.h"
#include "rgw_sal_fwd.h"
// apply default quotas from configuration
void rgw_apply_default_bucket_quota(RGWQuotaInfo& quota, const ConfigProxy& conf);
void rgw_apply_default_user_quota(RGWQuotaInfo& quota, const ConfigProxy& conf);
+void rgw_apply_default_account_quota(RGWQuotaInfo& quota, const ConfigProxy& conf);