2021-12-06 Fred Gleason <fredg@paravelsystems.com>

* Added an 'AudioStore()' method to the 'rivwebpyapi' API.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-12-06 17:07:21 -05:00
parent 7390967c4b
commit 63704fbd68
4 changed files with 101 additions and 0 deletions

View File

@@ -504,6 +504,39 @@ class rivwebpyapi(object):
return handler.output()
def AudioStore(self):
"""
Get information about the audio store (list of dictionaries).
"""
#
# Build the WebAPI arguments
#
postdata={
'COMMAND': '23',
'LOGIN_NAME': self.__connection_username,
'PASSWORD': self.__connection_password
}
#
# Fetch the XML
#
r=requests.post(self.__connection_url,data=postdata)
if(r.status_code!=requests.codes.ok):
r.raise_for_status()
#
# Generate the output dictionary
#
fields={
'freeBytes': 'integer',
'totalBytes': 'integer'
}
handler=RivWebPyApi_ListHandler(base_tag='audioStore',fields=fields)
xml.sax.parseString(r.text,handler)
return handler.output()
def DeleteLog(self,log_name):
"""
Delete an existing log.