Adds api_export_size attribute to admin API

Closes-Bug: #1513226

Change-Id: I23bcb9ebab6ee56fcdbe5916533a4a8249291f8f
This commit is contained in:
sonu.kumar 2015-11-24 11:02:17 +05:30
parent e5e92222e2
commit 9fe1eea2a8
3 changed files with 7 additions and 1 deletions

View File

@ -30,6 +30,7 @@ class QuotasView(base_view.BaseView):
def show_basic(self, context, request, quota):
"""Basic view of a quota"""
return {
"api_export_size": quota['api_export_size'],
"zones": quota['zones'],
"zone_records": quota['zone_records'],
"zone_recordsets": quota['zone_recordsets'],
@ -39,6 +40,6 @@ class QuotasView(base_view.BaseView):
def load(self, context, request, body):
"""Extract a "central" compatible dict from an API call"""
valid_keys = ('zone_records', 'zone_recordsets', 'zones',
'recordset_records')
'recordset_records', 'api_export_size')
return self._load(context, request, body, valid_keys)

View File

@ -40,6 +40,7 @@ class AdminApiQuotasTest(AdminApiTestCase):
self.assertIn('quota', response.json)
self.assertIn('zones', response.json['quota'])
self.assertIn('api_export_size', response.json['quota'])
self.assertIn('zone_records', response.json['quota'])
self.assertIn('zone_recordsets', response.json['quota'])
self.assertIn('recordset_records', response.json['quota'])

View File

@ -59,6 +59,7 @@ Get Quotas
{
"quota": {
"api_export_size: 1000,
"zones": 10,
"recordset_records": 20,
"zone_records": 500,
@ -66,6 +67,8 @@ Get Quotas
}
}
:api_export_size: Number of records allowed in a synchronous zone export
done via API
:form zones: Number of zones the tenant is allowed to own
:form recordset_records: Number of records allowed per recordset
:form zone_records: Number of records allowed per zone
@ -107,6 +110,7 @@ Update Quotas
{
"quota": {
"api_export_size: 1000,
"zones": 1000,
"recordset_records": 20,
"zone_records": 50,