|
@@ -460,6 +460,35 @@ def save_native_agent_configuration():
|
|
|
session.commit()
|
|
|
return wrap_response(200, msg='Agent configuration saved successfully', data={'id': agent.id})
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+@app.route("/api/deleteNativeAgentConfiguration", methods=["POST"])
|
|
|
+def delete_native_agent_configuration():
|
|
|
+ """
|
|
|
+ 删除指定Agent配置(软删除,设置is_delete=1)
|
|
|
+ :return:
|
|
|
+ """
|
|
|
+ req_data = request.json
|
|
|
+ agent_id = req_data.get('agent_id', None)
|
|
|
+ if not agent_id:
|
|
|
+ return wrap_response(400, msg='agent_id is required')
|
|
|
+ try:
|
|
|
+ agent_id = int(agent_id)
|
|
|
+ except ValueError:
|
|
|
+ return wrap_response(400, msg='agent_id must be an integer')
|
|
|
+
|
|
|
+ with app.session_maker() as session:
|
|
|
+ agent = session.query(AgentConfiguration).filter(
|
|
|
+ AgentConfiguration.id == agent_id,
|
|
|
+ AgentConfiguration.is_delete == 0
|
|
|
+ ).first()
|
|
|
+ if not agent:
|
|
|
+ return wrap_response(404, msg='Agent not found')
|
|
|
+ agent.is_delete = 1
|
|
|
+ session.commit()
|
|
|
+ return wrap_response(200, msg='Agent configuration deleted successfully')
|
|
|
+
|
|
|
+
|
|
|
@app.route("/api/getModuleList", methods=["GET"])
|
|
|
def get_module_list():
|
|
|
"""
|