mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-24 00:21:41 +02:00
2021-12-13 Fred Gleason <fredg@paravelsystems.com>
* Added a 'LogLock()' type class to the 'rivwebpyapi' API. * Modified the 'rivwebpyapi.LockLog()' call to return a 'rivwebpyapi.LogLock' object. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
da9cb3eae3
commit
d276d58aac
@ -22783,3 +22783,7 @@
|
|||||||
* Added a 'SystemSettings()' type class to the 'rivwebpyapi' API.
|
* Added a 'SystemSettings()' type class to the 'rivwebpyapi' API.
|
||||||
* Modified the 'rivwebpyapi.ListSystemSettings()' call to return
|
* Modified the 'rivwebpyapi.ListSystemSettings()' call to return
|
||||||
a 'rivwebpyapi.SystemSettings' object.
|
a 'rivwebpyapi.SystemSettings' object.
|
||||||
|
2021-12-13 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Added a 'LogLock()' type class to the 'rivwebpyapi' API.
|
||||||
|
* Modified the 'rivwebpyapi.LockLog()' call to return
|
||||||
|
a 'rivwebpyapi.LogLock' object.
|
||||||
|
@ -233,6 +233,14 @@ LOGLINE_FIELDS={
|
|||||||
'extAnncType': 'string'
|
'extAnncType': 'string'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG_LOCK_FIELDS={
|
||||||
|
'result': 'boolean',
|
||||||
|
'logName': 'string',
|
||||||
|
'lockGuid': 'string',
|
||||||
|
'address': 'string',
|
||||||
|
'lockTimeout': 'integer'
|
||||||
|
}
|
||||||
|
|
||||||
SCHEDULER_CODE_FIELDS={
|
SCHEDULER_CODE_FIELDS={
|
||||||
'code': 'string',
|
'code': 'string',
|
||||||
'description': 'string'
|
'description': 'string'
|
||||||
@ -455,6 +463,10 @@ class LogLine(RivendellType):
|
|||||||
def __init__(self,values={}):
|
def __init__(self,values={}):
|
||||||
super().__init__(LOGLINE_FIELDS,values)
|
super().__init__(LOGLINE_FIELDS,values)
|
||||||
|
|
||||||
|
class LogLock(RivendellType):
|
||||||
|
def __init__(self,values={}):
|
||||||
|
super().__init__(LOG_LOCK_FIELDS,values)
|
||||||
|
|
||||||
class SchedulerCode(RivendellType):
|
class SchedulerCode(RivendellType):
|
||||||
def __init__(self,values={}):
|
def __init__(self,values={}):
|
||||||
super().__init__(SCHEDULER_CODE_FIELDS,values)
|
super().__init__(SCHEDULER_CODE_FIELDS,values)
|
||||||
@ -1743,7 +1755,7 @@ class rivwebpyapi(object):
|
|||||||
|
|
||||||
def LockLog(self,log_name,operation,guid):
|
def LockLog(self,log_name,operation,guid):
|
||||||
"""
|
"""
|
||||||
Manage the lock for the specified log (dictionary).
|
Manage the lock for the specified log (rivwebpyapi.LogLock object).
|
||||||
|
|
||||||
Takes the following argument:
|
Takes the following argument:
|
||||||
|
|
||||||
@ -1795,7 +1807,7 @@ class rivwebpyapi(object):
|
|||||||
handler=RivWebPyApi_ListHandler(base_tag='logLock',fields=fields)
|
handler=RivWebPyApi_ListHandler(base_tag='logLock',fields=fields)
|
||||||
xml.sax.parseString(r.text,handler)
|
xml.sax.parseString(r.text,handler)
|
||||||
|
|
||||||
return handler.output()[0]
|
return LogLock(handler.output()[0])
|
||||||
|
|
||||||
def PostImage(self,image_id):
|
def PostImage(self,image_id):
|
||||||
"""
|
"""
|
||||||
|
@ -78,7 +78,7 @@ if((operation!='CREATE')and(not guid)):
|
|||||||
#
|
#
|
||||||
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
webapi=rivwebpyapi.rivwebpyapi(url=url,username=username,password=password)
|
||||||
try:
|
try:
|
||||||
result=webapi.LockLog(log_name=log_name,operation=operation,guid=guid)
|
lock=webapi.LockLog(log_name=log_name,operation=operation,guid=guid)
|
||||||
except rivwebpyapi.RivWebPyError as err:
|
except rivwebpyapi.RivWebPyError as err:
|
||||||
eprint('*** ERROR ***')
|
eprint('*** ERROR ***')
|
||||||
eprint('Response Code: '+str(err.responseCode))
|
eprint('Response Code: '+str(err.responseCode))
|
||||||
@ -90,12 +90,6 @@ except rivwebpyapi.RivWebPyError as err:
|
|||||||
#
|
#
|
||||||
# Display the result
|
# Display the result
|
||||||
#
|
#
|
||||||
|
for key in lock.values():
|
||||||
|
print(key+': '+str(lock.values()[key]))
|
||||||
print('')
|
print('')
|
||||||
print('RESULT:')
|
|
||||||
print('result: '+str(result['result']))
|
|
||||||
print('logName: '+str(result['logName']))
|
|
||||||
print('lockGuid: '+str(result['lockGuid']))
|
|
||||||
print('address: '+str(result['address']))
|
|
||||||
print('lockTimeout: '+str(result['address']))
|
|
||||||
print('')
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user