Add status API command

This commit is contained in:
JonnyWong16 2019-05-11 09:02:18 -07:00
parent 235d6f259e
commit 4743538de8
3 changed files with 51 additions and 0 deletions

View file

@ -15,6 +15,7 @@
import os
import sys
from urllib import urlencode
import plexpy
import cherrypy
@ -112,6 +113,9 @@ def initialize(options):
'/api': {
'tools.auth_basic.on': False
},
'/status': {
'tools.auth_basic.on': False
},
'/interfaces': {
'tools.staticdir.on': True,
'tools.staticdir.dir': "interfaces",
@ -231,6 +235,12 @@ class BaseRedirect(object):
def index(self):
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():
# logger.debug(u"REQUEST URI: %s, HEADER [X-Forwarded-Host]: %s, [X-Host]: %s, [Origin]: %s, [Host]: %s",