Author: remi
Date: 2008-12-15 10:13:17 +0100 (Mon, 15 Dec 2008)
New Revision: 3121
Modified:
software_suite_v2/software/http_server_resources/idle_behavior/trunk/ResourceTuxIdle.py
Log:
* added a service to retrieve the current resource working state.
(idle_behavior/state?)
Modified:
software_suite_v2/software/http_server_resources/idle_behavior/trunk/ResourceTuxIdle.py
===================================================================
---
software_suite_v2/software/http_server_resources/idle_behavior/trunk/ResourceTuxIdle.py
2008-12-14 15:44:36 UTC (rev 3120)
+++
software_suite_v2/software/http_server_resources/idle_behavior/trunk/ResourceTuxIdle.py
2008-12-15 09:13:17 UTC (rev 3121)
@@ -191,3 +191,24 @@
funct_idle_behavior_stop,
"IdleBehavior",
"Stop the service.")
+
+# -------------------------------------------------------------------------
+# /idle_behavior/state?
+# -------------------------------------------------------------------------
+def funct_idle_behavior_state(id_client, parameters):
+ global IBMyConf
+
+ content_struct = copy.deepcopy(DEFAULT_CONTENT_STRUCT)
+ content_struct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ content_struct['root']['data'] = {}
+ content_struct['root']['data']['state'] = IBMyConf['active']
+
+ content = structToXML(content_struct, True)
+
+ return DEFAULT_HEADERS, content
+
+Glb_ServiceContainer.createService('/idle_behavior/state?',
+ TDCC_LEVEL_FREE_CLIENT,
+ funct_idle_behavior_state,
+ "IdleBehavior",
+ "Get the state of the service.")
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn