|
|
|
|
@ -76,7 +76,7 @@ class FD_API(ServiceBase):
|
|
|
|
|
#return API version
|
|
|
|
|
@rpc(Unicode, _returns=Decimal())
|
|
|
|
|
def version(ctx, sessionid):
|
|
|
|
|
return(FD_API._version)
|
|
|
|
|
return({result: 'OK', version: FD_API._version})
|
|
|
|
|
|
|
|
|
|
@rpc()
|
|
|
|
|
def dummy(ctx):
|
|
|
|
|
@ -90,6 +90,7 @@ class FD_API(ServiceBase):
|
|
|
|
|
system = ctx.udc.validateKey(int(dmrid),key)
|
|
|
|
|
if system:
|
|
|
|
|
ctx.udc.reset(system)
|
|
|
|
|
return({result: 'OK'})
|
|
|
|
|
else:
|
|
|
|
|
raise error.InvalidCredentialsError()
|
|
|
|
|
|
|
|
|
|
@ -98,6 +99,7 @@ class FD_API(ServiceBase):
|
|
|
|
|
system = ctx.udc.validateKey(int(dmrid),key)
|
|
|
|
|
if system:
|
|
|
|
|
ctx.udc.options(system,options)
|
|
|
|
|
return({result: 'OK'})
|
|
|
|
|
else:
|
|
|
|
|
raise error.InvalidCredentialsError()
|
|
|
|
|
|
|
|
|
|
@ -105,7 +107,7 @@ class FD_API(ServiceBase):
|
|
|
|
|
def getoptions(ctx,dmrid,key):
|
|
|
|
|
system = ctx.udc.validateKey(int(dmrid),key)
|
|
|
|
|
if system:
|
|
|
|
|
return ctx.udc.getoptions(system)
|
|
|
|
|
return {result: 'OK', options: ctx.udc.getoptions(system)}
|
|
|
|
|
else:
|
|
|
|
|
raise error.InvalidCredentialsError()
|
|
|
|
|
|
|
|
|
|
@ -115,21 +117,22 @@ class FD_API(ServiceBase):
|
|
|
|
|
@rpc(Unicode)
|
|
|
|
|
def killserver(ctx,systemkey):
|
|
|
|
|
if ctx.udc.validateSystemKey(systemkey):
|
|
|
|
|
return ctx.udc.killserver()
|
|
|
|
|
ctx.udc.killserver()
|
|
|
|
|
return {result: 'OK'}
|
|
|
|
|
else:
|
|
|
|
|
raise error.InvalidCredentialsError()
|
|
|
|
|
|
|
|
|
|
@rpc(Unicode,_returns=Unicode())
|
|
|
|
|
def getconfig(ctx,systemkey):
|
|
|
|
|
if ctx.udc.validateSystemKey(systemkey):
|
|
|
|
|
return ctx.udc.getconfig()
|
|
|
|
|
return {result: 'OK', config: ctx.udc.getconfig()}
|
|
|
|
|
else:
|
|
|
|
|
raise error.InvalidCredentialsError()
|
|
|
|
|
|
|
|
|
|
@rpc(Unicode,_returns=Unicode())
|
|
|
|
|
def getbridges(ctx,systemkey):
|
|
|
|
|
if ctx.udc.validateSystemKey(systemkey):
|
|
|
|
|
return ctx.udc.getbridges()
|
|
|
|
|
return {result: 'OK', bridges: ctx.udc.getbridges()}
|
|
|
|
|
else:
|
|
|
|
|
raise error.InvalidCredentialsError()
|
|
|
|
|
|
|
|
|
|
|