Commit Graph

14 Commits

Author SHA1 Message Date
creslinux
63c16b7f83 Moved routes that do not need access to rpc.rpc self into their own
common file.

This is to reduce file size and separate api server routes with
privilege to access rpc.rpc defs and those that do not need access,
so should not.
2018-06-25 14:03:34 +00:00
creslinux
0b061fda97 removed change to cleanup() in api_server.py 2018-06-25 14:03:34 +00:00
creslinux
60b24a8aa7 Added api server shutdown function, and exposed on HTTP as /stop_api url
This will stop the running app gracefully - processing current api calls
then shutting the werkzueg (run) listening server.

Have also called this from the cleanup placeholder.
I'm not sure this is what is intended by cleanup def.
By which I mean there may be a thread left running with no app within -
not sure how to check this just yet.

tidied excessive logging.
2018-06-25 14:03:34 +00:00
creslinux
ab2cf1bbfe Added api server shutdown function, and exposed on HTTP as /stop_api url
This will stop the running app gracefully - processing current api calls
then shutting the werkzueg (run) listening server.

Have also called this from the cleanup placeholder.
I'm not sure this is what is intended by cleanup def.
By which I mean there may be a thread left running with no app within -
not sure how to check this just yet.

tidied excessive logging.
2018-06-25 14:03:34 +00:00
creslinux
dc1aebf391 Updated def comments to be __docstring__ compatible 2018-06-25 14:03:34 +00:00
creslinux
2ac6a225be flake 8 fix 2018-06-25 14:03:34 +00:00
creslinux
f590f514f3 moved default page "/" index into self_register_other()
out of the block of URLs that call rpc.rcp functionality.
2018-06-25 14:03:34 +00:00
creslinux
ce251a965e Moved registering application urls out of the run def
and into their own

Added 404 handling

Split registration of URLs that use rpc.rpc and others into
own def. Seems logical to be able to register separately for later use.
2018-06-25 14:03:34 +00:00
gcarq
a92f0c2125 api_server: fix flake8 warnings and implement missing methods 2018-06-25 14:03:28 +00:00
gcarq
913cb80a33 convert start, stop and reload_conf to return a dict 2018-06-25 14:03:25 +00:00
gcarq
446c621006 move endpoint definitions to class scope 2018-06-25 14:03:25 +00:00
gcarq
75de61843b fix flake8 warnings 2018-06-25 14:03:22 +00:00
creslinux
d7dfa00cb3 Moved from decorators to app.add_url_rule
This has the benefit of creating a label which may be helpful if later
refactoring.

This change misses the main thrust of requests from both Gcarq and Shusso to
better layout the code

Im running into a challenge with 'self' not being available, or able to be
passed in either to decorators or view_func

This may simply be how I've instantiated an RPC in the wuperwrap or im within a thread
 - my very limited exposure to programming is at play! After moving code around
 lots of ways to no success and google not being helpful im committing for further feeback
2018-06-25 14:03:22 +00:00
creslinux
9aa08ec3c1 Added json validation of formats to check IPv4
refactored files and calls to be api_server
worked down satisfying review comments of last commit
2018-06-25 14:03:22 +00:00