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

14 lines
331 B
Python
Raw Normal View History

2017-11-07 13:41:38 +00:00
# Example 7: Update OneM2MRequest
from openmtc_onem2m.transport import OneM2MRequest
from openmtc_onem2m.model import AE
my_app = AE(App_ID="myApp", labels=["keyword1", "keyword2"])
request = OneM2MRequest("update", to="onem2m", pc=my_app.labels)
2019-01-10 10:10:02 +00:00
print(request.to)
2017-11-07 13:41:38 +00:00
#>>> onem2m
2019-01-10 10:10:02 +00:00
print(request.pc)
2017-11-07 13:41:38 +00:00
#>>> [u'keyword1', u'keyword2']