Here are some examples of how to use pyonep. For more detailed documentation of the Exosite APIs, you might want to check out Exosite’s RPC API documentation and Exosite’s Provisioning/Device Management API documentation.

Create a test child and then list the root

>>> from pyonep import onep; from test import test_base
>>> client = test_base.create_temporary_client()
>>> o = onep.OnepV1()
>>> desc = {'format': 'string', 'retention': {'count': 'infinity', 'duration': 'infinity'}}
>>> isok, rid = o.createDataport(client.cik, desc)
>>> isok, len(rid)
(True, 40)
>>> isok, listing = o.listing(client.cik, ['client', 'dataport'], {}, {'alias': ''})
>>> isok
>>> len(listing['client']), len(listing['dataport'])
(0, 1)

More examples are located in examples/. To run them, first modify them with your device information.

Note that to run the examples without installing the pyonep package, the example script must be located in the root folder (with ./pyonep as a sub-folder).

For a Python example that fully exercises the RPC interface using the pyonep library, see the Exosite command line interface, exoline.