如何删除实体?正如我在此代码中显示的那样,实体存在,但是当我尝试删除它时,我获得了错误。
[root@host-192-168-192-78 ~]# curl localhost:1026/v1/contextEntityTypes/Room -s -S --header 'Content-Type: application/xml' | xmllint --format -
<?xml version="1.0"?>
<queryContextResponse>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="Room" isPattern="false">
<id>Bedroom1</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>Temperature</name>
<type>float</type>
<contextValue>27.8</contextValue>
</contextAttribute>
<contextAttribute>
<name>Presence</name>
<type>boolean</type>
<contextValue>true</contextValue>
</contextAttribute>
<contextAttribute>
<name>Status</name>
<type>string</type>
<contextValue>OK</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
上面我检查该实体是否存在,但现在,当我尝试删除它时,我获得以下内容:
[root@host-192-168-192-78 ~]# curl localhost:1026/NGSI10/contextEntities/Bedroom1 -s -S --header 'Content-Type: application/xml' -X DELETE
<statusCode>
<code>404</code>
<reasonPhrase>No context element found</reasonPhrase>
<details>Bedroom1</details>
</statusCode>
答案 0 :(得分:1)
我认为用于DELETE的URL不正确。它应该是
本地主机:1026 / V1 / contextEntities / Bedroom1
答案 1 :(得分:0)
这似乎是经纪人中的一个错误。应找到并删除该实体。 我们将尽快研究这个问题,请在orion github中进行演变,issue #921