In [1]:
import xmlrpclib
import ssl

In [2]:
context = ssl._create_default_https_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE

In [3]:
url = "https://localhost:5000"
#url = "https://localhost:8443"

In [4]:
twitcher = xmlrpclib.ServerProxy(url, context=context)

In [5]:
twitcher.clear_services()


Out[5]:
True

In [6]:
twitcher.list_services()


Out[6]:
[]

In [7]:
twitcher.generate_token(1, {})


Out[7]:
{'access_token': '695b289f150548cd815fdf377b04ed07', 'expires_at': 1484156404}

In [10]:
twitcher.register_service("http://localhost:8094/wps", 
                          {'name': "emu", 'type': "WPS", 'public': False}, 
                          False)


Out[10]:
{'c4i': False,
 'name': 'emu',
 'public': False,
 'type': 'WPS',
 'url': 'http://localhost:8094/wps'}

In [11]:
twitcher.list_services()


Out[11]:
[{'c4i': False,
  'name': 'emu',
  'public': False,
  'type': 'WPS',
  'url': 'http://localhost:8094/wps'}]

In [12]:
twitcher.unregister_service('emu')


Out[12]:
True

In [13]:
twitcher.list_services()


Out[13]:
[]

In [ ]: