From 9fe1eea2a840abd1268d5bead527d551ad861406 Mon Sep 17 00:00:00 2001 From: "sonu.kumar" Date: Tue, 24 Nov 2015 11:02:17 +0530 Subject: [PATCH] Adds api_export_size attribute to admin API Closes-Bug: #1513226 Change-Id: I23bcb9ebab6ee56fcdbe5916533a4a8249291f8f --- designate/api/admin/views/extensions/quotas.py | 3 ++- designate/tests/test_api/test_admin/extensions/test_quotas.py | 1 + doc/source/rest/admin/quotas.rst | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/designate/api/admin/views/extensions/quotas.py b/designate/api/admin/views/extensions/quotas.py index 9a6954cd5..e4091b62d 100644 --- a/designate/api/admin/views/extensions/quotas.py +++ b/designate/api/admin/views/extensions/quotas.py @@ -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) diff --git a/designate/tests/test_api/test_admin/extensions/test_quotas.py b/designate/tests/test_api/test_admin/extensions/test_quotas.py index 4c25d79a4..1af5a65f5 100644 --- a/designate/tests/test_api/test_admin/extensions/test_quotas.py +++ b/designate/tests/test_api/test_admin/extensions/test_quotas.py @@ -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']) diff --git a/doc/source/rest/admin/quotas.rst b/doc/source/rest/admin/quotas.rst index 8a5b07d51..d04a471b0 100644 --- a/doc/source/rest/admin/quotas.rst +++ b/doc/source/rest/admin/quotas.rst @@ -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,