From d5bbfad3d06e8801d70f4efce84c9504519efbc3 Mon Sep 17 00:00:00 2001 From: gengjh Date: Mon, 1 Apr 2013 22:11:50 +0800 Subject: Enhance the validation of the quotas update Need check whether the already used and reserved exceeds the new quota before update it. DocImpact Implements a validation to validate whether already used and reserved quota exceeds the new quota when run 'nova quota-update', it will throw error if the quota exceeds. This check will be ignored if admin want to force update when run 'nova quota-update' with additional option '--force'. This validation help admin to be aware of whether the quotas are oversold when they try to update quota and also provide an option '--force' to allow admin force update the quotas. Fix bug 1160749 Change-Id: Iba3cee0f0d92cf2e6d64bc83830b0091992d1ee9 --- doc/api_samples/all_extensions/extensions-get-resp.json | 6 +++--- doc/api_samples/all_extensions/extensions-get-resp.xml | 4 ++-- .../os-extended-quotas/quotas-update-post-req.json | 6 ++++++ .../os-extended-quotas/quotas-update-post-req.xml | 5 +++++ .../os-extended-quotas/quotas-update-post-resp.json | 16 ++++++++++++++++ .../os-extended-quotas/quotas-update-post-resp.xml | 15 +++++++++++++++ 6 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 doc/api_samples/os-extended-quotas/quotas-update-post-req.json create mode 100644 doc/api_samples/os-extended-quotas/quotas-update-post-req.xml create mode 100644 doc/api_samples/os-extended-quotas/quotas-update-post-resp.json create mode 100644 doc/api_samples/os-extended-quotas/quotas-update-post-resp.xml (limited to 'doc') diff --git a/doc/api_samples/all_extensions/extensions-get-resp.json b/doc/api_samples/all_extensions/extensions-get-resp.json index b4323b097..ba23bad1e 100644 --- a/doc/api_samples/all_extensions/extensions-get-resp.json +++ b/doc/api_samples/all_extensions/extensions-get-resp.json @@ -426,11 +426,11 @@ }, { "alias": "os-extended-quotas", - "description": "Adds ability for admins to delete quota", + "description": "Adds ability for admins to delete quota and optionally force the update Quota command.", "links": [], "name": "ExtendedQuotas", - "namespace": "http://docs.openstack.org/compute/ext/quota-delete/api/v1.1", - "updated": "2013-05-23T00:00:00+00:00" + "namespace": "http://docs.openstack.org/compute/ext/extended_quotas/api/v1.1", + "updated": "2013-06-09T00:00:00+00:00" }, { "alias": "os-quota-sets", diff --git a/doc/api_samples/all_extensions/extensions-get-resp.xml b/doc/api_samples/all_extensions/extensions-get-resp.xml index 26361e719..64e24b9af 100644 --- a/doc/api_samples/all_extensions/extensions-get-resp.xml +++ b/doc/api_samples/all_extensions/extensions-get-resp.xml @@ -177,8 +177,8 @@ Quota classes management support. - - Adds ability for admins to delete quota. + + Adds ability for admins to delete quota and optionally force the update Quota command. Quotas management support. diff --git a/doc/api_samples/os-extended-quotas/quotas-update-post-req.json b/doc/api_samples/os-extended-quotas/quotas-update-post-req.json new file mode 100644 index 000000000..a58a17912 --- /dev/null +++ b/doc/api_samples/os-extended-quotas/quotas-update-post-req.json @@ -0,0 +1,6 @@ +{ + "quota_set": { + "force": "True", + "instances": 45 + } +} diff --git a/doc/api_samples/os-extended-quotas/quotas-update-post-req.xml b/doc/api_samples/os-extended-quotas/quotas-update-post-req.xml new file mode 100644 index 000000000..499b890f0 --- /dev/null +++ b/doc/api_samples/os-extended-quotas/quotas-update-post-req.xml @@ -0,0 +1,5 @@ + + + True + 45 + \ No newline at end of file diff --git a/doc/api_samples/os-extended-quotas/quotas-update-post-resp.json b/doc/api_samples/os-extended-quotas/quotas-update-post-resp.json new file mode 100644 index 000000000..d9024b77d --- /dev/null +++ b/doc/api_samples/os-extended-quotas/quotas-update-post-resp.json @@ -0,0 +1,16 @@ +{ + "quota_set": { + "cores": 20, + "fixed_ips": -1, + "floating_ips": 10, + "injected_file_content_bytes": 10240, + "injected_file_path_bytes": 255, + "injected_files": 5, + "instances": 45, + "key_pairs": 100, + "metadata_items": 128, + "ram": 51200, + "security_group_rules": 20, + "security_groups": 10 + } +} diff --git a/doc/api_samples/os-extended-quotas/quotas-update-post-resp.xml b/doc/api_samples/os-extended-quotas/quotas-update-post-resp.xml new file mode 100644 index 000000000..cd1b80ba0 --- /dev/null +++ b/doc/api_samples/os-extended-quotas/quotas-update-post-resp.xml @@ -0,0 +1,15 @@ + + + 20 + -1 + 10 + 10240 + 255 + 5 + 45 + 100 + 128 + 51200 + 20 + 10 + -- cgit