mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Add status API command
This commit is contained in:
parent
235d6f259e
commit
4743538de8
3 changed files with 51 additions and 0 deletions
18
API.md
18
API.md
|
@ -2645,6 +2645,24 @@ Returns:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### status
|
||||||
|
Get the current status of Tautulli.
|
||||||
|
|
||||||
|
```
|
||||||
|
Required parameters:
|
||||||
|
None
|
||||||
|
|
||||||
|
Optional parameters:
|
||||||
|
None
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
json:
|
||||||
|
{"result": "success",
|
||||||
|
"message": "Ok",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### terminate_session
|
### terminate_session
|
||||||
Stop a streaming session.
|
Stop a streaming session.
|
||||||
|
|
||||||
|
|
|
@ -5860,3 +5860,26 @@ class WebInterface(object):
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
def support(self, query='', **kwargs):
|
def support(self, query='', **kwargs):
|
||||||
return serve_template(templatename="support.html", title="Support")
|
return serve_template(templatename="support.html", title="Support")
|
||||||
|
|
||||||
|
@cherrypy.expose
|
||||||
|
@cherrypy.tools.json_out()
|
||||||
|
@addtoapi()
|
||||||
|
def status(self, *args, **kwargs):
|
||||||
|
""" Get the current status of Tautulli.
|
||||||
|
|
||||||
|
```
|
||||||
|
Required parameters:
|
||||||
|
None
|
||||||
|
|
||||||
|
Optional parameters:
|
||||||
|
None
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
json:
|
||||||
|
{"result": "success",
|
||||||
|
"message": "Ok",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
"""
|
||||||
|
cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
|
||||||
|
return {'result': 'success', 'message': 'Ok'}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from urllib import urlencode
|
||||||
|
|
||||||
import plexpy
|
import plexpy
|
||||||
import cherrypy
|
import cherrypy
|
||||||
|
@ -112,6 +113,9 @@ def initialize(options):
|
||||||
'/api': {
|
'/api': {
|
||||||
'tools.auth_basic.on': False
|
'tools.auth_basic.on': False
|
||||||
},
|
},
|
||||||
|
'/status': {
|
||||||
|
'tools.auth_basic.on': False
|
||||||
|
},
|
||||||
'/interfaces': {
|
'/interfaces': {
|
||||||
'tools.staticdir.on': True,
|
'tools.staticdir.on': True,
|
||||||
'tools.staticdir.dir': "interfaces",
|
'tools.staticdir.dir': "interfaces",
|
||||||
|
@ -231,6 +235,12 @@ class BaseRedirect(object):
|
||||||
def index(self):
|
def index(self):
|
||||||
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
|
||||||
|
|
||||||
|
@cherrypy.expose
|
||||||
|
def status(self, *args, **kwargs):
|
||||||
|
path = '/' + '/'.join(args) if args else ''
|
||||||
|
query = '?' + urlencode(kwargs) if kwargs else ''
|
||||||
|
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + 'status' + path + query)
|
||||||
|
|
||||||
|
|
||||||
def proxy():
|
def proxy():
|
||||||
# logger.debug(u"REQUEST URI: %s, HEADER [X-Forwarded-Host]: %s, [X-Host]: %s, [Origin]: %s, [Host]: %s",
|
# logger.debug(u"REQUEST URI: %s, HEADER [X-Forwarded-Host]: %s, [X-Host]: %s, [Origin]: %s, [Host]: %s",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue