change routes to be more restful friendly

parent 717aaa24
......@@ -16,8 +16,8 @@ from flask.ext.login import current_user
ns = api.namespace('client', 'Client methods')
@ns.route('/client-tree.json/<name>/<int:backup>',
'/<server>/client-tree.json/<name>/<int:backup>',
@ns.route('/browse/<name>/<int:backup>',
'/<server>/browse/<name>/<int:backup>',
endpoint='client_tree')
class ClientTree(Resource):
"""The :class:`burpui.api.client.ClientTree` resource allows you to
......@@ -116,10 +116,10 @@ class ClientTree(Resource):
return j
@ns.route('/client-stats.json/<name>',
'/<server>/client-stats.json/<name>',
'/client-stats.json/<name>/<int:backup>',
'/<server>/client-stats.json/<name>/<int:backup>',
@ns.route('/stats/<name>',
'/<server>/stats/<name>',
'/stats/<name>/<int:backup>',
'/<server>/stats/<name>/<int:backup>',
endpoint='client_stats')
class ClientStats(Resource):
"""The :class:`burpui.api.client.ClientStats` resource allows you to
......@@ -357,8 +357,8 @@ class ClientStats(Resource):
return j
@ns.route('/client.json/<name>',
'/<server>/client.json/<name>',
@ns.route('/report/<name>',
'/<server>/report/<name>',
endpoint='client_report')
class ClientReport(Resource):
"""The :class:`burpui.api.client.ClientReport` resource allows you to
......
......@@ -18,10 +18,10 @@ from flask.ext.login import current_user
ns = api.namespace('clients', 'Clients methods')
@ns.route('/running-clients.json',
'/<server>/running-clients.json',
'/running-clients.json/<client>',
'/<server>/running-clients.json/<client>',
@ns.route('/running',
'/<server>/running',
'/running/<client>',
'/<server>/running/<client>',
endpoint='running_clients')
class RunningClients(Resource):
"""The :class:`burpui.api.clients.RunningClients` resource allows you to
......@@ -97,8 +97,8 @@ class RunningClients(Resource):
return r
@ns.route('/running.json',
'/<server>/running.json',
@ns.route('/is-running',
'/<server>/is-running',
endpoint='running_backup')
class RunningBackup(Resource):
"""The :class:`burpui.api.clients.RunningBackup` resource allows you to
......@@ -162,8 +162,8 @@ class RunningBackup(Resource):
return {'running': r}
@ns.route('/clients-report.json',
'/<server>/clients-report.json',
@ns.route('/report',
'/<server>/report',
endpoint='clients_report')
class ClientsReport(Resource):
"""The :class:`burpui.api.clients.ClientsReport` resource allows you to
......@@ -284,8 +284,8 @@ class ClientsReport(Resource):
return j
@ns.route('/clients.json',
'/<server>/clients.json',
@ns.route('/stats',
'/<server>/stats',
endpoint='clients_stats')
class ClientsStats(Resource):
"""The :class:`burpui.api.clients.ClientsStats` resource allows you to
......
......@@ -47,10 +47,10 @@ counters_fields = api.model('Counters', {
})
@ns.route('/counters.json',
'/<server>/counters.json',
'/counters.json/<name>',
'/<server>/counters.json/<name>',
@ns.route('/counters',
'/<server>/counters',
'/counters/<name>',
'/<server>/counters/<name>',
endpoint='counters')
class Counters(Resource):
"""The :class:`burpui.api.misc.Counters` resource allows you to
......@@ -130,8 +130,8 @@ class Counters(Resource):
return res
@ns.route('/live.json',
'/<server>/live.json',
@ns.route('/monitor',
'/<server>/monitor',
endpoint='live')
class Live(Resource):
"""The :class:`burpui.api.misc.Live` resource allows you to
......@@ -269,8 +269,8 @@ class Alert(Resource):
return {'message': message}, 201
@ns.route('/about.json',
'/<server>/about.json',
@ns.route('/about',
'/<server>/about',
endpoint='about')
class About(Resource):
"""The :class:`burpui.api.misc.About` resource allows you to retrieve
......
......@@ -10,7 +10,7 @@ from flask.ext.login import current_user
ns = api.namespace('servers', 'Servers methods')
@ns.route('/servers.json', endpoint='servers_stats')
@ns.route('/stats', endpoint='servers_stats')
class ServersStats(Resource):
"""The :class:`burpui.api.servers.ServersStats` resource allows you to
retrieve statistics about servers/agents.
......
......@@ -189,8 +189,8 @@ class ServerSettings(Resource):
defaults=api.bui.cli.get_parser_attr('defaults', server))
@ns.route('/clients.json',
'/<server>/clients.json',
@ns.route('/clients',
'/<server>/clients',
endpoint='clients_list')
class ClientsList(Resource):
......@@ -199,10 +199,10 @@ class ClientsList(Resource):
return jsonify(result=res)
@ns.route('/client/<client>/config',
'/client/<client>/config/<path:conf>',
'/<server>/client/<client>/config',
'/<server>/client/<client>/config/<path:conf>',
@ns.route('/config/<client>',
'/config/<client>/<path:conf>',
'/<server>/config/<client>',
'/<server>/config/<client>/<path:conf>',
endpoint='client_settings')
class ClientSettings(Resource):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment