【问题标题】:Fiware-orion Remove all entities of the same typeFiware-orion 移除所有同类型实体
【发布时间】:2017-12-19 15:10:53
【问题描述】:

我不知道将什么命令传递给 Fiware Orion API(v2) 以删除特定类型的所有元素。在这个例子中 fake.

我试过了,但它不起作用:

response = self.PM.request(
        method='post', url='http://127.0.0.1:1026/v2/op/update', headers={'Content-Type': 'application/json'},
        body=json.dumps({
            "actionType": "delete",
            "entities": [{
                "idPattern": ".*",
                "type": "Fake",
            }]
        }))

我可以通过 ID 删除元素。这只是一种解决方法,但告诉我我正在正确连接到 API。这是有效的代码:

response = self.PM.request(
        method='post', url='http://127.0.0.1:1026/v2/op/update', headers={'Content-Type': 'application/json'},
        body=json.dumps({
            "actionType": "delete",
            "entities": [{
                    "id": "Fake1",
                },
                {
                    "id": "Fake2",
                }
            ]}))

【问题讨论】:

  • 你是对的,我提供的答案(现已删除)是错误的。似乎这是不可能的,至少从阅读文档来看是不可能的
  • 谢谢。我怀疑,但我读了一些 gits 提交,暗示也许有办法。
  • 这些提交在哪里?

标签: python fiware-orion


【解决方案1】:

根据to the docs,此功能不存在。另外,如果你 search the source code for "delete type" 我没有看到任何匹配的东西。您需要先进行选择并遍历所有 id 删除它们。

【讨论】:

【解决方案2】:

您正在使用 python 中的某些客户端来访问 Orion Broker?

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多