Пример #1
0
 def test_TD_M2M_NH_12_Update_Container(self):
     container = cnt()
     payload = container.to_JSON()
     iotdm_api.update(
         "coap://localhost:5683/ODL-oneM2M-Cse/TestAE/TestContainer",
         payload,
         origin="CSE3219/C9886",
         requestID="12345")
Пример #2
0
 def test_TD_M2M_NH_10_Create_Container(self):
     container = cnt()
     container.set_rn("TestContainer")
     payload = container.to_JSON()
     iotdm_api.create("coap://localhost:5683/ODL-oneM2M-Cse/TestAE",
                      3,
                      payload,
                      origin="CSE3219/C9886",
                      requestID="12345")
Пример #3
0
iotdm_api.cleanup('http://localhost', 'admin', 'admin')

# CoAP Creation of an AE named "myAE" under the CSE base "InCSE1".
AE = ae()
AE.set_api("Nk836-t071-fc022")
AE.set_rr(True)
AE.set_rn("myAE")
payload = AE.to_JSON()
iotdm_api.create("coap://localhost:5683/InCSE1",
                 2,
                 payload,
                 origin="AE-ID",
                 requestID="12345")

# Creation of a Container named "mySubContainer" with a maximum number of instances of 5, under "myContainer".
container = cnt()
container.set_rn("mySubContainer")
container.set_mni(5)
payload = container.to_JSON()
iotdm_api.create("http://localhost:8282/InCSE1/myAE/myContainer",
                 3,
                 payload,
                 origin="AE-ID",
                 requestID="12345")

# Creation of a Content Instance named "myOtherContentInstance" under "mySubContainer", with "world" as its content.
con_instance = cin()
con_instance.set_con("world")
con_instance.set_rn("myOtherContentInstance")
payload = con_instance.to_JSON()
iotdm_api.create(
Пример #4
0
# Clean-up of resource tree
iotdm_api.cleanup('http://localhost', 'admin', 'admin')


# CoAP Creation of an AE named "myAE" under the CSE base "InCSE1".
AE = ae()
AE.set_api("Nk836-t071-fc022")
AE.set_rr(True)
AE.set_rn("myAE")
payload = AE.to_JSON()
iotdm_api.create("coap://localhost:5683/InCSE1", 2, payload, origin="AE-ID", requestID="12345")


# Creation of a Container named "mySubContainer" with a maximum number of instances of 5, under "myContainer".
container = cnt()
container.set_rn("mySubContainer")
container.set_mni(5)
payload = container.to_JSON()
iotdm_api.create("http://localhost:8282/InCSE1/myAE/myContainer", 3, payload, origin="AE-ID", requestID="12345")


# Creation of a Content Instance named "myOtherContentInstance" under "mySubContainer", with "world" as its content.
con_instance = cin()
con_instance.set_con("world")
con_instance.set_rn("myOtherContentInstance")
payload = con_instance.to_JSON()
iotdm_api.create("http://localhost:8282/InCSE1/myAE/myContainer/mySubContainer", 4, payload, origin="AE-ID", requestID="12345")


# Update of the Container "mySubContainer", with its attribute "label" being set to "submarine"
Пример #5
0
 def test_TD_M2M_NH_12_Update_Container(self):
     container = cnt()
     payload = container.to_JSON()
     iotdm_api.update("coap://localhost:5683/ODL-oneM2M-Cse/TestAE/TestContainer", payload, origin="CSE3219/C9886", requestID="12345")
Пример #6
0
 def test_TD_M2M_NH_10_Create_Container(self):
     container = cnt()
     container.set_rn("TestContainer")
     payload = container.to_JSON()
     iotdm_api.create("coap://localhost:5683/ODL-oneM2M-Cse/TestAE", 3, payload, origin="CSE3219/C9886", requestID="12345")