summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-08-07 23:53:41 +0300
committermakkalot <makkalot@gmail.com>2008-08-07 23:53:41 +0300
commit8c793b1a62f56f3a3171ad9da1df1779e37ef313 (patch)
tree568bcc811f091f6c1bcfc5a4b563e52aa7e349ac
parent2a22380c72e143370c83b6d2072f84666901a64b (diff)
downloadfunc-8c793b1a62f56f3a3171ad9da1df1779e37ef313.tar.gz
func-8c793b1a62f56f3a3171ad9da1df1779e37ef313.tar.xz
func-8c793b1a62f56f3a3171ad9da1df1779e37ef313.zip
export the process module
-rw-r--r--func/minion/modules/process.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/func/minion/modules/process.py b/func/minion/modules/process.py
index 22141c3..fe8a9cc 100644
--- a/func/minion/modules/process.py
+++ b/func/minion/modules/process.py
@@ -218,3 +218,55 @@ class ProcessModule(func_module.FuncModule):
rc = sub_process.call(["/usr/bin/pkill", name, level],
executable="/usr/bin/pkill", shell=False)
return rc
+
+ def register_method_args(self):
+ """
+ Implementing the argument getter
+ """
+ return{
+ 'info':{
+ 'args':{
+ 'flags':{
+ 'type':'string',
+ 'default':'-auxh',
+ 'optional':True,
+ 'description':"Flags for ps command"
+ }
+ },
+ 'description':'Get the process info for system'
+ },
+ 'mem':{
+ 'args':{},
+ 'description':"Returns a list of per-program memory usage."
+ },
+ 'kill':{
+ 'args':{
+ 'pid':{
+ 'type':'int',
+ 'optional':False,
+ 'description':"The pid for process to be killed"
+ },
+ 'signal':{
+ 'type':'string',
+ 'optional':True,
+ 'default':"TERM",
+ 'description':"Signal to send before killing"
+ }
+ },
+ "description":"Kill a process with proper signal"
+ },
+ 'pkill':{
+ 'args':{
+ 'name':{
+ 'type':'string',
+ 'optional':False,
+ 'description':"The name of the app but with full path info ." },
+ 'level':{
+ 'type':'string',
+ 'optional':True,
+ 'description':"Level of killing"
+ }
+ },
+ "description":"Kill an app with supplying a name and level"
+ }
+ }