mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-25 16:58:04 +02:00
2021-11-05 Fred Gleason <fredg@paravelsystems.com>
* Removed the 'untangle' Python module dependency from the 'rivwebpyapi' API. * Added a 'xmltodict' Python module dependency to the 'rivwebpyapi' API. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
0b5a5e7807
commit
0ffd393d48
@ -22573,3 +22573,8 @@
|
|||||||
Operations Guide to after the 'The RDCatch Main Window' section.
|
Operations Guide to after the 'The RDCatch Main Window' section.
|
||||||
2021-11-04 Fred Gleason <fredg@paravelsystems.com>
|
2021-11-04 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Added a 'rivwebpyapi' API.
|
* Added a 'rivwebpyapi' API.
|
||||||
|
2021-11-05 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Removed the 'untangle' Python module dependency from the
|
||||||
|
'rivwebpyapi' API.
|
||||||
|
* Added a 'xmltodict' Python module dependency to the 'rivwebpyapi'
|
||||||
|
API.
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import untangle
|
import xmltodict
|
||||||
|
|
||||||
class RivWebPyApi(object):
|
class RivWebPyApi(object):
|
||||||
"""
|
"""
|
||||||
@ -66,4 +66,4 @@ class RivWebPyApi(object):
|
|||||||
r=requests.post(self.__connection_url,data=postdata)
|
r=requests.post(self.__connection_url,data=postdata)
|
||||||
if(r.status_code!=requests.codes.ok):
|
if(r.status_code!=requests.codes.ok):
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
return untangle.parse(r.text)
|
return xmltodict.parse(r.text)
|
||||||
|
@ -52,10 +52,10 @@ if((not url)or(not username)):
|
|||||||
|
|
||||||
webapi=rivwebpyapi.RivWebPyApi(url=url,username=username,passwd=password)
|
webapi=rivwebpyapi.RivWebPyApi(url=url,username=username,passwd=password)
|
||||||
services=webapi.ListServices(False)
|
services=webapi.ListServices(False)
|
||||||
for svc in services.serviceList.service:
|
for svc in services['serviceList']['service']:
|
||||||
print('NAME: '+svc.name.cdata)
|
print('NAME: '+svc['name'])
|
||||||
if(svc.description.cdata):
|
if(svc['description']):
|
||||||
print('DESCRIPTION: '+svc.description.cdata)
|
print('DESCRIPTION: '+svc['description'])
|
||||||
else:
|
else:
|
||||||
print('DESCRIPTION: [none]')
|
print('DESCRIPTION: [none]')
|
||||||
print('')
|
print('')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user