5 Commits

Author SHA1 Message Date
Nguyen Hung Phuong
b6f2257118 Clean imports in code
In some part in the code we import objects.
In the Openstack style guidelines they recommend to import only modules.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: Ibd3464b52fd70bbfe77ce35cdffbbef95de24b12
2016-08-18 11:52:58 +07:00
Dave McCowan
231e0a80dd Add Project Quota Support for Sub CAs
With the addition of Sub CAs in Barbican, comes another resource that
can be created by project admins.  To prevent one project admin from
impacting other projects, quotas can be enforced.  This commit adds
quota management and enforcement for the CA resource.

Change-Id: Iee7fb433e0879bc8739ba62f0a34e73b2103c5fa
Partially-implements: blueprint add-cas
2015-09-09 16:02:06 -04:00
Dave McCowan
d7331c7db6 Remove Vestigial Transport Key Quota Code
During development of the project quotas, I discovered that transport keys
are defined one per plugin.  They can not be created or deleted by a
project admin.  As such, quotas should not and can not apply to transport
keys.  Some stray snippets of transport key quota key leaked into the
commits.  This commit removes them.

Change-Id: I6f81fceec780c941dc7f731d02a8d6fe5d5fff40
Relates-to: blueprint quota-support-on-barbican-resources
2015-09-09 17:51:14 +00:00
Dave McCowan
023ccbbefc Implement Models and Repositories for Resource Quotas
In the interest of smaller CRs, this CR partially implements the
quota support blueprint.  It includes code model and repository
used to store project quota information.  Unit and functional tests
are also provided to verify the implementation.

This CR also cover some small design changes, such as: the new
defaults is for unlimited quotas for all resources.

Implements: blueprint quota-support-on-barbican-resources

Change-Id: Ief79dd36fd35528c9d8586d77e01d1f9ad723f4d
2015-08-20 15:50:31 -04:00
Dave McCowan
ce5b32ac13 Implement Configuration, Controllers, and Validators for Resource Quotas
In the interest of smaller CRs, this CR partially implements the
quota support blueprint.  It includes code for configuration,
controller, and validator.  Also, the framework for unit and functional
tests.

The controllers process the URL rsources /qoutas and /project-quotas.
The configuration code reads the quota default values from the [quotas]
section of barbican.conf.  The validator code checks the validity of
the JSON sent with a POST /project-quotas/ API command.

Implements: blueprint quota-support-on-barbican-resources
Change-Id: Iad09b19cf6b9a6fa6b29d8b99e3f72172f801070
2015-07-13 16:24:55 +00:00