update routes

This commit is contained in:
Yeqing Zhang
2019-02-15 12:33:19 +08:00
parent 39b687f0d1
commit c9e24f1bc2
3 changed files with 25 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ class DeployApi(BaseApi):
col_name = 'deploys'
arguments = (
('spider_id', str),
('node_id', str),
)

18
routes/node.py Normal file
View File

@@ -0,0 +1,18 @@
from app import api
from routes.base import BaseApi
class NodeApi(BaseApi):
col_name = 'nodes'
arguments = (
('node_ip', str),
('node_name', str),
('node_description', str),
)
api.add_resource(NodeApi,
'/api/nodes',
'/api/nodes/<string:id>',
'/api/nodes/<string:id>/<string:action>')

View File

@@ -5,6 +5,11 @@ from routes.base import BaseApi
class TaskApi(BaseApi):
col_name = 'tasks_celery'
arguments = (
('deploy_id', str),
('file_path', str)
)
# add api to resources
api.add_resource(TaskApi,