跳转到内容

更新资产元数据

脚本设置代码块开始,然后添加下面的片段代码。

# ... script setup ...
TWIN_ID = "your-twin-id"
ASSET_ID = "your-asset-id"
updated = api_patch(
f"/v1/twin/{TWIN_ID}/assets/{ASSET_ID}/metadata",
{"metadata": {"General": {"Description": "Created via API", "Status": "Active"}}},
)
print(json.dumps(updated, indent=2))