azure.digitaltwins.core.DigitalTwinsClient
我已经成功地使用返回对象的方法创建了一个模型的双胞胎,upsert_digital_twin()
如下所示(打印为字典):
{
$dtId twin-spc4-4b670a8e-86ec-41b0-84a2-ce092578a0f6
$etag W/"8c491e49-f81f-4c30-b189-1bd45f122d7c"
area {'$metadata': {}}
capacity {'$metadata': {}}
occupancy {'$metadata': {}}
temperature {'$metadata': {}}
humidity {'$metadata': {}}
CO2 {'$metadata': {}}
$metadata {'$model': 'dtmi:digitaltwins:rec_3_3:core:Level;1'}
}
但是,当我尝试使用该get_digital_twin()
方法获取此模型时,出现以下错误:
azure.core.exceptions.ResourceNotFoundError: (DigitalTwinNotFound) There is no digital twin instance that exists with the ID {'$dtId': 'twin-spc4-4b670a8e-86ec-41b0-84a2-ce092578a0f6', '$etag': 'W%2F"8c491e49-f81f-4c30-b189-1bd45f122d7c"', 'area': {'$metadata': {}}, 'capacity': {'$metadata': {}}, 'occupancy': {'$metadata': {}}, 'temperature': {'$metadata': {}}, 'humidity': {'$metadata': {}}, 'CO2': {'$metadata': {}}, '$metadata': {'$model': 'dtmi:digitaltwins:rec_3_3:core:Level;1'}}. Please verify that the twin id is valid and ensure that the twin is not deleted. See section on querying the twins https://aka.ms/adtv2query.
Code: DigitalTwinNotFound
Message: There is no digital twin instance that exists with the ID {'$dtId': 'twin-spc4-4b670a8e-86ec-41b0-84a2-ce092578a0f6', '$etag': 'W%2F"8c491e49-f81f-4c30-b189-1bd45f122d7c"', 'area': {'$metadata': {}}, 'capacity': {'$metadata': {}}, 'occupancy': {'$metadata': {}}, 'temperature': {'$metadata': {}}, 'humidity': {'$metadata': {}}, 'CO2': {'$metadata': {}}, '$metadata': {'$model': 'dtmi:digitaltwins:rec_3_3:core:Level;1'}}. Please verify that the twin id is valid and ensure that the twin is not deleted. See section on querying the twins https://aka.ms/adtv2query.
怎么了?如何找回我创建的双胞胎?