Add snapshot related data to limits api

When calling the limits api we can only get Volume and Gigabyte data,
the snapshot related limit value should be returned too.

Change-Id: I6a5e1e2d1aa6abbac5d5dacd042223ce49207c1f
Closes-bug: 1282924
This commit is contained in:
liyingjun 2014-02-21 02:58:58 +08:00
parent d6b3b12820
commit c9c6befe7e
3 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class UsedLimitsController(wsgi.Controller):
quota_map = {
'totalVolumesUsed': 'volumes',
'totalGigabytesUsed': 'gigabytes',
'totalSnapshotsUsed': 'snapshots',
}
used_limits = {}

View File

@ -47,6 +47,7 @@ class ViewBuilder(object):
"cores": ["maxTotalCores"],
"gigabytes": ["maxTotalVolumeGigabytes"],
"volumes": ["maxTotalVolumes"],
"snapshots": ["maxTotalSnapshots"],
"key_pairs": ["maxTotalKeypairs"],
"floating_ips": ["maxTotalFloatingIps"],
"metadata_items": ["maxServerMeta", "maxImageMeta"],

View File

@ -45,6 +45,7 @@ class UsedLimitsTestCase(test.TestCase):
quota_map = {
'totalVolumesUsed': 'volumes',
'totalGigabytesUsed': 'gigabytes',
'totalSnapshotsUsed': 'snapshots',
}
limits = {}