summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/resources
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/resources')
-rw-r--r--testapi/opnfv_testapi/resources/handlers.py14
-rw-r--r--testapi/opnfv_testapi/resources/pod_models.py3
2 files changed, 12 insertions, 5 deletions
diff --git a/testapi/opnfv_testapi/resources/handlers.py b/testapi/opnfv_testapi/resources/handlers.py
index ed55c70..8e5dab2 100644
--- a/testapi/opnfv_testapi/resources/handlers.py
+++ b/testapi/opnfv_testapi/resources/handlers.py
@@ -73,7 +73,10 @@ class GenericApiHandler(web.RequestHandler):
cls_data = self.table_cls.from_dict(data)
return cls_data.format_http()
- @check.authenticate
+ @web.asynchronous
+ @gen.coroutine
+ @check.is_authorized
+ @check.valid_token
@check.no_body
@check.miss_fields
@check.carriers_exist
@@ -172,13 +175,15 @@ class GenericApiHandler(web.RequestHandler):
def _get_one(self, data, query=None):
self.finish_request(self.format_data(data))
- @check.authenticate
+ @web.asynchronous
+ @gen.coroutine
@check.not_exist
def _delete(self, data, query=None):
yield dbapi.db_delete(self.table, query)
self.finish_request()
- @check.authenticate
+ @web.asynchronous
+ @gen.coroutine
@check.no_body
@check.not_exist
@check.updated_one_not_exist
@@ -189,7 +194,8 @@ class GenericApiHandler(web.RequestHandler):
update_req['_id'] = str(data._id)
self.finish_request(update_req)
- @check.authenticate
+ @web.asynchronous
+ @gen.coroutine
@check.no_body
@check.not_exist
@check.updated_one_not_exist
diff --git a/testapi/opnfv_testapi/resources/pod_models.py b/testapi/opnfv_testapi/resources/pod_models.py
index 2c3ea97..415d3d6 100644
--- a/testapi/opnfv_testapi/resources/pod_models.py
+++ b/testapi/opnfv_testapi/resources/pod_models.py
@@ -29,13 +29,14 @@ class PodCreateRequest(models.ModelBase):
class Pod(models.ModelBase):
def __init__(self,
name='', mode='', details='',
- role="", _id='', create_date=''):
+ role="", _id='', create_date='', owner=''):
self.name = name
self.mode = mode
self.details = details
self.role = role
self._id = _id
self.creation_date = create_date
+ self.owner = owner
@swagger.model()