我们使用错误的标头(错字)意外地将实体插入了猎户星座fiware-service-path
而不是正确的fiware-servicepath
(没有最后一个连字符),现在我无法删除实体。我还未经任何授权直接在服务器上测试了python script delete_entities_by_query,它还会返回实体列表。
There are 61 entities
There are 0 pages of 500 entities (and a final page of 61 entities)
尽管以下查询返回entent,但尝试删除总是会导致404错误:
--header 'fiware-service: something' \
--header 'fiware-service-path: asdf' \
--header 'Authorization: Bearer TOKEN'
例如返回一个实体id:urn:ngsi-ld:6c99ecaa-5cee-4f27-b936-3ccbe8c42d66
删除:
curl --location --request DELETE 'https://<orion>/v2/entities/urn:ngsi-ld:6c99ecaa-5cee-4f27-b936-3ccbe8c42d66' \
--header 'fiware-service: something' \
--header 'fiware-service-path: asdf' \
--header 'Authorization: Bearer TOKEN'
返回404。{"error":"NotFound","description":"The requested entity has not been found. Check type and id"}
fiware-servicepath
(不是fiware-service-path
)。可能是问题的原因(fiware-service-path
标头被Orion忽略,因此它隐含地假定fiware-servicepath: /
,在该位置找不到该实体,并返回404)。也请注意,服务路径的语法必须以/
开头。因此,asdf
不是有效的服务路径,而/asdf
是。