Revice policy api
This commit is contained in:
parent
6298bf7b09
commit
5ff6ab5518
23
README.rst
23
README.rst
@ -1,4 +1,25 @@
|
|||||||
Bilean
|
Bilean
|
||||||
======
|
======
|
||||||
|
|
||||||
/Todo/
|
--------
|
||||||
|
Overview
|
||||||
|
--------
|
||||||
|
|
||||||
|
Bilean is a billing service for OpenStack clouds, it provides trigger-type
|
||||||
|
billing based on other OpenStack services' notification.
|
||||||
|
|
||||||
|
---------
|
||||||
|
Resources
|
||||||
|
---------
|
||||||
|
|
||||||
|
Launchpad Projects
|
||||||
|
------------------
|
||||||
|
- Server: https://launchpad.net/bilean
|
||||||
|
|
||||||
|
Blueprints
|
||||||
|
----------
|
||||||
|
- Blueprints: https://blueprints.launchpad.net/bilean
|
||||||
|
|
||||||
|
Bug Tracking
|
||||||
|
------------
|
||||||
|
- Bugs: https://bugs.launchpad.net/bilean
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
import routes
|
import routes
|
||||||
|
|
||||||
from bilean.api.openstack.v1 import events
|
from bilean.api.openstack.v1 import events
|
||||||
|
from bilean.api.openstack.v1 import policies
|
||||||
from bilean.api.openstack.v1 import resources
|
from bilean.api.openstack.v1 import resources
|
||||||
from bilean.api.openstack.v1 import rules
|
from bilean.api.openstack.v1 import rules
|
||||||
from bilean.api.openstack.v1 import users
|
from bilean.api.openstack.v1 import users
|
||||||
|
@ -101,7 +101,7 @@ class PolicyController(object):
|
|||||||
raise exc.HTTPUnprocessableEntity()
|
raise exc.HTTPUnprocessableEntity()
|
||||||
|
|
||||||
policy_data = body.get('policy', None)
|
policy_data = body.get('policy', None)
|
||||||
if profile_data is None:
|
if policy_data is None:
|
||||||
raise exc.HTTPBadRequest(_("Malformed request data, missing "
|
raise exc.HTTPBadRequest(_("Malformed request data, missing "
|
||||||
"'policy' key in request body."))
|
"'policy' key in request body."))
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ class PolicyController(object):
|
|||||||
raise exc.HTTPUnprocessableEntity()
|
raise exc.HTTPUnprocessableEntity()
|
||||||
|
|
||||||
policy_data = body.get('policy', None)
|
policy_data = body.get('policy', None)
|
||||||
if profile_data is None:
|
if policy_data is None:
|
||||||
raise exc.HTTPBadRequest(_("Malformed request data, missing "
|
raise exc.HTTPBadRequest(_("Malformed request data, missing "
|
||||||
"'policy' key in request body."))
|
"'policy' key in request body."))
|
||||||
|
|
||||||
@ -130,7 +130,6 @@ class PolicyController(object):
|
|||||||
metadata, is_default)
|
metadata, is_default)
|
||||||
return {'policy': policy}
|
return {'policy': policy}
|
||||||
|
|
||||||
|
|
||||||
@util.policy_enforce
|
@util.policy_enforce
|
||||||
def delete(self, req, policy_id):
|
def delete(self, req, policy_id):
|
||||||
"""Delete a policy with given policy_id"""
|
"""Delete a policy with given policy_id"""
|
||||||
|
Loading…
Reference in New Issue
Block a user