diff --git a/apps/backend/healthz/views.py b/apps/backend/healthz/views.py index 1c93b372a..9cc2c67a7 100644 --- a/apps/backend/healthz/views.py +++ b/apps/backend/healthz/views.py @@ -22,8 +22,10 @@ class HealthzViewSet(APIViewSet, mixins.ListModelMixin): queryset = "" @swagger_auto_schema( + operation_id="metric_list", operation_summary="健康统计指标", tags=HEALTHZ_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def list(self, request, *args, **kwargs): # 统计指标 diff --git a/apps/backend/plugin/views.py b/apps/backend/plugin/views.py index a4ec175f3..d9a8c49ca 100644 --- a/apps/backend/plugin/views.py +++ b/apps/backend/plugin/views.py @@ -74,8 +74,10 @@ class PluginViewSet(APIViewSet, mixins.RetrieveModelMixin, mixins.ListModelMixin # permission_classes = (BackendBasePermission,) @swagger_auto_schema( + operation_id="plugin_create_register_task", operation_summary="创建注册任务", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action( detail=False, @@ -130,8 +132,10 @@ def create_plugin_register_task(self, request): return Response({"job_id": job.id}) @swagger_auto_schema( + operation_id="plugin_query_register_task", operation_summary="查询插件注册任务", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action( detail=False, @@ -176,8 +180,10 @@ def query_plugin_register_task(self, request): ) @swagger_auto_schema( + operation_id="plugin_info", operation_summary="查询插件信息", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET"], serializer_class=serializers.PluginInfoSerializer) def info(self, request): @@ -203,8 +209,10 @@ def info(self, request): return Response(package_infos) @swagger_auto_schema( + operation_id="plugin_release", operation_summary="发布插件包", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.ReleasePluginSerializer) def release(self, request): @@ -251,8 +259,10 @@ def release(self, request): return Response([package.id for package in plugin_packages]) @swagger_auto_schema( + operation_id="package_status_operation", operation_summary="插件包状态类操作", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.PkgStatusOperationSerializer) def package_status_operation(self, request): @@ -295,8 +305,10 @@ def package_status_operation(self, request): return Response([package.id for package in plugin_packages]) @swagger_auto_schema( + operation_id="plugin_delete", operation_summary="删除插件", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.DeletePluginSerializer) def delete(self, request): @@ -328,8 +340,10 @@ def delete(self, request): return Response() @swagger_auto_schema( + operation_id="plugin_create_config_template", operation_summary="创建配置模板", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.CreatePluginConfigTemplateSerializer) def create_config_template(self, request): @@ -378,8 +392,10 @@ def create_config_template(self, request): return Response(params) @swagger_auto_schema( + operation_id="plugin_release_config_template", operation_summary="发布配置模板", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.ReleasePluginConfigTemplateSerializer) def release_config_template(self, request): @@ -421,8 +437,10 @@ def release_config_template(self, request): return Response(result) @swagger_auto_schema( + operation_id="plugin_render_config_template", operation_summary="渲染配置模板", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.RenderPluginConfigTemplateSerializer) def render_config_template(self, request): @@ -539,8 +557,10 @@ def query_config_instance(self, request): return Response(result) @swagger_auto_schema( + operation_id="plugin_start_debug", operation_summary="开始调试", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.PluginStartDebugSerializer) def start_debug(self, request): @@ -668,8 +688,10 @@ def start_debug(self, request): return Response({"task_id": subscription_task.id}) @swagger_auto_schema( + operation_id="plugin_stop_debug", operation_summary="停止调试", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"]) def stop_debug(self, request): @@ -711,8 +733,10 @@ def stop_debug(self, request): return Response() @swagger_auto_schema( + operation_id="plugin_query_debug", operation_summary="查询调试结果", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET"]) def query_debug(self, request): @@ -750,8 +774,10 @@ def query_debug(self, request): return Response({"status": status, "step": step_name, "message": "\n".join(log_content)}) @swagger_auto_schema( + operation_id="plugin_create_export_task", operation_summary="触发插件打包导出", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.ExportSerializer) def create_export_task(self, request): @@ -803,8 +829,10 @@ def create_export_task(self, request): return Response({"job_id": record.id}) @swagger_auto_schema( + operation_id="plugin_query_export_task", operation_summary="获取一个导出任务结果", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET"]) def query_export_task(self, request): @@ -858,8 +886,10 @@ def query_export_task(self, request): return Response(response_data) @swagger_auto_schema( + operation_id="plugin_parse", operation_summary="解析插件包", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.PluginParseSerializer) def parse(self, request): @@ -941,8 +971,10 @@ def parse(self, request): return Response(pkg_parse_results) @swagger_auto_schema( + operation_id="plugin_list", operation_summary="查询插件列表", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def list(self, request, *args, **kwargs): """ @@ -1037,8 +1069,10 @@ def list(self, request, *args, **kwargs): return Response({"total": len(plugins), "list": ret_plugins}) @swagger_auto_schema( + operation_id="plugin_detail", operation_summary="插件详情", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def retrieve(self, request, *args, **kwargs): """ @@ -1098,8 +1132,10 @@ def retrieve(self, request, *args, **kwargs): return Response(PluginHandler.retrieve(kwargs["pk"])) @swagger_auto_schema( + operation_id="plugin_status_operation", operation_summary="插件状态类操作", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.PluginStatusOperationSerializer) def plugin_status_operation(self, request): @@ -1127,9 +1163,11 @@ def plugin_status_operation(self, request): return Response([plugin.id for plugin in update_plugins]) @swagger_auto_schema( + operation_id="plugin_history", operation_summary="查询插件包历史", methods=["GET"], tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=True, methods=["GET", "POST"], serializer_class=serializers.PluginQueryHistorySerializer) def history(self, request, pk): @@ -1200,8 +1238,10 @@ def history(self, request, pk): ) @swagger_auto_schema( + operation_id="plugin_upload", operation_summary="上传文件接口", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.CosUploadSerializer) def upload(self, request, *args, **kwargs): diff --git a/apps/backend/subscription/views.py b/apps/backend/subscription/views.py index 2b8ac6d74..f79b45f2f 100644 --- a/apps/backend/subscription/views.py +++ b/apps/backend/subscription/views.py @@ -53,9 +53,11 @@ class SubscriptionViewSet(APIViewSet): # permission_classes = (BackendBasePermission,) @swagger_auto_schema( + operation_id="subscription_create", operation_summary="创建订阅", responses={status.HTTP_200_OK: response.CreateResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action( detail=False, methods=["POST"], url_path="create", serializer_class=serializers.CreateSubscriptionSerializer @@ -131,9 +133,11 @@ def create_subscription(self, request): return Response(result) @swagger_auto_schema( + operation_id="subscription_info", operation_summary="订阅详情", responses={status.HTTP_200_OK: response.InfoResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.GetSubscriptionSerializer) def info(self, request): @@ -176,9 +180,11 @@ def info(self, request): return Response(result) @swagger_auto_schema( + operation_id="subscription_update", operation_summary="更新订阅", responses={status.HTTP_200_OK: response.UpdateResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action( detail=False, methods=["POST"], url_path="update", serializer_class=serializers.UpdateSubscriptionSerializer @@ -292,9 +298,11 @@ def update_subscription(self, request): return Response(result) @swagger_auto_schema( + operation_id="subscription_delete", operation_summary="删除订阅", responses={status.HTTP_200_OK: response.DeleteResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action( detail=False, methods=["POST"], url_path="delete", serializer_class=serializers.DeleteSubscriptionSerializer @@ -315,9 +323,11 @@ def delete_subscription(self, request): return Response() @swagger_auto_schema( + operation_id="subscription_run", operation_summary="执行订阅", responses={status.HTTP_200_OK: response.RunResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.RunSubscriptionSerializer) def run(self, request): @@ -332,7 +342,13 @@ def run(self, request): SubscriptionHandler(params["subscription_id"]).run(scope=params.get("scope"), actions=params.get("actions")) ) - @swagger_auto_schema(operation_summary="查询任务是否已准备完成", tags=SUBSCRIPTION_VIEW_TAGS, methods=["GET", "POST"]) + @swagger_auto_schema( + operation_id="subscription_check_task_ready", + operation_summary="查询任务是否已准备完成", + tags=SUBSCRIPTION_VIEW_TAGS, + methods=["POST"], + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["GET", "POST"], serializer_class=serializers.CheckTaskReadySerializer) def check_task_ready(self, request): """ @@ -348,10 +364,12 @@ def check_task_ready(self, request): return Response(task_result) @swagger_auto_schema( + operation_id="subscription_task_result", operation_summary="任务执行结果", responses={status.HTTP_200_OK: response.TaskResultResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, - methods=["GET", "POST"], + methods=["POST"], + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET", "POST"], serializer_class=serializers.TaskResultSerializer) def task_result(self, request): @@ -378,9 +396,11 @@ def task_result(self, request): return Response(task_result) @swagger_auto_schema( + operation_id="subscription_task_result_detail", operation_summary="任务执行详细结果", tags=SUBSCRIPTION_VIEW_TAGS, - methods=["GET", "POST"], + methods=["POST"], + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET", "POST"], serializer_class=serializers.TaskResultDetailSerializer) def task_result_detail(self, request): @@ -400,7 +420,12 @@ def task_result_detail(self, request): SubscriptionHandler(params["subscription_id"]).task_result_detail(params["instance_id"], task_id_list) ) - @swagger_auto_schema(operation_summary="采集任务执行详细结果", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="collect_task_result_detail", + operation_summary="采集任务执行详细结果", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"]) def collect_task_result_detail(self, request): """ @@ -417,7 +442,12 @@ def collect_task_result_detail(self, request): res = collect_log.delay(job_task.bk_host_id, job_task.pipeline_id) return Response({"celery_id": res.id}) - @swagger_auto_schema(operation_summary="统计订阅任务数据", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="subscription_statistic", + operation_summary="统计订阅任务数据", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"], serializer_class=serializers.SubscriptionStatisticSerializer) def statistic(self, request): """ @@ -430,10 +460,12 @@ def statistic(self, request): return Response(SubscriptionHandler.statistic(subscription_id_list)) @swagger_auto_schema( + operation_id="subscription_instance_status", operation_summary="查询订阅运行状态", responses={status.HTTP_200_OK: response.InstanceStatusResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, - methods=["GET", "POST"], + methods=["POST"], + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET", "POST"], serializer_class=serializers.InstanceHostStatusSerializer) def instance_status(self, request): @@ -449,7 +481,12 @@ def instance_status(self, request): ) ) - @swagger_auto_schema(operation_summary="订阅启停", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="subscription_switch", + operation_summary="订阅启停", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"], serializer_class=serializers.SwitchSubscriptionSerializer) def switch(self, request): """ @@ -472,7 +509,12 @@ def switch(self, request): return Response() - @swagger_auto_schema(operation_summary="终止正在执行的任务", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="subscription_revoke", + operation_summary="终止正在执行的任务", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"], serializer_class=serializers.RevokeSubscriptionSerializer) def revoke(self, request): """ @@ -487,9 +529,11 @@ def revoke(self, request): return Response() @swagger_auto_schema( + operation_id="subscription_retry", operation_summary="重试失败的任务", responses={status.HTTP_200_OK: response.RetryResponseSerializer()}, tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.RetrySubscriptionSerializer) def retry(self, request): @@ -585,7 +629,12 @@ def cmdb_subscription(self, request): models.CmdbEventRecord.objects.bulk_create(cmdb_events) return Response("ok") - @swagger_auto_schema(operation_summary="返回安装命令", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="fetch_commands", + operation_summary="返回安装命令", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"], serializer_class=serializers.FetchCommandsSerializer) def fetch_commands(self, request): """ @@ -641,7 +690,12 @@ def fetch_commands(self, request): return Response({"solutions": solutions}) - @swagger_auto_schema(operation_summary="查询策略列表", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="subscription_search_policy", + operation_summary="查询策略列表", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"], serializer_class=serializers.SearchDeployPolicySerializer) def search_deploy_policy(self, *args, **kwargs): """ @@ -774,7 +828,12 @@ def search_deploy_policy(self, *args, **kwargs): return Response({"total": len(all_subscriptions), "list": subscriptions}) - @swagger_auto_schema(operation_summary="获取主机策略列表", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="subscription_query_host_policy", + operation_summary="获取主机策略列表", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["GET"], serializer_class=serializers.QueryHostPolicySerializer) def query_host_policy(self, request): """ @@ -912,7 +971,12 @@ def _op_record_comparator(_left: Dict, _right: Dict) -> int: operate_records.sort(key=cmp_to_key(_op_record_comparator)) return Response(operate_records) - @swagger_auto_schema(operation_summary="获取主机订阅列表", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="query_host_subscriptions", + operation_summary="获取主机订阅列表", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["GET"], serializer_class=serializers.QueryHostSubscriptionsSerializer) def query_host_subscriptions(self, request): """ @@ -942,7 +1006,12 @@ def query_host_subscriptions(self, request): models.ProcessStatus.fetch_process_statuses_by_host_id(bk_host_id=bk_host_id, source_type=source_type) ) - @swagger_auto_schema(operation_summary="启用/禁用业务订阅巡检", tags=SUBSCRIPTION_VIEW_TAGS) + @swagger_auto_schema( + operation_id="subscription_switch_biz", + operation_summary="启用/禁用业务订阅巡检", + tags=SUBSCRIPTION_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) @action(detail=False, methods=["POST"], serializer_class=serializers.SubscriptionSwitchBizSerializer) def switch_biz(self, request): """ diff --git a/apps/backend/sync_task/views.py b/apps/backend/sync_task/views.py index 8116b694b..73268895d 100644 --- a/apps/backend/sync_task/views.py +++ b/apps/backend/sync_task/views.py @@ -9,6 +9,7 @@ specific language governing permissions and limitations under the License. """ from celery.result import AsyncResult +from drf_yasg.utils import swagger_auto_schema from rest_framework.decorators import action from rest_framework.response import Response @@ -16,11 +17,17 @@ from apps.backend.sync_task.handler import AsyncTaskHandler from apps.generic import APIViewSet +SYNC_TASK_VIEW_TAGS = ["sync_task"] + class SyncTaskViewSet(APIViewSet): - @action( - detail=False, methods=["POST"], url_path="create", serializer_class=serializers.CreateSyncTaskSerializer + @swagger_auto_schema( + operation_id="sync_task_create", + operation_summary="创建同步任务", + tags=SYNC_TASK_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) + @action(detail=False, methods=["POST"], url_path="create", serializer_class=serializers.CreateSyncTaskSerializer) def create_sync_task(self, request): """ @api {POST} /sync_task/create/ 创建同步任务 @@ -37,9 +44,13 @@ def create_sync_task(self, request): return Response({"task_id": task_id}) - @action( - detail=False, methods=["GET"], url_path="status", serializer_class=serializers.SyncTaskStatusSerializer + @swagger_auto_schema( + operation_id="sync_task_status", + operation_summary="查询同步任务状态", + tags=SYNC_TASK_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) + @action(detail=False, methods=["GET"], url_path="status", serializer_class=serializers.SyncTaskStatusSerializer) def status(self, request): """ @api {GET} /sync_task/status/ 查询同步任务状态 diff --git a/apps/core/encrypt/views.py b/apps/core/encrypt/views.py index bff553c47..7b88fc2b9 100644 --- a/apps/core/encrypt/views.py +++ b/apps/core/encrypt/views.py @@ -23,8 +23,10 @@ class RSAViewSet(APIViewSet): URL_BASE_NAME = "encrypt_rsa" @swagger_auto_schema( + operation_id="fetch_public_keys", operation_summary="获取公钥列表", tags=RSA_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.AsymmetricFetchKeysSerializer) def fetch_public_keys(self, request): diff --git a/apps/core/gray/views.py b/apps/core/gray/views.py index 9d772b5ab..4069692de 100644 --- a/apps/core/gray/views.py +++ b/apps/core/gray/views.py @@ -25,43 +25,53 @@ class GrayViewSet(APIViewSet): permission_classes = (permission.GrayPermission,) @swagger_auto_schema( + operation_id="gray_build", operation_summary="GSE 2.0灰度", tags=GRAY_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.GraySerializer) def build(self, request): return Response(handlers.GrayHandler.build(self.validated_data)) @swagger_auto_schema( + operation_id="gray_rollback", operation_summary="GSE 2.0灰度回滚", tags=GRAY_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.GraySerializer) def rollback(self, request): return Response(handlers.GrayHandler.rollback(self.validated_data)) @swagger_auto_schema( + operation_id="gray_info", operation_summary="获取GSE 2.0灰度信息", tags=GRAY_VIEW_TAGS, responses={status.HTTP_200_OK: serializers.GrayBizSerializer}, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["GET"]) def info(self, request): return Response({"bk_biz_ids": handlers.GrayHandler.list_biz_ids()}) @swagger_auto_schema( + operation_id="upgrade_to_agent_id", operation_summary="升级到Agent ID配置", tags=GRAY_VIEW_TAGS, responses={status.HTTP_200_OK: serializers.UpgradeOrRollbackAgentIDSerializer}, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.GraySerializer) def upgrade_to_agent_id(self, request): return Response(handlers.GrayHandler.upgrade_to_agent_id(self.validated_data)) @swagger_auto_schema( + operation_id="rollback_agent_id", operation_summary="回滚Agent ID配置", tags=GRAY_VIEW_TAGS, responses={status.HTTP_200_OK: serializers.UpgradeOrRollbackAgentIDSerializer}, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=serializers.GraySerializer) def rollback_agent_id(self, request): diff --git a/apps/core/ipchooser/views.py b/apps/core/ipchooser/views.py index 0e08558e0..b295d5690 100644 --- a/apps/core/ipchooser/views.py +++ b/apps/core/ipchooser/views.py @@ -29,30 +29,36 @@ class IpChooserTopoViewSet(APIViewSet): permission_classes = (permission.IpChooserTopoPermission,) @swagger_auto_schema( + operation_id="ipchooser_topo_trees", operation_summary=_("批量获取含各节点主机数量的拓扑树"), tags=IP_CHOOSER_VIEW_TAGS, request_body=topo_sers.TreesRequestSer(), responses={status.HTTP_200_OK: topo_sers.TreesResponseSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=topo_sers.TreesRequestSer) def trees(self, request, *args, **kwargs): return Response(topo_handler.TopoHandler.trees(scope_list=self.validated_data["scope_list"])) @swagger_auto_schema( + operation_id="ipchooser_topo_query_path", operation_summary=_("查询多个节点拓扑路径"), tags=IP_CHOOSER_VIEW_TAGS, request_body=topo_sers.QueryPathRequestSer(), responses={status.HTTP_200_OK: topo_sers.QueryPathResponseSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=topo_sers.QueryPathRequestSer) def query_path(self, request, *args, **kwargs): return Response(topo_handler.TopoHandler.query_path(node_list=self.validated_data["node_list"])) @swagger_auto_schema( + operation_id="ipchooser_topo_query_hosts", operation_summary=_("根据多个拓扑节点与搜索条件批量分页查询所包含的主机信息"), tags=IP_CHOOSER_VIEW_TAGS, request_body=topo_sers.QueryHostsRequestSer(), responses={status.HTTP_200_OK: topo_sers.QueryHostsResponseSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=topo_sers.QueryHostsRequestSer) def query_hosts(self, request, *args, **kwargs): @@ -67,10 +73,12 @@ def query_hosts(self, request, *args, **kwargs): ) @swagger_auto_schema( + operation_id="ipchooser_topo_query_host_id_infos", operation_summary=_("根据多个拓扑节点与搜索条件批量分页查询所包含的主机 ID 信息"), tags=IP_CHOOSER_VIEW_TAGS, request_body=topo_sers.QueryHostIdInfosRequestSer(), responses={status.HTTP_200_OK: topo_sers.QueryHostIdInfosResponseSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=topo_sers.QueryHostIdInfosRequestSer) def query_host_id_infos(self, request, *args, **kwargs): @@ -85,10 +93,12 @@ def query_host_id_infos(self, request, *args, **kwargs): ) @swagger_auto_schema( + operation_id="ipchooser_topo_agent_statistics", operation_summary=_("获取多个拓扑节点的主机 Agent 状态统计信息"), tags=IP_CHOOSER_VIEW_TAGS, request_body=topo_sers.AgentStatisticsRequestSer(), responses={status.HTTP_200_OK: topo_sers.AgentStatisticsRequestSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=topo_sers.AgentStatisticsRequestSer) def agent_statistics(self, request, *args, **kwargs): @@ -101,10 +111,12 @@ class IpChooserHostViewSet(APIViewSet): permission_classes = (permission.IpChooserHostPermission,) @swagger_auto_schema( + operation_id="ipchooser_host_check", operation_summary=_("根据用户手动输入的`IP`/`IPv6`/`主机名`/`host_id`等关键字信息获取真实存在的机器信息"), tags=IP_CHOOSER_VIEW_TAGS, request_body=host_sers.HostCheckRequestSer(), responses={status.HTTP_200_OK: host_sers.HostCheckResponseSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=host_sers.HostCheckRequestSer) def check(self, request, *args, **kwargs): @@ -119,10 +131,12 @@ def check(self, request, *args, **kwargs): ) @swagger_auto_schema( + operation_id="ipchooser_host_details", operation_summary=_("根据主机关键信息获取机器详情信息"), tags=IP_CHOOSER_VIEW_TAGS, request_body=host_sers.HostDetailsRequestSer(), responses={status.HTTP_200_OK: host_sers.HostDetailsResponseSer()}, + extra_overrides={"is_register_apigw": True}, ) @action(methods=["POST"], detail=False, serializer_class=host_sers.HostDetailsRequestSer) def details(self, request, *args, **kwargs): diff --git a/apps/node_man/apps.py b/apps/node_man/apps.py index d24d6b6af..2d935dfee 100644 --- a/apps/node_man/apps.py +++ b/apps/node_man/apps.py @@ -13,6 +13,7 @@ from blueapps.utils.esbclient import get_client_by_user from django.apps import AppConfig from django.conf import settings +from django.core.management import call_command from django.db import ProgrammingError, connection from common.log import logger @@ -125,3 +126,10 @@ def init_settings(cls): default={}, ) settings.PLUGIN_COMMON_CONSTANTS = plugin_common_constants + # 根据开关来决定是否执行 sync_apigw + if settings.SYNC_APIGATEWAY_ENABLED: + try: + call_command("sync_apigw") + logger.info("Successfully executed sync_apigw") + except Exception as e: + logger.error(f"Error executing sync_apigw: {e}") diff --git a/apps/node_man/management/commands/generate_swagger_apigw.py b/apps/node_man/management/commands/generate_swagger_apigw.py new file mode 100644 index 000000000..883e81822 --- /dev/null +++ b/apps/node_man/management/commands/generate_swagger_apigw.py @@ -0,0 +1,392 @@ +# coding: utf-8 +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available. +Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +import copy +import logging +import os +from collections import OrderedDict + +from coreapi.compat import force_bytes, urlparse +from django.contrib.auth import get_user_model +from django.core.exceptions import ImproperlyConfigured +from django.core.management.base import BaseCommand +from django.urls import get_script_prefix +from drf_yasg import openapi +from drf_yasg.app_settings import swagger_settings +from drf_yasg.codecs import VALIDATORS, OpenAPICodecJson, OpenAPICodecYaml +from drf_yasg.errors import SwaggerValidationError +from drf_yasg.generators import OpenAPISchemaGenerator +from drf_yasg.utils import get_consumes, get_produces +from rest_framework.settings import api_settings +from rest_framework.test import APIRequestFactory, force_authenticate +from rest_framework.views import APIView + + +class ApigwOpenAPICodecYaml(OpenAPICodecYaml): + def encode(self, document): + + spec = self.generate_swagger_object(document) + errors = {} + for validator in self.validators: + try: + VALIDATORS[validator](copy.deepcopy(spec)) + except SwaggerValidationError as e: + errors[validator] = str(e) + + if errors: + raise SwaggerValidationError("spec validation failed: {}".format(errors), errors, spec, self) + + return force_bytes(self._dump_dict(spec)) + + +class PathItem(openapi.PathItem): + def __init__(self, get=None, put=None, post=None, delete=None, options=None, head=None, patch=None, **extra): + super().__init__(**extra) + self.get = get + self.head = head + self.post = post + self.put = put + self.patch = patch + self.delete = delete + self.options = options + self._insert_extras__() + + +class ApigwSwagger(openapi.SwaggerDict): + def __init__( + self, + info=None, + _url=None, + _prefix=None, + _version=None, + consumes=None, + produces=None, + security_definitions=None, + security=None, + paths=None, + definitions=None, + **extra, + ): + """Root Swagger object.""" + super(ApigwSwagger, self).__init__(**extra) + self.swagger = "2.0" + self.info = info + self.info.version = _version or info._default_version + + if _url: + url = urlparse.urlparse(_url) + assert url.netloc and url.scheme, "if given, url must have both schema and netloc" + self.host = url.netloc + self.schemes = [url.scheme] + + self.base_path = self.get_base_path(get_script_prefix(), _prefix) + self.paths = paths + self._insert_extras__() + + @classmethod + def get_base_path(cls, script_prefix, api_prefix): + # avoid double slash when joining script_name with api_prefix + if script_prefix and script_prefix.endswith("/"): + script_prefix = script_prefix[:-1] + if not api_prefix.startswith("/"): + api_prefix = "/" + api_prefix + + base_path = script_prefix + api_prefix + + # ensure that the base path has a leading slash and no trailing slash + if base_path and base_path.endswith("/"): + base_path = base_path[:-1] + if not base_path.startswith("/"): + base_path = "/" + base_path + + return base_path + + +class ApigwOpenAPISchemaGenerator(OpenAPISchemaGenerator): + def get_schema(self, request=None, public=False): + """Generate a :class:`.Swagger` object representing the API schema.""" + endpoints = self.get_endpoints(request) + components = self.reference_resolver_class(openapi.SCHEMA_DEFINITIONS, force_init=True) + self.consumes = get_consumes(api_settings.DEFAULT_PARSER_CLASSES) + self.produces = get_produces(api_settings.DEFAULT_RENDERER_CLASSES) + paths, prefix = self.get_paths(endpoints, components, request, public) + + security_definitions = self.get_security_definitions() + if security_definitions: + security_requirements = self.get_security_requirements(security_definitions) + else: + security_requirements = None + + url = self.url + if url is None and request is not None: + url = request.build_absolute_uri() + + return ApigwSwagger( + info=self.info, + paths=paths, + consumes=self.consumes or None, + produces=self.produces or None, + security_definitions=security_definitions, + security=security_requirements, + _url=url, + _prefix=prefix, + _version=self.version, + **dict(components), + ) + + def get_path_item(self, path, view_cls, operations): + return PathItem(**operations) + + def get_operation(self, view, path, prefix, method, components, request): + """Get an :class:`.Operation` for the given API endpoint (path, method). This method delegates to""" + overrides = self.get_overrides(view, method) + if not overrides.get("extra_overrides", {}).get("is_register_apigw", False): + return None + + operation = super().get_operation(view, path, prefix, method, components, request) + + apigw_operation = { + "operationId": operation["operationId"], + "summary": operation["summary"], + "tags": operation["tags"], + "x-bk-apigateway-resource": { + "isPublic": True, + "allowApplyPermission": True, + "matchSubpath": False, + "backend": { + "name": "default", + "method": method.lower(), + "path": path, + "matchSubpath": False, + "timeout": 0, + }, + "authConfig": { + "userVerifiedRequired": True, + "appVerifiedRequired": True, + "resourcePermissionRequired": True, + }, + }, + } + + return apigw_operation + + def get_paths(self, endpoints, components, request, public): + if not endpoints: + return openapi.Paths(paths={}), "" + + prefix = self.determine_path_prefix(list(endpoints.keys())) or "" + assert "{" not in prefix, "base path cannot be templated in swagger 2.0" + + paths = OrderedDict() + for path, (view_cls, methods) in sorted(endpoints.items()): + operations = {} + for method, view in methods: + if not self.should_include_endpoint(path, method, view, public): + continue + + operation = self.get_operation(view, path, prefix, method, components, request) + if operation is not None: + operations[method.lower()] = operation + + if operations: + path_suffix = path[len(prefix) :] + if not path_suffix.startswith("/"): + path_suffix = "/" + path_suffix + paths[path_suffix] = self.get_path_item(path, view_cls, operations) + + # 创建带前缀的路径 + prefixed_path = f"/app{path_suffix}" + prefixed_operations = { + method: self.modify_operation(operation, "app_") + for method, operation in copy.deepcopy(operations).items() + } + paths[prefixed_path] = self.get_path_item(path, view_cls, prefixed_operations) + + return self.get_paths_object(paths), prefix + + @staticmethod + def modify_operation(operation, prefix): + operation["operationId"] = f"{prefix}{operation['operationId']}" + operation["x-bk-apigateway-resource"]["authConfig"]["userVerifiedRequired"] = False + return operation + + +class Command(BaseCommand): + help = "Write the Swagger schema to disk in JSON or YAML format." + + def add_arguments(self, parser): + parser.add_argument( + "output_file", + metavar="output-file", + nargs="?", + default="-", + type=str, + help='Output path for generated swagger document, or "-" for stdout.', + ) + parser.add_argument( + "-o", + "--overwrite", + default=False, + action="store_true", + help="Overwrite the output file if it already exists. " + "Default behavior is to stop if the output file exists.", + ) + parser.add_argument( + "-f", + "--format", + dest="format", + default="", + choices=["json", "yaml"], + type=str, + help="Output format. If not given, it is guessed from the output file extension and defaults to json.", + ) + parser.add_argument( + "-u", + "--url", + dest="api_url", + default="", + type=str, + help="Base API URL - sets the host and scheme attributes of the generated document.", + ) + parser.add_argument( + "-m", + "--mock-request", + dest="mock", + default=False, + action="store_true", + help="Use a mock request when generating the swagger schema. This is useful if your views or serializers " + "depend on context from a request in order to function.", + ) + parser.add_argument( + "--api-version", + dest="api_version", + type=str, + help="Version to use to generate schema. This option implies --mock-request.", + ) + parser.add_argument( + "--user", + dest="user", + help="Username of an existing user to use for mocked authentication. This option implies --mock-request.", + ) + parser.add_argument( + "-p", + "--private", + default=False, + action="store_true", + help="Hides endpoints not accesible to the target user. If --user is not given, only shows endpoints that " + "are accesible to unauthenticated users.\n" + "This has the same effect as passing public=False to get_schema_view() or " + "OpenAPISchemaGenerator.get_schema().\n" + "This option implies --mock-request.", + ) + parser.add_argument( + "-g", + "--generator-class", + dest="generator_class_name", + default="", + help="Import string pointing to an OpenAPISchemaGenerator subclass to use for schema generation.", + ) + + def write_schema(self, schema, stream, format): + if format == "json": + codec = OpenAPICodecJson(validators=[], pretty=True) + swagger_json = codec.encode(schema).decode("utf-8") + stream.write(swagger_json) + elif format == "yaml": + codec = ApigwOpenAPICodecYaml(validators=[]) + swagger_yaml = codec.encode(schema).decode("utf-8") + # YAML is already pretty! + stream.write(swagger_yaml) + else: # pragma: no cover + raise ValueError("unknown format %s" % format) + + def get_mock_request(self, url, format, user=None): + factory = APIRequestFactory() + + request = factory.get(url + "/swagger." + format) + if user is not None: + force_authenticate(request, user=user) + request = APIView().initialize_request(request) + return request + + def get_schema_generator(self, generator_class_name, api_info, api_version, api_url): + generator_class = ApigwOpenAPISchemaGenerator + + return generator_class( + info=api_info, + version=api_version, + url=api_url, + ) + + def get_schema(self, generator, request, public): + return generator.get_schema(request=request, public=public) + + def handle( + self, + output_file, + overwrite, + format, + api_url, + mock, + api_version, + user, + private, + generator_class_name, + *args, + **kwargs, + ): + # disable logs of WARNING and below + logging.disable(logging.WARNING) + + info = getattr(swagger_settings, "DEFAULT_INFO", None) + if not isinstance(info, openapi.Info): + raise ImproperlyConfigured( + 'settings.SWAGGER_SETTINGS["DEFAULT_INFO"] should be an ' + "import string pointing to an openapi.Info object" + ) + + if not format: + if os.path.splitext(output_file)[1] in (".yml", ".yaml"): + format = "yaml" + format = format or "json" + + api_url = api_url or swagger_settings.DEFAULT_API_URL + + if user: + # Only call get_user_model if --user was passed in order to + # avoid crashing if auth is not configured in the project + user = get_user_model().objects.get(**{get_user_model().USERNAME_FIELD: user}) + + mock = mock or private or (user is not None) or (api_version is not None) + if mock and not api_url: + raise ImproperlyConfigured( + "--mock-request requires an API url; either provide " + "the --url argument or set the DEFAULT_API_URL setting" + ) + + request = None + if mock: + request = self.get_mock_request(api_url, format, user) + + api_version = api_version or api_settings.DEFAULT_VERSION + if request and api_version: + request.version = api_version + + generator = self.get_schema_generator(generator_class_name, info, api_version, api_url) + schema = self.get_schema(generator, request, not private) + + print(output_file) + + if output_file == "-": + self.write_schema(schema, self.stdout, format) + else: + flags = "w" if overwrite else "x" + with open(output_file, flags) as stream: + self.write_schema(schema, stream, format) diff --git a/apps/node_man/management/commands/sync_apigw.py b/apps/node_man/management/commands/sync_apigw.py new file mode 100644 index 000000000..43c2951a5 --- /dev/null +++ b/apps/node_man/management/commands/sync_apigw.py @@ -0,0 +1,39 @@ +# coding: utf-8 +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available. +Copyright (C) 2017-2022 THL A29 Limited, a Tencent company. All rights reserved. +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. +You may obtain a copy of the License at https://opensource.org/licenses/MIT +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. +""" +from django.conf import settings +from django.core.management import call_command +from django.core.management.base import BaseCommand + + +class Command(BaseCommand): + def handle(self, *args, **kwargs): + if not settings.SYNC_APIGATEWAY_ENABLED: + return + + # 待同步网关名,需修改为实际网关名;直接指定网关名,则不需要配置 Django settings BK_APIGW_NAME + gateway_name = settings.BK_APIGW_NAME + + # 待同步网关、资源定义文件,需调整为实际的配置文件地址 + definition_path = "support-files/apigw/definition.yaml" + resources_path = "support-files/apigw/resources.yaml" + + call_command("sync_apigw_config", f"--api-name={gateway_name}", f"--file={definition_path}") + call_command("sync_apigw_stage", f"--api-name={gateway_name}", f"--file={definition_path}") + call_command("sync_apigw_resources", f"--api-name={gateway_name}", "--delete", f"--file={resources_path}") + # call_command("sync_resource_docs_by_archive", f"--api-name={gateway_name}", f"--file={definition_path}") + call_command( + "create_version_and_release_apigw", + f"--api-name={gateway_name}", + f"--file={definition_path}", + f"-s {settings.ENVIRONMENT}", + ) + call_command("grant_apigw_permissions", f"--api-name={gateway_name}", f"--file={definition_path}") + call_command("fetch_apigw_public_key", f"--api-name={gateway_name}") diff --git a/apps/node_man/views/ap.py b/apps/node_man/views/ap.py index dca9ca9f4..730919cc9 100644 --- a/apps/node_man/views/ap.py +++ b/apps/node_man/views/ap.py @@ -33,8 +33,10 @@ class ApViewSet(ModelViewSet): permission_classes = (GlobalSettingPermission,) @swagger_auto_schema( + operation_id="ap_list", operation_summary="查询任务列表", tags=AP_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def list(self, request, *args, **kwargs): """ diff --git a/apps/node_man/views/cloud.py b/apps/node_man/views/cloud.py index 01ce72aff..3850ef9f5 100644 --- a/apps/node_man/views/cloud.py +++ b/apps/node_man/views/cloud.py @@ -30,10 +30,12 @@ class CloudViewSet(ModelViewSet): permission_classes = (CloudPermission,) @swagger_auto_schema( + operation_id="cloud_list", operation_summary="查询管控区域列表", query_serializer=ListSerializer(), responses={status.HTTP_200_OK: response.CloudListResponseSerializer()}, tags=CLOUD_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def list(self, request, *args, **kwargs): """ @@ -74,8 +76,10 @@ def retrieve(self, request, *args, **kwargs): return Response(cloud) @swagger_auto_schema( + operation_id="create_cloud_area", operation_summary="创建管控区域", tags=CLOUD_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def create(self, request, *args, **kwargs): """ diff --git a/apps/node_man/views/host.py b/apps/node_man/views/host.py index 246e923cf..97e8432c5 100644 --- a/apps/node_man/views/host.py +++ b/apps/node_man/views/host.py @@ -38,9 +38,11 @@ class HostViewSet(ModelViewSet): permission_classes = (HostPermission,) @swagger_auto_schema( + operation_id="list_hosts", operation_summary="查询主机列表", responses={status.HTTP_200_OK: response.HostSearchResponseSerializer()}, tags=HOST_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=HostSearchSerializer) def search(self, request): @@ -52,10 +54,12 @@ def search(self, request): return Response(HostHandler().list(self.validated_data, get_request_username())) @swagger_auto_schema( + operation_id="list_cloud_proxies", operation_summary="查询管控区域下有操作权限的proxy列表", query_serializer=ProxySerializer(), responses={status.HTTP_200_OK: response.HostBizProxyResponseSerializer()}, tags=HOST_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, serializer_class=ProxySerializer) def proxies(self, request, *args, **kwargs): @@ -73,10 +77,12 @@ def proxies(self, request, *args, **kwargs): return Response(proxies) @swagger_auto_schema( + operation_id="list_biz_proxies", operation_summary="查询业务下管控区域的proxy集合", query_serializer=BizProxySerializer(), responses={status.HTTP_200_OK: response.HostBizProxyResponseSerializer()}, tags=HOST_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, serializer_class=BizProxySerializer) def biz_proxies(self, request, *args, **kwargs): diff --git a/apps/node_man/views/install_channel.py b/apps/node_man/views/install_channel.py index 25bf4c3f0..6298726c0 100644 --- a/apps/node_man/views/install_channel.py +++ b/apps/node_man/views/install_channel.py @@ -38,6 +38,12 @@ def get_queryset(self): # 如果 hidden 为 False, 则返回所有未隐藏的安装通道 return InstallChannel.objects.filter(hidden=False) + @swagger_auto_schema( + operation_id="install_channel_list", + operation_summary="列出所有安装通道", + tags=INSTALL_CHANNEL_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, + ) def list(self, request, *args, **kwargs): response = super().list(request, *args, **kwargs) response.data.insert( diff --git a/apps/node_man/views/job.py b/apps/node_man/views/job.py index 00fefb537..011486f3e 100644 --- a/apps/node_man/views/job.py +++ b/apps/node_man/views/job.py @@ -89,9 +89,11 @@ def job_list(self, request, *args, **kwargs): return Response(JobHandler().list(self.validated_data, get_request_username())) @swagger_auto_schema( + operation_id="job_details", operation_summary="查询任务详情", responses={status.HTTP_200_OK: response.JobLogResponseSerializer()}, tags=JOB_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=True, methods=["POST"], serializer_class=RetrieveSerializer) def details(self, request, *args, **kwargs): @@ -103,10 +105,12 @@ def details(self, request, *args, **kwargs): return Response(JobHandler(job_id=kwargs["pk"]).retrieve(self.validated_data)) @swagger_auto_schema( + operation_id="job_install", operation_summary="安装类任务", operation_description="安装作业任务, 新安装Agent、新安装Proxy、重装、替换等操作", responses={status.HTTP_200_OK: response.JobInstallSerializer()}, tags=JOB_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=InstallSerializer) def install(self, request): @@ -131,10 +135,12 @@ def install(self, request): return Response(JobHandler().install(hosts, op_type, node_type, job_type, ticket, extra_params, extra_config)) @swagger_auto_schema( + operation_id="job_operate", operation_summary="操作类任务", operation_description="用于只有bk_host_id参数的主机下线、重启等操作", responses={status.HTTP_200_OK: response.JobOperateSerializer()}, tags=JOB_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=OperateSerializer) def operate(self, request): @@ -223,10 +229,12 @@ def retry_node(self, request, *args, **kwargs): return Response(JobHandler(job_id=kwargs["pk"]).retry_node(request.data.get("instance_id", None))) @swagger_auto_schema( + operation_id="get_job_log", operation_summary="查询日志", query_serializer=JobInstanceOperateSerializer(), responses={status.HTTP_200_OK: response.JobLogResponseSerializer()}, tags=JOB_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=True, serializer_class=JobInstanceOperateSerializer) def log(self, request, *args, **kwargs): diff --git a/apps/node_man/views/plugin.py b/apps/node_man/views/plugin.py index 7489d08f0..01e97d2c0 100644 --- a/apps/node_man/views/plugin.py +++ b/apps/node_man/views/plugin.py @@ -53,8 +53,10 @@ def get_queryset(self): return self.queryset @swagger_auto_schema( + operation_id="list_processes", operation_summary="查询插件列表", tags=GSE_PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def list(self, *args, **kwargs): """ @@ -84,9 +86,11 @@ class PluginViewSet(ModelViewSet): model = Host @swagger_auto_schema( + operation_id="search_host_plugin", operation_summary="查询插件列表", responses={status.HTTP_200_OK: response.PluginSearchResponseSerializer()}, tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=PluginListSerializer) def search(self, request): @@ -100,8 +104,10 @@ def search(self, request): return Response(hosts) @swagger_auto_schema( + operation_id="operate_plugin", operation_summary="插件操作类任务", tags=PLUGIN_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) @action(detail=False, methods=["POST"], serializer_class=OperateSerializer) def operate(self, request): @@ -179,8 +185,10 @@ class PackagesViews(ModelViewSet): serializer_class = ProcessPackageSerializer @swagger_auto_schema( + operation_id="list_packages", operation_summary="查询进程包列表", tags=PACKAGE_VIEW_TAGS, + extra_overrides={"is_register_apigw": True}, ) def list(self, request, *args, **kwargs): """ diff --git a/config/default.py b/config/default.py index 9634e0e0b..feca132a6 100644 --- a/config/default.py +++ b/config/default.py @@ -32,6 +32,8 @@ from .patchers import logging from .patchers.monitor_reporter import monitor_report_config +ENVIRONMENT = env.ENVIRONMENT + # =============================================================================== # 运行时,用于区分环境差异 # =============================================================================== @@ -320,6 +322,8 @@ BK_API_URL_TMPL = env.BK_API_URL_TMPL BK_DOMAIN = env.BK_DOMAIN +SYNC_APIGATEWAY_ENABLED = env.SYNC_APIGATEWAY_ENABLED + BK_NODEMAN_HOST = env.BK_NODEMAN_HOST # 节点管理后台外网域名,用于构造文件导入导出的API URL BK_NODEMAN_BACKEND_HOST = env.BK_NODEMAN_BACKEND_HOST @@ -368,6 +372,10 @@ # 敏感参数 SENSITIVE_PARAMS = ["app_code", "app_secret", "bk_app_code", "bk_app_secret", "auth_info"] +SWAGGER_SETTINGS = { + "DEFAULT_INFO": "urls.openapi_info", +} + # rest_framework REST_FRAMEWORK = { "DATETIME_FORMAT": "%Y-%m-%d %H:%M:%S", diff --git a/env/__init__.py b/env/__init__.py index f0cd3b853..fd8a44682 100644 --- a/env/__init__.py +++ b/env/__init__.py @@ -70,6 +70,7 @@ # 自动选择安装通道相关配置 "BKAPP_DEFAULT_INSTALL_CHANNEL_ID", "BKAPP_AUTOMATIC_CHOICE_CLOUD_ID", + "SYNC_APIGATEWAY_ENABLED", ] # =============================================================================== @@ -200,3 +201,5 @@ BKPAAS_SHARED_RES_URL = get_type_env(key="BKPAAS_SHARED_RES_URL", default="", _type=str) BKAPP_LEGACY_AUTH = get_type_env(key="BKAPP_LEGACY_AUTH", default=False, _type=bool) BK_NOTICE_ENABLED = get_type_env(key="BK_NOTICE_ENABLED", default=False, _type=bool) + +SYNC_APIGATEWAY_ENABLED = get_type_env(key="SYNC_APIGATEWAY_ENABLED", default=True, _type=bool) diff --git a/support-files/apigw/definition.yaml b/support-files/apigw/definition.yaml new file mode 100644 index 000000000..1af216c21 --- /dev/null +++ b/support-files/apigw/definition.yaml @@ -0,0 +1,50 @@ +spec_version: 2 + +release: + # 发布版本号 + version: 1.0.0 + title: "API 初始化" + comment: "API 初始化" + +# 定义网关基本信息,用于命令 `sync_apigw_config` +apigateway: + description: "节点管理 API" + # 网关的英文描述,蓝鲸官方网关需提供英文描述,以支持国际化 + description_en: "NodeMan API" + is_public: true + api_type: 1 + maintainers: + - "admin" + +# 定义环境信息,用于命令 `sync_apigw_stage` +stage: + name: "{{ settings.ENVIRONMENT }}" +{% if settings.ENVIRONMENT == "prod" %} + description: "正式环境" + description_en: "Prod" +{% elif settings.ENVIRONMENT == "stag" %} + description: "预发布环境" + description_en: "Test" +{% else %} + description: "开发测试环境" + description_en: "Development" +{% endif %} + backends: + - name: "default" + config: + timeout: 180 + loadbalance: "roundrobin" + hosts: + # 网关调用后端服务的默认域名或IP,不包含Path,比如: http://api.example.com + - host: "{{ settings.BK_NODEMAN_BACKEND_HOST }}" + weight: 100 +grant_permissions: + - bk_app_code: "{{ settings.APP_CODE }}" + # grant_dimension: "gateway" + +resource_docs: + # 资源文档的归档文件,可为 tar.gz,zip 格式文件;创建归档文件可使用指令 `tar czvf xxx.tgz en zh` + # archivefile: "{{ settings.BK_APIGW_RESOURCE_DOCS_ARCHIVE_FILE }}" + # 资源文档目录,basedir 与 archivefile 二者至少一个有效,若同时存在,则 archivefile 优先 + # basedir: "{{ settings.BK_APIGW_RESOURCE_DOCS_BASE_DIR }}" + basedir: "support-files/apigw/apidocs" \ No newline at end of file diff --git a/support-files/apigw/resources.yaml b/support-files/apigw/resources.yaml new file mode 100644 index 000000000..8f99e0bbf --- /dev/null +++ b/support-files/apigw/resources.yaml @@ -0,0 +1,2832 @@ +swagger: '2.0' +info: + title: Bk Nodeman API + description: "\u8282\u70B9\u7BA1\u7406" + termsOfService: https://bk.tencent.com/info/#laws + contact: + email: contactus_bk@tencent.com + license: + name: MIT License + version: v1 +basePath: / +paths: + /api/ap/: + get: + operationId: ap_list + summary: "\u67E5\u8BE2\u4EFB\u52A1\u5217\u8868" + tags: + - ap + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/ap/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/ap/: + get: + operationId: app_ap_list + summary: "\u67E5\u8BE2\u4EFB\u52A1\u5217\u8868" + tags: + - ap + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/ap/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/cloud/: + get: + operationId: cloud_list + summary: "\u67E5\u8BE2\u7BA1\u63A7\u533A\u57DF\u5217\u8868" + tags: + - cloud + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/cloud/ + timeout: 0 + isPublic: true + matchSubpath: false + post: + operationId: create_cloud_area + summary: "\u521B\u5EFA\u7BA1\u63A7\u533A\u57DF" + tags: + - cloud + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/cloud/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/cloud/: + get: + operationId: app_cloud_list + summary: "\u67E5\u8BE2\u7BA1\u63A7\u533A\u57DF\u5217\u8868" + tags: + - cloud + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/cloud/ + timeout: 0 + isPublic: true + matchSubpath: false + post: + operationId: app_create_cloud_area + summary: "\u521B\u5EFA\u7BA1\u63A7\u533A\u57DF" + tags: + - cloud + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/cloud/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/host/biz_proxies/: + get: + operationId: list_biz_proxies + summary: "\u67E5\u8BE2\u4E1A\u52A1\u4E0B\u7BA1\u63A7\u533A\u57DF\u7684proxy\u96C6\ + \u5408" + tags: + - host + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/host/biz_proxies/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/host/biz_proxies/: + get: + operationId: app_list_biz_proxies + summary: "\u67E5\u8BE2\u4E1A\u52A1\u4E0B\u7BA1\u63A7\u533A\u57DF\u7684proxy\u96C6\ + \u5408" + tags: + - host + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/host/biz_proxies/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/host/proxies/: + get: + operationId: list_cloud_proxies + summary: "\u67E5\u8BE2\u7BA1\u63A7\u533A\u57DF\u4E0B\u6709\u64CD\u4F5C\u6743\ + \u9650\u7684proxy\u5217\u8868" + tags: + - host + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/host/proxies/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/host/proxies/: + get: + operationId: app_list_cloud_proxies + summary: "\u67E5\u8BE2\u7BA1\u63A7\u533A\u57DF\u4E0B\u6709\u64CD\u4F5C\u6743\ + \u9650\u7684proxy\u5217\u8868" + tags: + - host + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/host/proxies/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/host/search/: + post: + operationId: list_hosts + summary: "\u67E5\u8BE2\u4E3B\u673A\u5217\u8868" + tags: + - host + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/host/search/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/host/search/: + post: + operationId: app_list_hosts + summary: "\u67E5\u8BE2\u4E3B\u673A\u5217\u8868" + tags: + - host + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/host/search/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/install_channel/: + get: + operationId: install_channel_list + summary: "\u5217\u51FA\u6240\u6709\u5B89\u88C5\u901A\u9053" + tags: + - channel + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/install_channel/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/install_channel/: + get: + operationId: app_install_channel_list + summary: "\u5217\u51FA\u6240\u6709\u5B89\u88C5\u901A\u9053" + tags: + - channel + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/install_channel/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/job/install/: + post: + operationId: job_install + summary: "\u5B89\u88C5\u7C7B\u4EFB\u52A1" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/job/install/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/job/install/: + post: + operationId: app_job_install + summary: "\u5B89\u88C5\u7C7B\u4EFB\u52A1" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/job/install/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/job/operate/: + post: + operationId: job_operate + summary: "\u64CD\u4F5C\u7C7B\u4EFB\u52A1" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/job/operate/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/job/operate/: + post: + operationId: app_job_operate + summary: "\u64CD\u4F5C\u7C7B\u4EFB\u52A1" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/job/operate/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/job/{id}/details/: + post: + operationId: job_details + summary: "\u67E5\u8BE2\u4EFB\u52A1\u8BE6\u60C5" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/job/{id}/details/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/job/{id}/details/: + post: + operationId: app_job_details + summary: "\u67E5\u8BE2\u4EFB\u52A1\u8BE6\u60C5" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/job/{id}/details/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/job/{id}/log/: + get: + operationId: get_job_log + summary: "\u67E5\u8BE2\u65E5\u5FD7" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/job/{id}/log/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/job/{id}/log/: + get: + operationId: app_get_job_log + summary: "\u67E5\u8BE2\u65E5\u5FD7" + tags: + - job + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/job/{id}/log/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/plugin/operate/: + post: + operationId: operate_plugin + summary: "\u63D2\u4EF6\u64CD\u4F5C\u7C7B\u4EFB\u52A1" + tags: + - api_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/plugin/operate/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/plugin/operate/: + post: + operationId: app_operate_plugin + summary: "\u63D2\u4EF6\u64CD\u4F5C\u7C7B\u4EFB\u52A1" + tags: + - api_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/plugin/operate/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/plugin/search/: + post: + operationId: search_host_plugin + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5217\u8868" + tags: + - api_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /api/plugin/search/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/plugin/search/: + post: + operationId: app_search_host_plugin + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5217\u8868" + tags: + - api_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /api/plugin/search/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/plugin/{category}/process/: + get: + operationId: list_processes + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5217\u8868" + tags: + - gse_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/plugin/{category}/process/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/plugin/{category}/process/: + get: + operationId: app_list_processes + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5217\u8868" + tags: + - gse_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/plugin/{category}/process/ + timeout: 0 + isPublic: true + matchSubpath: false + /api/plugin/{process}/package/: + get: + operationId: list_packages + summary: "\u67E5\u8BE2\u8FDB\u7A0B\u5305\u5217\u8868" + tags: + - package + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /api/plugin/{process}/package/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/api/plugin/{process}/package/: + get: + operationId: app_list_packages + summary: "\u67E5\u8BE2\u8FDB\u7A0B\u5305\u5217\u8868" + tags: + - package + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /api/plugin/{process}/package/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/healthz/: + get: + operationId: metric_list + summary: "\u5065\u5EB7\u7EDF\u8BA1\u6307\u6807" + tags: + - healthz + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/healthz/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/healthz/: + get: + operationId: app_metric_list + summary: "\u5065\u5EB7\u7EDF\u8BA1\u6307\u6807" + tags: + - healthz + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/healthz/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/: + get: + operationId: plugin_list + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5217\u8868" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/: + get: + operationId: app_plugin_list + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5217\u8868" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/create_config_template/: + post: + operationId: plugin_create_config_template + summary: "\u521B\u5EFA\u914D\u7F6E\u6A21\u677F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/create_config_template/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/create_config_template/: + post: + operationId: app_plugin_create_config_template + summary: "\u521B\u5EFA\u914D\u7F6E\u6A21\u677F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/create_config_template/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/create_export_task/: + post: + operationId: plugin_create_export_task + summary: "\u89E6\u53D1\u63D2\u4EF6\u6253\u5305\u5BFC\u51FA" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/create_export_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/create_export_task/: + post: + operationId: app_plugin_create_export_task + summary: "\u89E6\u53D1\u63D2\u4EF6\u6253\u5305\u5BFC\u51FA" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/create_export_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/create_register_task/: + post: + operationId: plugin_create_register_task + summary: "\u521B\u5EFA\u6CE8\u518C\u4EFB\u52A1" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/create_register_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/create_register_task/: + post: + operationId: app_plugin_create_register_task + summary: "\u521B\u5EFA\u6CE8\u518C\u4EFB\u52A1" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/create_register_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/delete/: + post: + operationId: plugin_delete + summary: "\u5220\u9664\u63D2\u4EF6" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/delete/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/delete/: + post: + operationId: app_plugin_delete + summary: "\u5220\u9664\u63D2\u4EF6" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/delete/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/info/: + get: + operationId: plugin_info + summary: "\u67E5\u8BE2\u63D2\u4EF6\u4FE1\u606F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/info/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/info/: + get: + operationId: app_plugin_info + summary: "\u67E5\u8BE2\u63D2\u4EF6\u4FE1\u606F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/info/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/package_status_operation/: + post: + operationId: package_status_operation + summary: "\u63D2\u4EF6\u5305\u72B6\u6001\u7C7B\u64CD\u4F5C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/package_status_operation/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/package_status_operation/: + post: + operationId: app_package_status_operation + summary: "\u63D2\u4EF6\u5305\u72B6\u6001\u7C7B\u64CD\u4F5C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/package_status_operation/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/parse/: + post: + operationId: plugin_parse + summary: "\u89E3\u6790\u63D2\u4EF6\u5305" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/parse/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/parse/: + post: + operationId: app_plugin_parse + summary: "\u89E3\u6790\u63D2\u4EF6\u5305" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/parse/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/plugin_status_operation/: + post: + operationId: plugin_status_operation + summary: "\u63D2\u4EF6\u72B6\u6001\u7C7B\u64CD\u4F5C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/plugin_status_operation/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/plugin_status_operation/: + post: + operationId: app_plugin_status_operation + summary: "\u63D2\u4EF6\u72B6\u6001\u7C7B\u64CD\u4F5C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/plugin_status_operation/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/query_debug/: + get: + operationId: plugin_query_debug + summary: "\u67E5\u8BE2\u8C03\u8BD5\u7ED3\u679C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/query_debug/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/query_debug/: + get: + operationId: app_plugin_query_debug + summary: "\u67E5\u8BE2\u8C03\u8BD5\u7ED3\u679C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/query_debug/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/query_export_task/: + get: + operationId: plugin_query_export_task + summary: "\u83B7\u53D6\u4E00\u4E2A\u5BFC\u51FA\u4EFB\u52A1\u7ED3\u679C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/query_export_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/query_export_task/: + get: + operationId: app_plugin_query_export_task + summary: "\u83B7\u53D6\u4E00\u4E2A\u5BFC\u51FA\u4EFB\u52A1\u7ED3\u679C" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/query_export_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/query_register_task/: + get: + operationId: plugin_query_register_task + summary: "\u67E5\u8BE2\u63D2\u4EF6\u6CE8\u518C\u4EFB\u52A1" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/query_register_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/query_register_task/: + get: + operationId: app_plugin_query_register_task + summary: "\u67E5\u8BE2\u63D2\u4EF6\u6CE8\u518C\u4EFB\u52A1" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/query_register_task/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/release/: + post: + operationId: plugin_release + summary: "\u53D1\u5E03\u63D2\u4EF6\u5305" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/release/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/release/: + post: + operationId: app_plugin_release + summary: "\u53D1\u5E03\u63D2\u4EF6\u5305" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/release/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/release_config_template/: + post: + operationId: plugin_release_config_template + summary: "\u53D1\u5E03\u914D\u7F6E\u6A21\u677F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/release_config_template/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/release_config_template/: + post: + operationId: app_plugin_release_config_template + summary: "\u53D1\u5E03\u914D\u7F6E\u6A21\u677F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/release_config_template/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/render_config_template/: + post: + operationId: plugin_render_config_template + summary: "\u6E32\u67D3\u914D\u7F6E\u6A21\u677F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/render_config_template/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/render_config_template/: + post: + operationId: app_plugin_render_config_template + summary: "\u6E32\u67D3\u914D\u7F6E\u6A21\u677F" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/render_config_template/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/start_debug/: + post: + operationId: plugin_start_debug + summary: "\u5F00\u59CB\u8C03\u8BD5" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/start_debug/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/start_debug/: + post: + operationId: app_plugin_start_debug + summary: "\u5F00\u59CB\u8C03\u8BD5" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/start_debug/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/stop_debug/: + post: + operationId: plugin_stop_debug + summary: "\u505C\u6B62\u8C03\u8BD5" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/stop_debug/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/stop_debug/: + post: + operationId: app_plugin_stop_debug + summary: "\u505C\u6B62\u8C03\u8BD5" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/stop_debug/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/upload/: + post: + operationId: plugin_upload + summary: "\u4E0A\u4F20\u6587\u4EF6\u63A5\u53E3" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/upload/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/upload/: + post: + operationId: app_plugin_upload + summary: "\u4E0A\u4F20\u6587\u4EF6\u63A5\u53E3" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/plugin/upload/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/{id}/: + get: + operationId: plugin_detail + summary: "\u63D2\u4EF6\u8BE6\u60C5" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/{id}/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/{id}/: + get: + operationId: app_plugin_detail + summary: "\u63D2\u4EF6\u8BE6\u60C5" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/{id}/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/plugin/{id}/history/: + get: + operationId: plugin_history + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5305\u5386\u53F2" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/{id}/history/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/plugin/{id}/history/: + get: + operationId: app_plugin_history + summary: "\u67E5\u8BE2\u63D2\u4EF6\u5305\u5386\u53F2" + tags: + - backend_plugin + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/plugin/{id}/history/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/check_task_ready/: + post: + operationId: subscription_check_task_ready + summary: "\u67E5\u8BE2\u4EFB\u52A1\u662F\u5426\u5DF2\u51C6\u5907\u5B8C\u6210" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/check_task_ready/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/check_task_ready/: + post: + operationId: app_subscription_check_task_ready + summary: "\u67E5\u8BE2\u4EFB\u52A1\u662F\u5426\u5DF2\u51C6\u5907\u5B8C\u6210" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/check_task_ready/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/collect_task_result_detail/: + post: + operationId: collect_task_result_detail + summary: "\u91C7\u96C6\u4EFB\u52A1\u6267\u884C\u8BE6\u7EC6\u7ED3\u679C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/collect_task_result_detail/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/collect_task_result_detail/: + post: + operationId: app_collect_task_result_detail + summary: "\u91C7\u96C6\u4EFB\u52A1\u6267\u884C\u8BE6\u7EC6\u7ED3\u679C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/collect_task_result_detail/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/create/: + post: + operationId: subscription_create + summary: "\u521B\u5EFA\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/create/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/create/: + post: + operationId: app_subscription_create + summary: "\u521B\u5EFA\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/create/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/delete/: + post: + operationId: subscription_delete + summary: "\u5220\u9664\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/delete/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/delete/: + post: + operationId: app_subscription_delete + summary: "\u5220\u9664\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/delete/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/fetch_commands/: + post: + operationId: fetch_commands + summary: "\u8FD4\u56DE\u5B89\u88C5\u547D\u4EE4" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/fetch_commands/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/fetch_commands/: + post: + operationId: app_fetch_commands + summary: "\u8FD4\u56DE\u5B89\u88C5\u547D\u4EE4" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/fetch_commands/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/info/: + post: + operationId: subscription_info + summary: "\u8BA2\u9605\u8BE6\u60C5" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/info/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/info/: + post: + operationId: app_subscription_info + summary: "\u8BA2\u9605\u8BE6\u60C5" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/info/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/instance_status/: + post: + operationId: subscription_instance_status + summary: "\u67E5\u8BE2\u8BA2\u9605\u8FD0\u884C\u72B6\u6001" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/instance_status/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/instance_status/: + post: + operationId: app_subscription_instance_status + summary: "\u67E5\u8BE2\u8BA2\u9605\u8FD0\u884C\u72B6\u6001" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/instance_status/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/query_host_policy/: + get: + operationId: subscription_query_host_policy + summary: "\u83B7\u53D6\u4E3B\u673A\u7B56\u7565\u5217\u8868" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/subscription/query_host_policy/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/query_host_policy/: + get: + operationId: app_subscription_query_host_policy + summary: "\u83B7\u53D6\u4E3B\u673A\u7B56\u7565\u5217\u8868" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/subscription/query_host_policy/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/query_host_subscriptions/: + get: + operationId: query_host_subscriptions + summary: "\u83B7\u53D6\u4E3B\u673A\u8BA2\u9605\u5217\u8868" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/subscription/query_host_subscriptions/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/query_host_subscriptions/: + get: + operationId: app_query_host_subscriptions + summary: "\u83B7\u53D6\u4E3B\u673A\u8BA2\u9605\u5217\u8868" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/subscription/query_host_subscriptions/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/retry/: + post: + operationId: subscription_retry + summary: "\u91CD\u8BD5\u5931\u8D25\u7684\u4EFB\u52A1" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/retry/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/retry/: + post: + operationId: app_subscription_retry + summary: "\u91CD\u8BD5\u5931\u8D25\u7684\u4EFB\u52A1" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/retry/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/revoke/: + post: + operationId: subscription_revoke + summary: "\u7EC8\u6B62\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/revoke/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/revoke/: + post: + operationId: app_subscription_revoke + summary: "\u7EC8\u6B62\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/revoke/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/run/: + post: + operationId: subscription_run + summary: "\u6267\u884C\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/run/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/run/: + post: + operationId: app_subscription_run + summary: "\u6267\u884C\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/run/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/search_deploy_policy/: + post: + operationId: subscription_search_policy + summary: "\u67E5\u8BE2\u7B56\u7565\u5217\u8868" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/search_deploy_policy/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/search_deploy_policy/: + post: + operationId: app_subscription_search_policy + summary: "\u67E5\u8BE2\u7B56\u7565\u5217\u8868" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/search_deploy_policy/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/statistic/: + post: + operationId: subscription_statistic + summary: "\u7EDF\u8BA1\u8BA2\u9605\u4EFB\u52A1\u6570\u636E" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/statistic/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/statistic/: + post: + operationId: app_subscription_statistic + summary: "\u7EDF\u8BA1\u8BA2\u9605\u4EFB\u52A1\u6570\u636E" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/statistic/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/switch/: + post: + operationId: subscription_switch + summary: "\u8BA2\u9605\u542F\u505C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/switch/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/switch/: + post: + operationId: app_subscription_switch + summary: "\u8BA2\u9605\u542F\u505C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/switch/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/switch_biz/: + post: + operationId: subscription_switch_biz + summary: "\u542F\u7528/\u7981\u7528\u4E1A\u52A1\u8BA2\u9605\u5DE1\u68C0" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/switch_biz/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/switch_biz/: + post: + operationId: app_subscription_switch_biz + summary: "\u542F\u7528/\u7981\u7528\u4E1A\u52A1\u8BA2\u9605\u5DE1\u68C0" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/switch_biz/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/task_result/: + post: + operationId: subscription_task_result + summary: "\u4EFB\u52A1\u6267\u884C\u7ED3\u679C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/task_result/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/task_result/: + post: + operationId: app_subscription_task_result + summary: "\u4EFB\u52A1\u6267\u884C\u7ED3\u679C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/task_result/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/task_result_detail/: + post: + operationId: subscription_task_result_detail + summary: "\u4EFB\u52A1\u6267\u884C\u8BE6\u7EC6\u7ED3\u679C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/task_result_detail/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/task_result_detail/: + post: + operationId: app_subscription_task_result_detail + summary: "\u4EFB\u52A1\u6267\u884C\u8BE6\u7EC6\u7ED3\u679C" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/task_result_detail/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/subscription/update/: + post: + operationId: subscription_update + summary: "\u66F4\u65B0\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/update/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/subscription/update/: + post: + operationId: app_subscription_update + summary: "\u66F4\u65B0\u8BA2\u9605" + tags: + - subscription + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/subscription/update/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/sync_task/create/: + post: + operationId: sync_task_create + summary: "\u521B\u5EFA\u540C\u6B65\u4EFB\u52A1" + tags: + - sync_task + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/sync_task/create/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/sync_task/create/: + post: + operationId: app_sync_task_create + summary: "\u521B\u5EFA\u540C\u6B65\u4EFB\u52A1" + tags: + - sync_task + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /backend/api/sync_task/create/ + timeout: 0 + isPublic: true + matchSubpath: false + /backend/api/sync_task/status/: + get: + operationId: sync_task_status + summary: "\u67E5\u8BE2\u540C\u6B65\u4EFB\u52A1\u72B6\u6001" + tags: + - sync_task + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/sync_task/status/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/backend/api/sync_task/status/: + get: + operationId: app_sync_task_status + summary: "\u67E5\u8BE2\u540C\u6B65\u4EFB\u52A1\u72B6\u6001" + tags: + - sync_task + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /backend/api/sync_task/status/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/encrypt_rsa/fetch_public_keys/: + post: + operationId: fetch_public_keys + summary: "\u83B7\u53D6\u516C\u94A5\u5217\u8868" + tags: + - rsa + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/encrypt_rsa/fetch_public_keys/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/encrypt_rsa/fetch_public_keys/: + post: + operationId: app_fetch_public_keys + summary: "\u83B7\u53D6\u516C\u94A5\u5217\u8868" + tags: + - rsa + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/encrypt_rsa/fetch_public_keys/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/gray/build/: + post: + operationId: gray_build + summary: "GSE 2.0\u7070\u5EA6" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/build/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/gray/build/: + post: + operationId: app_gray_build + summary: "GSE 2.0\u7070\u5EA6" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/build/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/gray/info/: + get: + operationId: gray_info + summary: "\u83B7\u53D6GSE 2.0\u7070\u5EA6\u4FE1\u606F" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: get + name: default + path: /core/api/gray/info/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/gray/info/: + get: + operationId: app_gray_info + summary: "\u83B7\u53D6GSE 2.0\u7070\u5EA6\u4FE1\u606F" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: get + name: default + path: /core/api/gray/info/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/gray/rollback/: + post: + operationId: gray_rollback + summary: "GSE 2.0\u7070\u5EA6\u56DE\u6EDA" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/rollback/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/gray/rollback/: + post: + operationId: app_gray_rollback + summary: "GSE 2.0\u7070\u5EA6\u56DE\u6EDA" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/rollback/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/gray/rollback_agent_id/: + post: + operationId: rollback_agent_id + summary: "\u56DE\u6EDAAgent ID\u914D\u7F6E" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/rollback_agent_id/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/gray/rollback_agent_id/: + post: + operationId: app_rollback_agent_id + summary: "\u56DE\u6EDAAgent ID\u914D\u7F6E" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/rollback_agent_id/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/gray/upgrade_to_agent_id/: + post: + operationId: upgrade_to_agent_id + summary: "\u5347\u7EA7\u5230Agent ID\u914D\u7F6E" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/upgrade_to_agent_id/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/gray/upgrade_to_agent_id/: + post: + operationId: app_upgrade_to_agent_id + summary: "\u5347\u7EA7\u5230Agent ID\u914D\u7F6E" + tags: + - gray + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/gray/upgrade_to_agent_id/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_host/check/: + post: + operationId: ipchooser_host_check + summary: "\u6839\u636E\u7528\u6237\u624B\u52A8\u8F93\u5165\u7684`IP`/`IPv6`/`\u4E3B\ + \u673A\u540D`/`host_id`\u7B49\u5173\u952E\u5B57\u4FE1\u606F\u83B7\u53D6\u771F\ + \u5B9E\u5B58\u5728\u7684\u673A\u5668\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_host/check/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_host/check/: + post: + operationId: app_ipchooser_host_check + summary: "\u6839\u636E\u7528\u6237\u624B\u52A8\u8F93\u5165\u7684`IP`/`IPv6`/`\u4E3B\ + \u673A\u540D`/`host_id`\u7B49\u5173\u952E\u5B57\u4FE1\u606F\u83B7\u53D6\u771F\ + \u5B9E\u5B58\u5728\u7684\u673A\u5668\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_host/check/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_host/details/: + post: + operationId: ipchooser_host_details + summary: "\u6839\u636E\u4E3B\u673A\u5173\u952E\u4FE1\u606F\u83B7\u53D6\u673A\ + \u5668\u8BE6\u60C5\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_host/details/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_host/details/: + post: + operationId: app_ipchooser_host_details + summary: "\u6839\u636E\u4E3B\u673A\u5173\u952E\u4FE1\u606F\u83B7\u53D6\u673A\ + \u5668\u8BE6\u60C5\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_host/details/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_topo/agent_statistics/: + post: + operationId: ipchooser_topo_agent_statistics + summary: "\u83B7\u53D6\u591A\u4E2A\u62D3\u6251\u8282\u70B9\u7684\u4E3B\u673A\ + \ Agent \u72B6\u6001\u7EDF\u8BA1\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/agent_statistics/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_topo/agent_statistics/: + post: + operationId: app_ipchooser_topo_agent_statistics + summary: "\u83B7\u53D6\u591A\u4E2A\u62D3\u6251\u8282\u70B9\u7684\u4E3B\u673A\ + \ Agent \u72B6\u6001\u7EDF\u8BA1\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/agent_statistics/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_topo/query_host_id_infos/: + post: + operationId: ipchooser_topo_query_host_id_infos + summary: "\u6839\u636E\u591A\u4E2A\u62D3\u6251\u8282\u70B9\u4E0E\u641C\u7D22\ + \u6761\u4EF6\u6279\u91CF\u5206\u9875\u67E5\u8BE2\u6240\u5305\u542B\u7684\u4E3B\ + \u673A ID \u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/query_host_id_infos/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_topo/query_host_id_infos/: + post: + operationId: app_ipchooser_topo_query_host_id_infos + summary: "\u6839\u636E\u591A\u4E2A\u62D3\u6251\u8282\u70B9\u4E0E\u641C\u7D22\ + \u6761\u4EF6\u6279\u91CF\u5206\u9875\u67E5\u8BE2\u6240\u5305\u542B\u7684\u4E3B\ + \u673A ID \u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/query_host_id_infos/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_topo/query_hosts/: + post: + operationId: ipchooser_topo_query_hosts + summary: "\u6839\u636E\u591A\u4E2A\u62D3\u6251\u8282\u70B9\u4E0E\u641C\u7D22\ + \u6761\u4EF6\u6279\u91CF\u5206\u9875\u67E5\u8BE2\u6240\u5305\u542B\u7684\u4E3B\ + \u673A\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/query_hosts/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_topo/query_hosts/: + post: + operationId: app_ipchooser_topo_query_hosts + summary: "\u6839\u636E\u591A\u4E2A\u62D3\u6251\u8282\u70B9\u4E0E\u641C\u7D22\ + \u6761\u4EF6\u6279\u91CF\u5206\u9875\u67E5\u8BE2\u6240\u5305\u542B\u7684\u4E3B\ + \u673A\u4FE1\u606F" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/query_hosts/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_topo/query_path/: + post: + operationId: ipchooser_topo_query_path + summary: "\u67E5\u8BE2\u591A\u4E2A\u8282\u70B9\u62D3\u6251\u8DEF\u5F84" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/query_path/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_topo/query_path/: + post: + operationId: app_ipchooser_topo_query_path + summary: "\u67E5\u8BE2\u591A\u4E2A\u8282\u70B9\u62D3\u6251\u8DEF\u5F84" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/query_path/ + timeout: 0 + isPublic: true + matchSubpath: false + /core/api/ipchooser_topo/trees/: + post: + operationId: ipchooser_topo_trees + summary: "\u6279\u91CF\u83B7\u53D6\u542B\u5404\u8282\u70B9\u4E3B\u673A\u6570\ + \u91CF\u7684\u62D3\u6251\u6811" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: true + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/trees/ + timeout: 0 + isPublic: true + matchSubpath: false + /app/core/api/ipchooser_topo/trees/: + post: + operationId: app_ipchooser_topo_trees + summary: "\u6279\u91CF\u83B7\u53D6\u542B\u5404\u8282\u70B9\u4E3B\u673A\u6570\ + \u91CF\u7684\u62D3\u6251\u6811" + tags: + - ipchooser + x-bk-apigateway-resource: + allowApplyPermission: true + authConfig: + appVerifiedRequired: true + resourcePermissionRequired: true + userVerifiedRequired: false + backend: + matchSubpath: false + method: post + name: default + path: /core/api/ipchooser_topo/trees/ + timeout: 0 + isPublic: true + matchSubpath: false diff --git a/support-files/kubernetes/helm/bk-nodeman/templates/configmaps/env-configmap.yaml b/support-files/kubernetes/helm/bk-nodeman/templates/configmaps/env-configmap.yaml index 648a257b7..dcd2d1e17 100644 --- a/support-files/kubernetes/helm/bk-nodeman/templates/configmaps/env-configmap.yaml +++ b/support-files/kubernetes/helm/bk-nodeman/templates/configmaps/env-configmap.yaml @@ -134,3 +134,4 @@ data: BKAPP_IEOD_ACTIVE_FIREWALL_POLICY_SCRIPT_INFO: '{{ .Values.config.bkAppIEODActiveFirewallPolicyScriptInfo }}' BKAPP_DEFAULT_INSTALL_CHANNEL_ID: "{{ .Values.config.bkAppDefaultInstallChannelId}}" BKAPP_AUTOMATIC_CHOICE_CLOUD_ID: "{{ .Values.config.bkAppAutomaticChoiceCloudId}}" + SYNC_APIGATEWAY_ENABLED: '{{ .Values.config.bkAppSyncApiGatewayEnabled }}' diff --git a/urls.py b/urls.py index 4c370edc3..6ec62995a 100644 --- a/urls.py +++ b/urls.py @@ -20,19 +20,6 @@ from version_log import config -schema_view = get_schema_view( - openapi.Info( - title="Bk Nodeman API", - default_version="v1", - description="节点管理", - terms_of_service="https://bk.tencent.com/info/#laws", - contact=openapi.Contact(email="contactus_bk@tencent.com"), - license=openapi.License(name="MIT License"), - ), - public=True, - permission_classes=(permissions.IsAdminUser,), -) - urlpatterns = [ url(r"^admin_nodeman/", admin.site.urls), url(r"^account/", include("blueapps.account.urls")), @@ -44,6 +31,21 @@ ] if settings.ENVIRONMENT not in ["production", "prod"]: + openapi_info = openapi.Info( + title="Bk Nodeman API", + default_version="v1", + description="节点管理", + terms_of_service="https://bk.tencent.com/info/#laws", + contact=openapi.Contact(email="contactus_bk@tencent.com"), + license=openapi.License(name="MIT License"), + ) + + schema_view = get_schema_view( + openapi_info, + public=True, + permission_classes=(permissions.IsAdminUser,), + ) + urlpatterns += [ re_path(r"^swagger(?P\.json|\.yaml)$", schema_view.without_ui(cache_timeout=0), name="schema-json"), re_path(r"^swagger/$", schema_view.with_ui("swagger", cache_timeout=0), name="schema-swagger-ui"),