Exemplo n.º 1
0
 def test_TD_M2M_NH_14_Create_ContentInstance(self):
     con_instance = cin()
     con_instance.set_con("some data")
     con_instance.set_rn("TestContentInstance")
     payload = con_instance.to_JSON()
     iotdm_api.create(
         "coap://localhost:5683/ODL-oneM2M-Cse/TestAE/TestContainer",
         4,
         payload,
         origin="CSE3219/C9886",
         requestID="12345")
Exemplo n.º 2
0
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"
container = cnt()
container.set_lbl(["submarine"])
payload = container.to_JSON()
iotdm_api.update("http://localhost:8282/InCSE1/myAE/myContainer/mySubContainer", payload, origin="AE-ID", requestID="12345")

# Deletion of the ContentInstance "myContentInstance"
iotdm_api.delete("http://localhost:8282/InCSE1/myAE/myContainer/myContentInstance", origin="AE-ID", requestID="12345")
Exemplo n.º 3
0
                 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"
container = cnt()
container.set_lbl(["submarine"])
payload = container.to_JSON()
iotdm_api.update(
Exemplo n.º 4
0
 def test_TD_M2M_NH_14_Create_ContentInstance(self):
     con_instance = cin()
     con_instance.set_con("some data")
     con_instance.set_rn("TestContentInstance")
     payload = con_instance.to_JSON()
     iotdm_api.create("coap://localhost:5683/ODL-oneM2M-Cse/TestAE/TestContainer", 4, payload, origin="CSE3219/C9886", requestID="12345")