OpenMTC/doc/training/onem2m-examples/onem2m-example-1.py

17 lines
956 B
Python
Raw Normal View History

2017-11-07 13:41:38 +00:00
# Example 1: Creating Objects
from openmtc_onem2m.model import AE
my_app = AE()
2019-01-10 10:10:02 +00:00
print(my_app.path)
2017-11-07 13:41:38 +00:00
#>>> None
2019-01-10 10:10:02 +00:00
print(my_app.App_ID)
2017-11-07 13:41:38 +00:00
#>>> None
2019-01-10 10:10:02 +00:00
print(my_app.parent_path)
2017-11-07 13:41:38 +00:00
#>>> None
2019-01-10 10:10:02 +00:00
print(my_app.labels)
2017-11-07 13:41:38 +00:00
#>>> None
2019-01-10 10:10:02 +00:00
print(my_app.attributes)
2017-11-07 13:41:38 +00:00
#>>> [UnicodeAttribute(name="AE-ID", type=unicode), UnicodeAttribute(name="App-ID", type=unicode), ListAttribute(name="accessControlPolicyIDs", type=list), ListAttribute(name="announceTo", type=list), UnicodeAttribute(name="announcedAttribute", type=unicode), ListAttribute(name="childResources", type=list), DatetimeAttribute(name="creationTime", type=datetime), DatetimeAttribute(name="expirationTime", type=datetime), UnicodeAttribute(name="labels", type=unicode), DatetimeAttribute(name="lastModifiedTime", type=datetime), UnicodeAttribute(name="name", type=unicode), UnicodeAttribute(name="nodeLink", type=unicode), UnicodeAttribute(name="ontologyRef", type=unicode), ListAttribute(name="pointOfAccess", type=list)]