redesign endpoints
see: sca = scalpels.client.shell:main sca-manage = scalpels.cmd.manage:main # admin's behaviour sca-agent = scalpels.cmd.agent:main # agent daemon on node sca-tracer = scalpels.cmd.tracer:main # tracer process Change-Id: Ieb4fcde857290999e43aeb06a0eeac9149ea2bd7
This commit is contained in:
parent
472f4ae4d2
commit
28a26ff91f
@ -23,7 +23,7 @@ class TraceEndpoint(object):
|
|||||||
def tracer_list(self, ctx):
|
def tracer_list(self, ctx):
|
||||||
# TODO db_api
|
# TODO db_api
|
||||||
# XXX ctx required?
|
# XXX ctx required?
|
||||||
from scalpels.cli.utils import traces_map
|
from scalpels.client.utils import traces_map
|
||||||
return traces_map
|
return traces_map
|
||||||
|
|
||||||
def start_tracers(self, ctx, tracers):
|
def start_tracers(self, ctx, tracers):
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#-*- coding:utf-8 -*-
|
#-*- coding:utf-8 -*-
|
||||||
# Author: Kun Huang <academicgareth@gmail.com>
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
from scalpels.cli.api import api as agent_api
|
from scalpels.client.api import api as agent_api
|
||||||
from scalpels.cli.utils import generate_multiple_result_html
|
from scalpels.client.utils import generate_multiple_result_html
|
||||||
from scalpels.cli.utils import pprint_result
|
from scalpels.client.utils import pprint_result
|
||||||
|
|
||||||
|
|
||||||
def run(config):
|
def run(config):
|
@ -2,8 +2,8 @@
|
|||||||
#-*- coding:utf-8 -*-
|
#-*- coding:utf-8 -*-
|
||||||
# Author: Kun Huang <academicgareth@gmail.com>
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
from scalpels.cli.actions import report
|
from scalpels.client.actions import report
|
||||||
from scalpels.cli.api import api as agent_api
|
from scalpels.client.api import api as agent_api
|
||||||
|
|
||||||
def run(config):
|
def run(config):
|
||||||
"""
|
"""
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from scalpels.cli.api import api as agent_api
|
from scalpels.client.api import api as agent_api
|
||||||
|
|
||||||
def _parse_agents_from_args(config):
|
def _parse_agents_from_args(config):
|
||||||
parsed_agents = set()
|
parsed_agents = set()
|
@ -2,7 +2,7 @@
|
|||||||
#-*- coding:utf-8 -*-
|
#-*- coding:utf-8 -*-
|
||||||
# Author: Kun Huang <academicgareth@gmail.com>
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
from scalpels.cli.api import api as agent_api
|
from scalpels.client.api import api as agent_api
|
||||||
|
|
||||||
|
|
||||||
def run(config):
|
def run(config):
|
@ -2,7 +2,7 @@
|
|||||||
#-*- coding:utf-8 -*-
|
#-*- coding:utf-8 -*-
|
||||||
# Author: Kun Huang <academicgareth@gmail.com>
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
from scalpels.cli.api import api as agent_api
|
from scalpels.client.api import api as agent_api
|
||||||
from prettytable import PrettyTable
|
from prettytable import PrettyTable
|
||||||
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
|||||||
# Author: Kun Huang <academicgareth@gmail.com>
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
|
|
||||||
from scalpels.cli.rpcapi import rpcapi
|
from scalpels.client.rpcapi import rpcapi
|
||||||
from scalpels.cli.utils import UUID_LOWEST_SUPPORT
|
from scalpels.client.utils import UUID_LOWEST_SUPPORT
|
||||||
|
|
||||||
class API(object):
|
class API(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
@ -8,7 +8,7 @@ import importlib
|
|||||||
|
|
||||||
def run(parser):
|
def run(parser):
|
||||||
config = parser.__dict__
|
config = parser.__dict__
|
||||||
modstr = "scalpels.cli.actions.%s" % config.pop("action")
|
modstr = "scalpels.client.actions.%s" % config.pop("action")
|
||||||
mod = importlib.import_module(modstr)
|
mod = importlib.import_module(modstr)
|
||||||
func = getattr(mod, "run")
|
func = getattr(mod, "run")
|
||||||
return func(config)
|
return func(config)
|
0
scalpels/cmd/__init__.py
Normal file
0
scalpels/cmd/__init__.py
Normal file
9
scalpels/cmd/agent.py
Normal file
9
scalpels/cmd/agent.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#-*- coding:utf-8 -*-
|
||||||
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
|
def main():
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
9
scalpels/cmd/tracer.py
Normal file
9
scalpels/cmd/tracer.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#-*- coding:utf-8 -*-
|
||||||
|
# Author: Kun Huang <academicgareth@gmail.com>
|
||||||
|
|
||||||
|
def main():
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -18,7 +18,7 @@ python <path-to-dir>/agent.py <uuid> mysql
|
|||||||
|
|
||||||
def read_from_ag(ag):
|
def read_from_ag(ag):
|
||||||
# wrong impl. here, need read from config or db instead
|
# wrong impl. here, need read from config or db instead
|
||||||
from scalpels.cli.utils import tracers_map as agents_map
|
from scalpels.client.utils import tracers_map as agents_map
|
||||||
data_dir = db_api.setup_config_get()["data_dir"].rstrip("/")
|
data_dir = db_api.setup_config_get()["data_dir"].rstrip("/")
|
||||||
return agents_map.get(ag) % data_dir
|
return agents_map.get(ag) % data_dir
|
||||||
|
|
||||||
|
@ -27,5 +27,7 @@ packages = scalpels
|
|||||||
|
|
||||||
[entry_points]
|
[entry_points]
|
||||||
console_scripts =
|
console_scripts =
|
||||||
sca = scalpels.cli.shell:main
|
sca = scalpels.client.shell:main
|
||||||
sca-m = scalpels.cli.manage:main
|
sca-manage = scalpels.cmd.manage:main
|
||||||
|
sca-agent = scalpels.cmd.agent:main
|
||||||
|
sca-tracer = scalpels.cmd.tracer:main
|
||||||
|
Loading…
Reference in New Issue
Block a user