MCPcopy Create free account
hub / github.com/Tong89/smartNode / scenarios_delete

Function scenarios_delete

backend/api.py:1073–1082  ·  view source on GitHub ↗

删除场景库中指定名称的场景。

(name: str)

Source from the content-addressed store, hash-verified

1071@require_role('admin')
1072@rate_limit(20, 60)
1073def scenarios_delete(name: str):
1074 """删除场景库中指定名称的场景。"""
1075 try:
1076 deleted = _scenario_store.delete_scenario(name)
1077 except Exception:
1078 logger.exception("场景库删除失败")
1079 return error_response("INTERNAL_ERROR")
1080 if not deleted:
1081 return error_response("NOT_FOUND", f"场景 '{name}' 不存在")
1082 return ok({"deleted": True, "name": name})
1083
1084
1085@app.route('/api/scenarios/<path:name>/activate', methods=['POST'])

Callers

nothing calls this directly

Calls 3

error_responseFunction · 0.90
okFunction · 0.90
delete_scenarioMethod · 0.80

Tested by

no test coverage detected