mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 23:42:37 -07:00
Add terminate session to API
This commit is contained in:
parent
992f0baf93
commit
cea851d38e
2 changed files with 58 additions and 0 deletions
|
@ -280,6 +280,33 @@ class WebInterface(object):
|
|||
logger.warn(u"Unable to retrieve data for get_current_activity_header.")
|
||||
return serve_template(templatename="current_activity_header.html", data=None)
|
||||
|
||||
@cherrypy.expose
|
||||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def terminate_session(self, session_id=None, message=None, **kwargs):
|
||||
""" Add a new notification agent.
|
||||
|
||||
```
|
||||
Required parameters:
|
||||
session_id (str): The id of the session to terminate
|
||||
message (str): A custom message to send to the client
|
||||
|
||||
Optional parameters:
|
||||
None
|
||||
|
||||
Returns:
|
||||
None
|
||||
```
|
||||
"""
|
||||
pms_connect = pmsconnect.PmsConnect()
|
||||
result = pms_connect.terminate_session(session_id=session_id, message=message)
|
||||
|
||||
if result:
|
||||
return {'result': 'success', 'message': 'Session terminated.'}
|
||||
else:
|
||||
return {'result': 'error', 'message': 'Failed to terminate session.'}
|
||||
|
||||
@cherrypy.expose
|
||||
@requireAuth()
|
||||
def home_stats(self, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue