MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / modify_service

Method modify_service

mod/project/python/serviceMod.py:701–720  ·  view source on GitHub ↗
(get)

Source from the content-addressed store, hash-verified

699
700 @staticmethod
701 def modify_service(get):
702 try:
703 project_name = get.project_name.strip()
704 sid = get.sid.strip()
705 service_conf = get.service_conf
706 if isinstance(service_conf, str):
707 service_conf = json.loads(service_conf)
708 if not isinstance(service_conf, dict):
709 return json_response(False, '服务参数配置错误')
710 except:
711 return json_response(False, '参数错误')
712
713 s_mgr = ServiceManager.new_mgr(project_name)
714 if isinstance(s_mgr, str):
715 return json_response(False, s_mgr)
716
717 res = s_mgr.modify_service(sid, service_conf)
718 if isinstance(res, str):
719 return json_response(False, res)
720 return json_response(True, msg="修改成功")
721
722 @staticmethod
723 def remove_service(get):

Callers

nothing calls this directly

Calls 3

json_responseFunction · 0.90
new_mgrMethod · 0.80
loadsMethod · 0.45

Tested by

no test coverage detected