From b76e8990fe4df245a0a6dedd2085d74229d8aead Mon Sep 17 00:00:00 2001 From: jiayuan929 <252461528@qq.com> Date: Wed, 12 Jun 2024 11:13:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DS-mart=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E4=B8=8D=E8=83=BD=E8=B0=83=E7=94=A8=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E7=94=9F=E6=95=88=E7=9A=84=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=20KEY=20?= =?UTF-8?q?API=20(#1376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../paasng/accessories/servicehub/urls.py | 2 +- .../paasng/accessories/servicehub/views.py | 28 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apiserver/paasng/paasng/accessories/servicehub/urls.py b/apiserver/paasng/paasng/accessories/servicehub/urls.py index 3877357d37..63c428b587 100644 --- a/apiserver/paasng/paasng/accessories/servicehub/urls.py +++ b/apiserver/paasng/paasng/accessories/servicehub/urls.py @@ -89,7 +89,7 @@ ), re_path( make_app_pattern("/services/config_var_keys/$", include_envs=False), - views.ModuleServiceAttachmentsViewSet.as_view({"get": "list_provisioned_env_keys"}), + views.ModuleServicesViewSet.as_view({"get": "list_provisioned_env_keys"}), name="api.services.list_provisioned_env_keys", ), re_path( diff --git a/apiserver/paasng/paasng/accessories/servicehub/views.py b/apiserver/paasng/paasng/accessories/servicehub/views.py index ca613ae769..f0bf6163dd 100644 --- a/apiserver/paasng/paasng/accessories/servicehub/views.py +++ b/apiserver/paasng/paasng/accessories/servicehub/views.py @@ -99,20 +99,6 @@ def retrieve_info(self, request, code, module_name): services_info[env.environment] = ServicesInfo.get_detail(env.engine_app)["services_info"] return Response(data=slzs.ModuleServiceInfoSLZ(services_info).data) - def list_provisioned_env_keys(self, request, code, module_name): - """获取已经生效的增强服务环境变量 KEY""" - module = self.get_module_via_path() - - # env_key_dict 内容示例: {"svc_name": ["key1", "key2"]} - env_key_dict: Dict[str, List[str]] = {} - for env in module.get_envs(): - env_key_dict = { - **env_key_dict, - **ServiceSharingManager(env.module).get_enabled_env_keys(env), - **mixed_service_mgr.get_enabled_env_keys(env.engine_app), - } - return Response(data=env_key_dict) - class ModuleServicesViewSet(viewsets.ViewSet, ApplicationCodeInPathMixin): """与蓝鲸应用模块相关的增强服务接口""" @@ -245,6 +231,20 @@ def unbind(self, request, code, module_name, service_id): module_attachment.delete() return Response(status=status.HTTP_200_OK) + def list_provisioned_env_keys(self, request, code, module_name): + """获取已经生效的增强服务环境变量 KEY""" + module = self.get_module_via_path() + + # env_key_dict 内容示例: {"svc_name": ["key1", "key2"]} + env_key_dict: Dict[str, List[str]] = {} + for env in module.get_envs(): + env_key_dict = { + **env_key_dict, + **ServiceSharingManager(env.module).get_enabled_env_keys(env), + **mixed_service_mgr.get_enabled_env_keys(env.engine_app), + } + return Response(data=env_key_dict) + class ServiceViewSet(viewsets.ViewSet, ApplicationCodeInPathMixin): """增强服务相关视图(与应用无关的)"""